Use cron to check if server error alive?

Use cron to check if server error alive?

Postby paros » Sat Nov 22, 2014 5:35 am

Is it posible to use cron scheduler to check if a specific Web server is alive and running?
paros
 
Posts: 54
Joined: Mon Mar 12, 2012 6:28 am

Re: Use cron to check if server error alive?

Postby Jocko » Sat Nov 22, 2014 9:05 am

hi Paros,

Yes, you should be able to do it.

If no pid file exist with your server, you can use the ps command, like this For example with btsync server
Code: Select all
ps -ef|grep btsync|grep -c grep
. You get 1 if it is running and 0 if not.

if you have a pid file, you can use the command line, still with btsync server:
Code: Select all
cat /proc/`cat /var/run/btsync.pid`/cmdline|grep -c btsync
you get 0 if it is not running and >0 if it is running
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 2 guests