uptime and last reboot command in solaris


 
Thread Tools Search this Thread
Operating Systems Solaris uptime and last reboot command in solaris
# 1  
Old 06-17-2010
CPU & Memory 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
# 2  
Old 06-17-2010
These options are described in the concerning man pages.
Is there anything unclear to you?
# 3  
Old 06-17-2010
I have executed the command "last reboot" and it is showing an output

wtmp begins Thu Jun 17 10:11

Is it means that the sytem has been booted on 17th June,Thu around 10.11a.m ?

I am not able to run 'who -b' command in some solaris boxes why it is not executed i don't understand though 'who' is executed in that box.
# 4  
Old 06-17-2010
The exact name and location of "utmp" and "wtmp" files varies. See "man who" to find out the names on your system. Then check whether the files exist and have size, and that "wtmp" is not size 2Gb (i.e. too big). If the "utmp" and "wtmp" files are missing they have to be created manually with the correct permissions for your system prior to rebooting the system.

Your output from your "last reboot" just shows that there is no "reboot" record in the "wtmp" file possibly because that file has been deleted, nulled or corrupted since the computer was last booted. Many sites age this file weekly to stop it getting too big.
An error from "who -b" suggests that the "utmp" file has been deleted, nulled or corrupted since the computer was last booted and that it does not contain a "system boot" record.
The "uptime" command uses the same information as "who -b" with the advantage that it is correct when system has been up for more than a year.
# 5  
Old 06-17-2010
Actually i am looking forward to find the information about the server last boot time
i have used 'uptime' coomand to find out this and it gives an output like
3:50pm 2 users, load average: 1.39, 1.25, 1.24
Is it indicating something ? As i understand i am not able to find the no of days or time from this output. am i right?
Can you advice some other method with the help which i can find the last boot time of my server?
# 6  
Old 06-17-2010
is working below command in solaris box
Code:
 
last reboot | head -n 1



---------- Post updated at 05:27 PM ---------- Previous update was at 05:25 PM ----------

In this code no uptime
Code:
 
3:50pm 2 users, load average: 1.39, 1.25, 1.24

was must be
Code:
 
3:50pm up 2:50 2 users, load average: 1.39, 1.25, 1.24

# 7  
Old 06-17-2010
What version of Solaris are you using? wtmp/utmp has been obsoleted on Solaris for long time. See the wtmp man page.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help to check uptime post 30 min or so after every reboot

Hi, Please help me to cross verify the post reboot time. I want to execute some script after every reboot, which will happen only post 20-30 mins of reboot. If uptime is >24hrs, script should not execute. I tried with below command, but seems no luck. >> uptime | sed 's/^.*up//' | awk -F,... (1 Reply)
Discussion started by: KailasB
1 Replies

2. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: Yeaboem
1 Replies

3. Solaris

Reboot solaris box(What are all the command outputs)

Hi What are all the command outputs we have to note and keep it for safe before rebooting or shutting down a solaris box (5 Replies)
Discussion started by: newtoaixos
5 Replies

4. Linux

uptime command output when the server is running more than one year?

What is the uptime command output when the server is running more than one year? My doubt is whether it show in number of days format or number years and number of days format? For example, Assume the server is running 400 days 3 hrs 3 min 3 secs. The output like 400 days 3:3 min or 1 year 5... (3 Replies)
Discussion started by: maruthu
3 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. AIX

reset the counter days for uptime command

hello, i send the uptime command in the AIX and the days that is UP 14652 days this is around 40 years, today is with the correct date&time, hos can I reset the counter days? somebody can help me? regards (3 Replies)
Discussion started by: timflr
3 Replies

8. Shell Programming and Scripting

Extracting load average from uptime command

The output ofthe uptime command gives: 9:40am up 9 days, 10:36, 4 users, load average: 0.02, 0.01, 0.00 How can i extract the portion "load average: 0.02, 0.01, 0.00". (3 Replies)
Discussion started by: proactiveaditya
3 Replies

9. Shell Programming and Scripting

get only the up time from uptime command

Hi all,:o i am new to shell scripting and i have aproblem like i just want to extractthe uptime of the system from an uptime command which gives the output as the Current time , how long the system has been running,how many users are surrently logged on and the system load averages for past 1,5,... (5 Replies)
Discussion started by: tulip
5 Replies

10. UNIX for Dummies Questions & Answers

Interpretation of the uptime command

Hi there, do someone have detailed information how to interpret the uptime command or rather which values can be called normal? (i know what the information means, but i have no idea if these values are ok or to high: 3:02pm an 13:53, 2 Benutzer, Durchschnittslast: 10,06, 12,05, 13,00) ... (5 Replies)
Discussion started by: odin1999
5 Replies
Login or Register to Ask a Question