- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- uptime script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 12:28 AM
07-30-2004 12:28 AM
uptime script
I didn't find in forum exactly What i want. Can you help me out?
I don't have any tool to calculate uptime report for server.
I am using HP-ux 11.00 on 9000/800/L2000-5X. We have more than 6
hp-ux servers.
If anybody can give me any script or tell me how to calculate server
uptime then it would be better for me. Can i get six months back uptime?
If yes how?
Will be Highly obliged for any suggestion and help.
Rgds
Tapas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 12:40 AM
07-30-2004 12:40 AM
Re: uptime script
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 12:42 AM
07-30-2004 12:42 AM
Re: uptime script
Use "uptime" and "ruptime" commands. Also you need to start rwhod daemon.
See man uptime.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 12:42 AM
07-30-2004 12:42 AM
Re: uptime script
For the current value, just use the uptime command.
Some historical data can be found in /etc/shutdownlog (but this won't tell you how long your server was down for).
What you probably need to do is to set up a script in /sbin/init.d which will be called at startup and shutdown, which creates a log entry indicating when the server state changed (this won't capture crash information though).
You also need to consider if you want your report to availability details of the applications on your servers (in my experience, you're more likely to see application downtime than server downtime). In order to do this, you'd need to extract the relevant details from your application log files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 12:44 AM
07-30-2004 12:44 AM
Re: uptime script
last |grep reboot
What would work nicely is Big Brother:
http://www.bb4.org/
It has built in availability reports that are generated in a nice web view.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:13 AM
07-30-2004 01:13 AM
Re: uptime script
Use w
topaz:/root # w
3:11pm up 53 days, 6:21, 11 users, load average: 0.02, 0.03, 0.03
User tty login@ idle JCPU PCPU what
root console 2:10pm576:53 15:48 15:48 -sh
steves pts/1 10:54am 17 -sh
root pts/2 9:03am 27:21 7 7 -sh
root pts/3 3:28pm 46:27 2 2 -sh
root pts/4 12:19pm573:09 5 5 -sh
root pts/5 3:38pm 22:25 -sh
root pts/6 11:49am 3:20 -sh
root pts/7 1:06pm 26 rlogin wilson
root pts/10 3:11pm w
root pts/11 2:48pm 23 telnet wilsongsp
root pts/5 2:50pm 22:25 -sh
topaz:/root #
Gives a useful snapshot
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:34 AM
07-30-2004 01:34 AM
Re: uptime script
If you want to calculate server's uptime on the whole local network ruptime. But rwhod(eamon) must be running on all systems in the network
If you want get uptime sometime back, change the time and date settings using date command and check the uptime command.
2:51am up 4:43, 3 users, load average: 0.00, 0.00, 0.00
date: do you really want to run time backwards?[yes/no]yes
unable to write utmps record to wtmps database
unable to write utmps record to wtmps database
Tue Aug 3 01:51:00 PDT 2004
1:51am up 4:43, 3 users, load average: 0.00, 0.00, 0.00
It will do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:44 AM
07-30-2004 01:44 AM
Re: uptime script
I (and hopefully many others) would say that you should never reset the date on a server just to get the uptime reading at that time.
Depending on what applications you're running, you could create a serious problem for yourself with duplicate timestamps etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 01:46 AM
07-30-2004 01:46 AM
Re: uptime script
Meant to say that in fact, changing the time won't even give you that;
2:51am up 4:43, 3 users, load average: 0.00, 0.00, 0.00
date: do you really want to run time backwards?[yes/no]yes
unable to write utmps record to wtmps database
unable to write utmps record to wtmps database
Tue Aug 3 01:51:00 PDT 2004
1:51am up 4:43, 3 users, load average: 0.00, 0.00, 0.00
As you can see, in both cases, your uptime value is 4:43
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2004 05:51 AM
07-30-2004 05:51 AM
Re: uptime script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2004 09:51 PM
08-01-2004 09:51 PM
Re: uptime script
Chris: Yes you are right. Actually i want something which will report me previous months uptime report also(i mean the duration of shutdown).
Geoff: I have not tried bigbrother yet. Just downloaded. Don't knwo how to use.
BTW, if do anyone of you have any good script which calculates uptime
based on server shutdowndown log and uptime then it will be great.
Rgds
Tapas