How to check last unexpected reboot time Solaris 10?


 
Thread Tools Search this Thread
Operating Systems Solaris How to check last unexpected reboot time Solaris 10?
# 1  
Old 01-23-2015
How to check last unexpected reboot time Solaris 10?

Dear all

can you give me command to show me last unexpected reboot time the date, month, and the year on solaris 10

i've tried

uptime

who-b

last reboot


but nothing give me the year last reboot only the date , month and time
# 2  
Old 01-23-2015
Usually, dates within the last six months are given with a time stamp, and dates beyond that print the year.
# 3  
Old 01-23-2015
hey rudy
thanks for the answer

btw where i can find reboot log in solaris 10?
and what it the command tq,
# 4  
Old 01-23-2015
Here is a simple way ;-) :
Code:
printf "%s\n" "$(perl -e "print scalar(localtime($(kstat -p unix:0:system_misc:boot_time | cut -f 2)))")"

# 5  
Old 01-23-2015
hey jlliagre,

after i input your script

the output is like this:


Code:
# printf "%s\n" "$(perl -e "print scalar(localtime($(kstat -p unix:0:system_misc:boot_time | cut -f 2)))")"
syntax error: `(' unexpected


am i make mistake?

Moderator's Comments:
Mod Comment Please wrap all code, files, input & output/errors in CODE tags
It makes them far easier to read and preserves multiple spaces

Last edited by rbatte1; 01-23-2015 at 07:30 AM.. Reason: Added CODE tags
# 6  
Old 01-23-2015
Your mistake is to use an obsolete shell.

Switch to ksh or bash.

Alternatively, run :
Code:
ksh -c 'printf "%s\n" "$(perl -e "print scalar(localtime($(kstat -p unix:0:system_misc:boot_time | cut -f 2)))")"'

# 7  
Old 01-23-2015
hey jlliagre

you right, i foget to bash mode

thankyou very much
it's solve
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Changing only time zone file not the timezone without reboot

Hello all, I just want to update the timezone file with new file to update the time, so the zone in /etc/TIMEZONE will be the same but the file it refers to will be changed, and the local time should be changed, can this take effect without rebooting Solaris 10? (9 Replies)
Discussion started by: Amr.Es
9 Replies

2. 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

3. Solaris

Unable to reboot Solaris

Hi, we have a sun sparc solaris 10 machine and recently there was a power failure and one of the server domain was down. So today morning i have powered up the domain and it returned me to ok prompt then i have booted the machine with disk from devalias, the system was up as normal and no error... (0 Replies)
Discussion started by: phanidhar6039
0 Replies

4. Solaris

solaris 10 reboot history

Dears Kindly am requested to collect the date histroy that the system was rebooted, so is there any log file or command that i can find the time that the system was rebooted? thanks a lot for you kind support. (2 Replies)
Discussion started by: thehero
2 Replies

5. Solaris

Any specific time to reboot the sun server to avoid unplanned outage ??

Hi, Would like to know the uptime or specific time limit to reboot the sun microsystem to avoid unplanned outage. Regards,Tarun (9 Replies)
Discussion started by: taruntan
9 Replies

6. Solaris

Unexpected error on reboot in UNIX

Hi all, My remote unix machine failed unexpectly, and I am unable to login to it. Here is what I can see on the screen - > Boot device: .... File and args: -i > Boot load failed. > The file just loaded does not appear to be executable. > {1} ok How can I fix this problem? Has... (1 Reply)
Discussion started by: bhakti.gandhi
1 Replies

7. Shell Programming and Scripting

How to stop monitoring of servers at the time of reboot through shell scripting?

We have number of servers which belongs to platforms Solaris, AIX,HP-UX and LINUX. Monitoring tool 'Patrol Agent' process run on the servers to check for the server health and communicate with the Patrol server through the port 5181. During scheduled reboot and maintenance of servers we do receive... (1 Reply)
Discussion started by: subharai
1 Replies

8. SuSE

How to check Server reboot reason

Hi, I want to know how can we check Server reboot reason on Suse linux ? or what caused server to reboot or hung. anyone knows abut the it. ? Bryan (3 Replies)
Discussion started by: bryanabhay
3 Replies

9. AIX

How to check who/which id perform a system reboot?

Hi Guys, I would like to know is there a way to find out who or which id performed the system reboot?Uptime only shows the last date the system was reboot but no userid or ip add.Need to investigate something due to some reboot issues. Thanks Giri (1 Reply)
Discussion started by: giriplug
1 Replies
Login or Register to Ask a Question