Created
April 23, 2016 02:02
-
-
Save blackknight36/abac5eaae6c391feb01e665649303aef to your computer and use it in GitHub Desktop.
Nagios check for the moebius file system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| my $moebius = "/home/jsipek/Copy/linrel_x86_64-superlowmem/moebius.admin"; | |
| my $output = `$moebius -s /var/run/moebius/moebius.sock df -c | tail -1`; | |
| if ( ($? >> 8) == 0 ) { | |
| print "CRITICAL: moebius.admin failed to run.\n"; | |
| exit(2); | |
| } | |
| my @info = split(/,/, $output); | |
| my $status = $info[6]; | |
| my $usedspace = $info[3]; | |
| if ( $status != "ONLINE" ) { | |
| print "WARNING: moebius file system status: $status\n"; | |
| exit(1); | |
| } | |
| if ( $usedspace >= 90 ) { | |
| print "CRITICAL: moebius $usedspace% full.\n"; | |
| exit(2); | |
| } | |
| elsif ( $usedspace >= 80 ) { | |
| print "WARNING: moebius $usedspace% full.\n"; | |
| exit(1); | |
| } | |
| print "OK: Moebius checks passed.\n"; | |
| exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment