Posted By

2mf on 11/07/12


Tagged

server alert monitoring


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

miha


Push-style server status monitoring


 / Published in: Bash
 

My first (simpliest) way to collect monitoring data from few servers. Only skeleton for adding custom parameters. Using this way is not a good idea in general.

  1. #!/bin/sh
  2. # Copyright (c) 2008 Mihail Fedorov, http://mihailfedorov.ru
  3. # Severs Monitoring Backend v 0.1
  4.  
  5. PASS="god" # Pssssswd ;)
  6. PASSMD=`echo $PASS|md5`
  7.  
  8. SERVER=`hostname`
  9. OS=`uname -a`
  10. RUNNING=`uptime`
  11. CODE="::$SERVER::$OS::$RUNNING::"
  12. CODE64=`echo $CODE|base64`
  13.  
  14. # Passive way (example) - put this in inetd to some strange port
  15. # echo $CODE64
  16.  
  17. # Active way - report via crontab to frontend
  18. wget -O /dev/null -q "http://domain.tld/monitoring/frontend.php?p=$PASSMD&info=$CODE64"

Report this snippet  

You need to login to post a comment.