# Which lightweight self hosted remote monitoring script would you recommend?



## fixidixi (Oct 7, 2013)

Hy,

I've read this topic and did the ususal google search, but I'd be interested in your recommendations:

I'm looking for a lightweight self hosted remote monitoring script which would generate a static uptime report.

Report should only include if the node/service ip is up/down.

Goodie: if its able to monitor services on different ports.

But the major factor would be to be able to run it with minimal resources..

The script should be able to monitor at least 5 different nodes..

I've also looked at the pretty graphs of catci/munin but drawing graphs is cpu intensive as ive read. Any ideas?

Thanks & Regards,


----------



## peterw (Oct 7, 2013)

Looking forward to recommendations too.


----------



## zim (Oct 7, 2013)

PHP Ping

https://github.com/geerlingguy/Ping


```
$host = 'www.example.com';
$ping = new Ping($host);
$latency = $ping->ping();
if ($latency) {
  print 'Latency is ' . $latency . ' ms';
}
else {
  print 'Host could not be reached.';
}
```


----------



## nunim (Oct 7, 2013)

You can do it in bash, will be the most secure and use the least resources.  I create downtime logs with traceroutes on downtime so I can see where the problem is or you can send a mail alert or both.  If you want to monitor ports as well you can use nmap after ensuring the host is online.  You can then parse the logs any way you wish to create a report or graph.


----------



## rosehosting (Oct 7, 2013)

You could try using the following script:

#!/bin/bash
SERVERIP=xxx.xxx.xxx.xxx
[email protected]

ping -c 5 $SERVERIP > /dev/null 2>&1
if [ $? -ne 0 ]
then
   mail -s "ALERT - Server $SERVERIP is down" $EMAIL < /dev/null

else

   mail -s "Server $SERVERIP is up" $EMAIL < /dev/null
fi

Or, check the following article: http://www.howtoforge.com/simple-bash-script-to-monitor-your-webserver-remotely-on-different-ports


----------



## fixidixi (Oct 9, 2013)

Thanks for your input everyone!


----------

