#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Getopt::Long; # use lib "/usr/lib/nagios/plugins" ; use lib "/app/nrpe" ; use utils qw($TIMEOUT %ERRORS ); # print "Script started\n"; my $PATH = "/app/nrpe/"; chomp(my $runlevel = qx{/sbin/runlevel}; if ($runlevel eq '4 3') { print "RUNLEVEL 3\n"; } elsif ($runlevel eq '3 4') { my $warn = "CRITICAL"; my(@CMD,$line,$pag,$info,$paging,$stat,$command,$status,$message); GetOptions ( 'command|m=s'=>\$command ); my($p) = shift; $line = ` $PATH/check_disk -w 2 -c 1 -p $p |grep 'DISK'`; $info = ""; $stat = ""; if ( $line =~ /^DISK CRI/ ) { $status = "CRITICAL"; } else { $status = "OK"; } chomp($stat); $message = ("NFS MOUNT is $status"); print "$status - $message\n"; exit $ERRORS{$status}; }