1752782 Members
6247 Online
108789 Solutions
New Discussion юеВ

Re: Uptime

 
SOLVED
Go to solution
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 ?