LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2014, 02:00 AM   #1
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Rep: Reputation: Disabled
server restart check


Hi,

I am using centos 6 x86. How can i check who restarted server and at what time. i am getting
Code:
[root@swift ~]# who -b
         system boot  2014-05-19 05:40
And

Code:
[root@swift ~]# last reboot
reboot   system boot  2.6.32-358.el6.x Mon May 19 05:40 - 07:49  (02:09)    
reboot   system boot  2.6.32-358.el6.x Wed Apr  2 06:47 - 07:49 (47+01:02)  
reboot   system boot  2.6.32-358.el6.x Fri Feb 28 16:06 - 07:49 (79+14:43)
Could any one help me to explain it and dig into it more.
 
Old 05-19-2014, 02:24 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
the last reboot command is ok, you need to know who executed that. Probably it was executed as root, therefore you need to know who was logged in as root that time...
 
Old 05-19-2014, 02:27 AM   #3
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
the last reboot command is ok, you need to know who executed that. Probably it was executed as root, therefore you need to know who was logged in as root that time...
How to know who logged in as root and at what time it was restated? could you explain above given outputs.
 
Old 05-19-2014, 02:31 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
no, I'm really sorry, but that information is not enough. First you need to check the command last again: who was logged in at all that time
 
Old 05-19-2014, 02:33 AM   #5
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
no, I'm really sorry, but that information is not enough. First you need to check the command last again: who was logged in at all that time
Code:
[root@swift ~]# last |more
root     pts/2        gaidl-5015.gai.n Mon May 19 07:42   still logged in   
sachin.d pts/2        gaidl-5015.gai.n Mon May 19 07:40 - 07:42  (00:01)    
root     pts/2        gaidl-5015.gai.n Mon May 19 07:40 - 07:40  (00:00)    
rajkumar pts/1        tugelanew.gai.ne Mon May 19 07:31   still logged in   
sathish. pts/0        tugelanew.gai.ne Mon May 19 07:10   still logged in   
root     pts/0        192.168.0.102    Mon May 19 06:34 - 06:37  (00:03)    
root     pts/0        192.168.0.102    Mon May 19 06:27 - 06:32  (00:04)    
root     pts/1        tugelanew.gai.ne Mon May 19 06:18 - 06:23  (00:05)    
root     pts/0        192.168.0.102    Mon May 19 06:17 - 06:22  (00:04)    
root     pts/2        tugelanew.gai.ne Mon May 19 06:13 - 06:16  (00:03)    
root     pts/1        192.168.0.102    Mon May 19 06:11 - 06:16  (00:05)    
root     pts/0        tugelanew.gai.ne Mon May 19 06:11 - 06:16  (00:05)    
root     pts/0        192.168.0.102    Mon May 19 06:11 - 06:11  (00:00)    
root     pts/0        192.168.0.102    Mon May 19 06:09 - 06:10  (00:00)    
reboot   system boot  2.6.32-358.el6.x Mon May 19 05:40 - 08:31  (02:51)    
rajkumar pts/0        tugelanew.gai.ne Mon May 19 05:17 - crash  (00:23)    
saidha.r pts/0        tugelanew.gai.ne Fri May 16 16:44 - 17:40  (00:56)    
rajkumar pts/9        tugelanew.gai.ne Fri May 16 12:46 - 13:30  (00:43)    
saidha.r pts/7        tugelanew.gai.ne Fri May 16 12:16 - 18:18  (06:02)    
saidha.r pts/9        192.168.3.3      Fri May 16 11:39 - 11:39  (00:00)    
root     pts/8        gaidl-5015.gai.n Fri May 16 11:35 - 13:43  (02:08)
Whan i ran "last" command, i got above output.
 
Old 05-19-2014, 02:38 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
So you can see there was only one user logged in before reboot, rajkumar. You can ask him/her if he/she knew something about that reboot. You can also check the files /var/log/auth.log, /var/log/messages, probably you can find something related.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to check connection (and restart network if down) mac_phil Linux - Networking 15 06-21-2016 05:59 PM
Script to check if service is running and restart if not? Spuddy Debian 2 11-29-2013 12:12 AM
Check ping result and restart linux2man Linux - Networking 3 08-29-2012 08:45 PM
check and restart (if dead) a daemonized process ABL Linux - Server 4 10-23-2008 01:50 PM
How to restart & check status of ssh server bostonantifan Ubuntu 3 10-30-2007 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration