#!/usr/local/bin/perl my $what = $ARGV[0]; my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); if($what eq 'gmirror'){ my $out = `/sbin/gmirror status`; $out =~ s/\n/ /g; if($out =~ /COMPLETE/){ print "OK - $out\n"; exit $ERRORS{'OK'}; }else{ print "CRITICAL - $out\n"; exit $ERRORS{'CRITICAL'}; } }elsif($what eq 'tw_cli'){ my $out = `/usr/bin/tw_cli /c0 show | /usr/bin/grep ^u0`; $out =~ s/\n/ /g; if($out =~ /OK/){ print "OK - $out\n"; exit $ERRORS{'OK'}; }else{ print "CRITICAL - $out\n"; exit $ERRORS{'CRITICAL'}; } }elsif($what eq 'megarc'){ my $out = `/usr/local/sbin/megarc -dispCfg -a0 | /usr/bin/grep Status:`; $out =~ s/\n/ /g; if($out =~ /OPTIMAL/){ print "OK - $out\n"; exit $ERRORS{'OK'}; }else{ print "CRITICAL - $out\n"; exit $ERRORS{'CRITICAL'}; } }else{ print "CRITICAL - command not known\n"; exit $ERRORS{'CRITICAL'}; }