Push-style server status monitoring


/ Published in: Bash
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.