Solaris, Perl, and precise system uptime??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Solaris, Perl, and precise system uptime??
# 1  
Old 05-14-2013
Solaris, Perl, and precise system uptime??

OK folks, my first post here.. hope the community can come up with a clever solution. Cross posting this in the Solaris and Shell scripting forums, as problem is scripting problem specifically on Solaris platform.

I am trying to detect a host's uptime with greater precision than is offered up by the usual suspects (e.g. uptime, who -b, last reboot -n 1, ...). These all offer only hour:minute precision, and don't include the year.

if all the target hosts were running "modern" Solaris, I might be able to grope for answer down /proc/0 (init) path for a useable timestamp, but script must run a) on older Solaris hosts, some with several hundred days of uptime, and b) without any elevated priviledges.

if I could compile some C program, I would grab the output of times(), do some math, and return a standard time value of N seconds since epoch. For the sake of this question, I must rule out that possibility. The solution must be basic Perl or shell script, executing any standard tools included with the Solaris distribution.

Anyone know of a value to inspect using kstat? mdb? dtrace?
# 2  
Old 05-14-2013
Cross postings is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[zenity] precise progress bar

Hello everyone, Is it possible to have a precise progress bar in zenity during the execution of the following: find -type f \( -not -name "$file_name".md5 \) -exec md5sum '{}' \; > "$file_name".md5Currently I am using zenity --title="Running..." --progress --pulsate --auto-close... (1 Reply)
Discussion started by: soichiro
1 Replies

2. AIX

Managed system's uptime

How to find Physical server uptime from HMC/ ASMI. Server was in standby mode. We have started the Lpar manually. Server rebooted automatically but no information updated in Lpars's errpt, alog.console or HMC prior to the reboot. (1 Reply)
Discussion started by: sunnybee
1 Replies

3. Solaris

Precise system uptime??

OK folks, my first post here.. hope the community can come up with a clever solution. Cross posting this in the Solaris and Shell scripting forums, as problem is scripting problem specifically on Solaris platform. I am trying to detect a host's uptime with greater precision than is offered up... (1 Reply)
Discussion started by: Yeaboem
1 Replies

4. Solaris

Finding system uptime without login

Hi, Am writing a script where I want to find uptime of certain servers. Is there any command where we can find uptime without login to the server, since the server list is big logging to the server will time consuming. Thanks in advance (7 Replies)
Discussion started by: rogerben
7 Replies

5. Solaris

uptime command not showing how long the system has been up

Hello folks, uptime command not shows how long the system has been up. I know it come from a corruption of /var/adm/utmpx file. I've done : cat /dev/null > /var/adm/utmpx Now who and last commands work fine. But uptime still give me back an answer without the "up time". In which... (6 Replies)
Discussion started by: gogol_bordello
6 Replies

6. Shell Programming and Scripting

Extract the uptime from the output of the uptime command

Hi! I want to extract the uptime from the output of the uptime command. The output: 11:53 up 3:02, 2 users, load averages: 0,32 0,34 0,43 I just need the "3:02" part. How can I do this? Dirk (6 Replies)
Discussion started by: Dirk Einecke
6 Replies

7. UNIX for Dummies Questions & Answers

Difference between system uptime and last boot time.

My Linux system was last rebooted few hours ago. But it seems little confusing for me to figure out the exact reason behind it. I guess following command should justify what i meant to say. # date Wed May 11 13:22:49 IST 2011 # last | grep "May 10" reboot system boot 2.6.18-194.el5 ... (5 Replies)
Discussion started by: pinga123
5 Replies

8. Solaris

uptime and last reboot command in solaris

Hi, Can someone explain in detail what 'uptime' ,'last reboot' and 'who -b' commands do in solaris. this commands are not executing in every solaris box. why this is happening. Has solaris got some inbuilt commands into it. If yes then where i have found them? Thanks,Soubhik (6 Replies)
Discussion started by: soubmukh
6 Replies

9. Solaris

Required installation steps for perl 5.8.9 on Solaris 2.8 operating system

Hi Can any one suggest me the instalation guideline for perl 5.8.9 on UNIX/solaris 2.8 environment. Pooja (2 Replies)
Discussion started by: wadhwa.pooja
2 Replies

10. Solaris

rsh commands not getting executed from Solaris 10 System to AIX System

Hi Friends, I am trying to execute rsh commands from Solaris 10 system to AIX system. When I give; Solaris10# rsh <hostname> ls -l , it gives me an error rshd : 0826-826 The host name for your address is not known At the same time, Solaris10# rsh <hostname> ---- gives me remote shell of... (25 Replies)
Discussion started by: jumadhiya
25 Replies
Login or Register to Ask a Question