Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Created April 23, 2016 02:02
Show Gist options
  • Select an option

  • Save blackknight36/abac5eaae6c391feb01e665649303aef to your computer and use it in GitHub Desktop.

Select an option

Save blackknight36/abac5eaae6c391feb01e665649303aef to your computer and use it in GitHub Desktop.
Nagios check for the moebius file system
#!/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