Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

a better script to monitor all your VPS

marrcomarrco Member
edited November 2011 in Tutorials

i decided to modify Netomx script in order to monitor my VPS. I spent less than one hour on it, maybe i'll rewrite it in a few days if i find a major bug.

add to your crontab to run it every 5 or 10 minutes.

it has a quite a few improvements:
-) it's a bash script
-) first verifies the monitoring host is connected to the net
-) less false positive errors (a host must fail 2 scheduled run before triggering the alarm)
-) you get notifed only once, when a host goes up or down
-) simple, configurable and easy to modify short script

http://pastebin.com/UzUtxwXy

Your ideas and improvements are welcome!

Thanked by 3LES Asim Go59954

Comments

  • netomxnetomx Moderator, Veteran
    edited November 2011

    Nice modification. Maybe you can use the last modification, I fix some serious things haha.

    And my script also just nitify when it is up or down.. maybe you just check the 1st edition, it was buggy haha

  • @netomx it's not a modification of your script, it's quite a different beast.

    This script will email you only when a VPS goes down (and stay down for at least 5 minutes) or gets back up. It won't send lots of mail but just try to be smart and reliable in notifying you when a problem arises.

  • netomxnetomx Moderator, Veteran

    Like mine, but you use BASH. How did you manage to send email through BASH? using sendmail?

  • @netomx lol you speak to him like an asshole and then you can't even just read his fucking code :)

  • netomxnetomx Moderator, Veteran

    @bobinfo Troll? I never say he's an asshole, in fact, he made his script because he prefers BASH. I never say that. And I read the code... damn I have found mailx, I didn't find it before.

  • netomx: probably mis interpreted your 'haha', sorry for that ;)

  • netomxnetomx Moderator, Veteran

    yeah, my "haha" was about my coding issues, never check what I upload

  • ok, sorry & thanks both of you for sharing your work

  • I just upped a new version with a few improvements.

    http://pastebin.com/UzUtxwXy

  • Very nice, thank you for sharing this.

  • MowdMowd Member
    edited November 2011

    I've also modified the script to make it run on Mac OSX Server.

    Script here: http://pastebin.com/qwXcU160

    Launchd plist here: http://pastebin.com/gF2uUrET

    The jobs will run every 250 seconds by default, you can change it by editing com.mowd.check_vps.plist.

    Just type this command below to enable:

    launchctl load /Users/YOU/com.mowd.check_vps.plist

    If you don't want it anymore, simply type:

    launchctl unload /Users/YOU/com.mowd.check_vps.plist

    Thanked by 1marrco
Sign In or Register to comment.