cancel
Showing results for 
Search instead for 
Did you mean: 

Uptime

SOLVED
Go to solution
System Dude_1
Frequent Advisor

Uptime

Dear Friend,

I'm using ruptime and rhowd to get my server uptime. I've 2 questions that need your kindly reply.

1. I've configured one of my as database server(100.100.100.100) to send and received status information and the rest of my server as sender of the status information. But I could not received status information for server that are in different segment (100.100.200.100). How and what to be configured in order my database server to obtain the information.

2. As the new year is just around the corner. Can I reset the uptime without rebooting as my uptime service level is on yearly basis ans should start fresh on the 1st January.

Performance Issue on HP-UX 10.20
17 REPLIES
Mark Greene_1
Honored Contributor

Re: Uptime

Can't help with your first request, but with your second, the quick answer is no. The longer answer is that you shouldn't rely on the uptime output for service level performance. The box being "up" does not always equate to the box being "available for use", and I would hope that your service agreement makes that distinction, as a network outage would make the system unavailable for use even though the box was still up.

If you are being rigorously measured against your service agreement, your best bet is to maintain accurate logs of the time and date of all system and network outages. This way things like a router dying or loss of power don't count as the box being down. The same with scheduled maintenance, if your agreement makes an allowance for a certain amount of scheduled downtime vs. unscheduled downtime.

HTH
--
mark
the future will be a lot like now, only later
System Dude_1
Frequent Advisor

Re: Uptime

One more question :

How to calculate a real uptime? In this case...If I rely on the system uptime then I will not be accurate any more once the server rebooted as the server uptime will be base on the date it come up. How to calculate uptime for 365 days. In this case the best uptime will be 365x24. But if the server is down the the uptime will be (365x24)-downtime. Is there any script to measure this?
Performance Issue on HP-UX 10.20
Tom Geudens
Honored Contributor

Re: Uptime

Hi,
For your last question. There are probably softwares that can do this for you, but we solved this by using a simple start/stop script in the different levels that logs the "date/time" in a file. Thus we know how long a server was down and how long it took to get through the boot ...

Hope this helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Craig Rants
Honored Contributor

Re: Uptime

I would use the epoch date, i.e.

1003949248 is actually Oct 24 12:47:28

Run this command
root@server: /tcb/files/auth/r # echo "0d1003949248=Y" | adb
2001 Oct 24 12:47:28

I use this for all types of stuff, but with this you could get your QoS stuff down to the second.

Also using rwho, ruptime are major security holes, I would comment these out of inetd.

Here is a link for securing inetd.
http://www.uwsg.indiana.edu/security/inetd.html

HH,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
System Dude_1
Frequent Advisor

Re: Uptime

Hi Tom,

Could you kindly share with me the script. If it suite my environment that maybe I could use it too.
Performance Issue on HP-UX 10.20
Tom Geudens
Honored Contributor
Solution

Re: Uptime

Sure, here it is ...
My excuses if it is not up to scripting standards.

Hope it helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
System Dude_1
Frequent Advisor

Re: Uptime

Why it look for /etc/rc.config.d/boottime. can I just create the file
Performance Issue on HP-UX 10.20
System Dude_1
Frequent Advisor

Re: Uptime

Hi Tom,

Could you reply me
Performance Issue on HP-UX 10.20
John Love_3
Regular Advisor

Re: Uptime

I believe all you need for the /etc/rc.config.d/boottime file is to add the following line:

START_CAPTURE_TIME=1


To turn it of, set it = to 0 (zero)

John
System Dude_1
Frequent Advisor

Re: Uptime

Hi Tom,

It seems that I need to configure a few more thing as the script does not work. Please advice
Performance Issue on HP-UX 10.20
Tom Geudens
Honored Contributor

Re: Uptime

Hi,
I went home "early" yesterday ... sorry about that :-)
You do indeed need a /etc/rc.config.d/boottime script which contains
START_CAPTURE_TIME=1
export START_CAPTURE_TIME

Next you need to "link" the script into your runlevels ...
example for level 2
/sbin/rc2.d/k001boottime
/sbin/rc2.d/s999boottime

Oops ... you need a little C program too ... I must really have been asleap yesterday :-)
date2sec (in attachment).

cc -Wall -Ae +DAportable date2sec-0.3.c -o date2sec-0.3

That should be all you need ...
Tom Geudens




A life ? Cool ! Where can I download one of those from ?
Ron Kinner
Honored Contributor

Re: Uptime

Going back to your original Question number 1. I expect the problem is that there is no route between the 100.100.200.x and 100.100.100.100 machines. I assume you have told the clients to send there syslogs to the 100.100.100.100 and that each machine has the other's name in its /etc/hosts file or can get it through DNS if needed.

Try a ping between the two machines. Does it work?

Yes? Check your router for filters/access lists.

No? Check netstat -rn on both machines. Verify that each has a route to the other subnet (or a default gateway = 0.0.0.0) by way of a friendly router or a level 3 capable switch. If there is no router and the switch is level 2 only then it's not going to work unless you change the mask on both machines to 255.255.0.0 AND both machines are on the same hub/switch/LAN AND they are not in separate VLANs. (You can add a route temporarily with route add but it will vanish at the next reboot. I don't remember offhand where you have to put your routes to make them permanent but I can look it up if you need it.)

If both ends have a route and there is a router there somewhere and there should probably be a route between these guys then try a traceroute. See where it stops. Check the routing where it stops to make sure it knows where to go next and at the next hop to make sure it knows how to get back to you.

Ron
System Dude_1
Frequent Advisor

Re: Uptime

Hi Tom,

Can you please specify the actual command for the linking of the run level

Performance Issue on HP-UX 10.20
Tom Geudens
Honored Contributor

Re: Uptime

Hi,
ln -s /sbin/init.d/boottime /sbin/rc1.d/K001boottime
ln -s /sbin/init.d/boottime /sbin/rc1.d/S999boottime
ln -s /sbin/init.d/boottime /sbin/rc2.d/K001boottime
ln -s /sbin/init.d/boottime /sbin/rc2.d/S999boottime

ln -s /sbin/init.d/boottime /sbin/rc3.d/K001boottime
ln -s /sbin/init.d/boottime /sbin/rc3.d/S999boottime

... should get you started ...
Hope this helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
System Dude_1
Frequent Advisor

Re: Uptime

Hi Tom,

How you translate this info :

STARTED @ 2001-12-22 17:47:00 @ RUNLEVEL 2
===========================================
TOTAL N/A TIME -* 000 Day(s) 00:00:01 *- N/A
===========================================
STARTED @ 2001-12-22 17:47:01 @ RUNLEVEL 1
ELAPSED TIME -* 000 Day(s) 00:08:45 *-
STOPPED @ 2001-12-22 17:55:46 @ RUNLEVEL 1
ELAPSED TIME -* 000 Day(s) 00:01:10 *-
STOPPED @ 2001-12-22 17:56:56 @ RUNLEVEL 2
ELAPSED TIME -* 000 Day(s) 00:00:13 *-
STOPPED @ 2001-12-22 17:57:09 @ RUNLEVEL 3
Performance Issue on HP-UX 10.20
RikTytgat
Honored Contributor

Re: Uptime

Hi,



Yes, you can change the uptime without rebooting the system. The time is calculated from an entry in th utmp(5) file. The records in this file can be read/written using the calls getutent(3) and pututent(3).



It requires some simple C programming. Have a look at the manpages for some examples.



Good luck,

Rik.
Tom Geudens
Honored Contributor

Re: Uptime

Hi,
You have to play a bit with the script to find out which loggings are usefull for you. However, here's the breakdown.

I'd say you were at level 2 when you did an
init 1
and then a
init 3

Since the script considers level 3 or higher to be "UP", you only get a N/A (Not Available)
TOTAL line. If you now take it back down to level 2 you'll get a TOTAL UP line ...

The elapsed times give you the time between two executions of the script. This tells you how long the execution of a runlevel took.

Now, I would like you to send me the outputs of the following commands :
ll /sbin/rc1.d
ll /sbin/rc2.d
ll /sbin/rc3.d
because some loggings seem to be missing.

Hope this helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?