How to monitor how many seconds server is down?

P

postcd

Guest
Hello,

an Linux VPS, i expect it to go offline (turn off) for some minutes or hours and i woul like to somehow simply discover how many seconds it was offline? Please how can i do it?

i have other linux server at hand too, Thank you
 


You can check the log files to see when it shut off an came on again. It's usually in /var/log/syslog for ubutnu or /var/log/messages for redhat. Most of the time the kernal logs on system boot so you can see when it started up. The shutdown command also logs. You can subtract the timestamp of the first and last log to see the gap.
 
that is a good idea, in this vps server case i expect to be suspended or some kind of snapshot, not a shutdown or reboot
 
What precision do you need?
If the precision about 10 sec. is suitable for you then you can use any external monitoring system (for example Zabbix) installed on other Linux server.
You can try to create own simple shell script to monitor the availability of your host by the ping.
In this case you can get the precision from 1 sec. or even less.
 

Members online


Top