diff options
| -rwxr-xr-x | usr-lib-nagios-plugins/check_apcupsd | 8 | ||||
| -rwxr-xr-x | usr-lib-nagios-plugins/check_dirvish.py | 8 | ||||
| -rwxr-xr-x | usr-lib-nagios-plugins/check_fs_ro.sh | 2 | ||||
| -rwxr-xr-x | usr-lib-nagios-plugins/check_mem.pl | 20 | 
4 files changed, 19 insertions, 19 deletions
| diff --git a/usr-lib-nagios-plugins/check_apcupsd b/usr-lib-nagios-plugins/check_apcupsd index b68b823..716fed9 100755 --- a/usr-lib-nagios-plugins/check_apcupsd +++ b/usr-lib-nagios-plugins/check_apcupsd @@ -26,7 +26,7 @@  #         command_name check_apcupsd  #         command_line $USER1$/check_apcupsd -w $ARG2$ -c $ARG3$ $ARG1$  #         } -#  +#  # define command {  #         command_name check_apcupsd_no_notify  #         command_line $USER1$/check_apcupsd $ARG1$ @@ -40,21 +40,21 @@  #         service_description CHARGE  #         check_command check_apcupsd!bcharge!95!50  #         } -#  +#  # define service {  #         use generic-service  #         host_name ups1  #         service_description TEMP  #         check_command check_apcupsd!itemp!35!40  #         } -#  +#  # define service {  #         use generic-service  #         host_name ups1  #         service_description LOAD  #         check_command check_apcupsd!loadpct!70!85  #         } -#  +#  # define service {  #         use generic-service  #         host_name ups1 diff --git a/usr-lib-nagios-plugins/check_dirvish.py b/usr-lib-nagios-plugins/check_dirvish.py index 5802bb2..aa6427c 100755 --- a/usr-lib-nagios-plugins/check_dirvish.py +++ b/usr-lib-nagios-plugins/check_dirvish.py @@ -196,7 +196,7 @@ class Backup(nagiosplugin.Resource):          """ this takes the status line and validates it.              check the gitolite code              status is something of: (value i have seen in dirvish code) -                   (255) --  +                   (255) --                    success                    warning (24) -- file vanished on sender          """ @@ -210,8 +210,8 @@ class Backup(nagiosplugin.Resource):          if statusD['status'] in ['success', 'warning']:              return True          return False -     -     + +      def check_valid_dirvish_vault(self):          _log.debug("Check if %r is a dirvish vault", self.vault) @@ -219,7 +219,7 @@ class Backup(nagiosplugin.Resource):          try:              self.check_path_accessible(dirvish_dir)              self.check_file_accessible(os.path.join(dirvish_dir, 'default.conf')) -        except (E_PathNotAccessible, E_FileNotAccessible):  +        except (E_PathNotAccessible, E_FileNotAccessible):              raise E_VaultIsNotDirvishDirectory(dirvish_dir)      def probe(self): diff --git a/usr-lib-nagios-plugins/check_fs_ro.sh b/usr-lib-nagios-plugins/check_fs_ro.sh index bed8083..1e33a25 100755 --- a/usr-lib-nagios-plugins/check_fs_ro.sh +++ b/usr-lib-nagios-plugins/check_fs_ro.sh @@ -54,7 +54,7 @@ main()          rofs=`echo $fs | awk '{ print $2; }'`          echo "CRITICAL: $rofs is a read-only filesystem."      done -     +      if ! grep -E '^.*\ .*\ (ext.*|btrfs|xfs)\ ro,.*$' /proc/mounts 1>/dev/null; then          echo "OK."      else diff --git a/usr-lib-nagios-plugins/check_mem.pl b/usr-lib-nagios-plugins/check_mem.pl index 5f70757..f59d003 100755 --- a/usr-lib-nagios-plugins/check_mem.pl +++ b/usr-lib-nagios-plugins/check_mem.pl @@ -62,7 +62,7 @@ tell_nagios($used_memory_kb,$free_memory_kb,$caches_kb);  sub tell_nagios {      my ($used,$free,$caches) = @_; -     +      # Calculate Total Memory      my $total = $free + $used;      print "$total Total\n" if ($opt_v); @@ -76,7 +76,7 @@ sub tell_nagios {        $perf_warn = int(${total} * ( 100 - $opt_w ) / 100);        $perf_crit = int(${total} * ( 100 - $opt_c ) / 100);      } -     +      my $perfdata = "|TOTAL=${total}KB;;;; USED=${used}KB;${perf_warn};${perf_crit};; FREE=${free}KB;;;; CACHES=${caches}KB;;;;";      if ($opt_f) { @@ -120,7 +120,7 @@ sub usage() {    print "check_mem.pl comes with absolutely NO WARRANTY either implied or explicit\n";    print "This program is licensed under the terms of the\n";    print "MIT License (check source code for details)\n"; -  exit $exit_codes{'UNKNOWN'};  +  exit $exit_codes{'UNKNOWN'};  }  sub get_memory_info { @@ -246,7 +246,7 @@ sub get_memory_info {                  }              }              $used_memory_kb = $total_memory_kb - $free_memory_kb; -             +          }          else { # We have kstat              my $kstat = Sun::Solaris::Kstat->new(); @@ -256,14 +256,14 @@ sub get_memory_info {              # to me how to determine UFS's cache size.  There's inode_cache,              # and maybe the physmem variable in the system_pages module??              # In the real world, it looks to be so small as not to really matter, -            # so we don't grab it.  If someone can give me code that does this,  +            # so we don't grab it.  If someone can give me code that does this,              # I'd be glad to put it in.              my $arc_size = (exists ${kstat}->{zfs} && ${kstat}->{zfs}->{0}->{arcstats}->{size}) ? -                 ${kstat}->{zfs}->{0}->{arcstats}->{size} / 1024  +                 ${kstat}->{zfs}->{0}->{arcstats}->{size} / 1024                   : 0;              $caches_kb += $arc_size;              my $pagesize = `pagesize`; -     +              $total_memory_kb = $phys_pages * $pagesize / 1024;              $free_memory_kb = $free_pages * $pagesize / 1024;              $used_memory_kb = $total_memory_kb - $free_memory_kb; @@ -317,7 +317,7 @@ sub get_memory_info {  	my $command_line = `vmstat | tail -1 | awk '{print \$4,\$5}'`;  	chomp $command_line;          my @memlist      = split(/ /, $command_line); -     +          # Define the calculating scalars          $used_memory_kb  = $memlist[0]/1024;          $free_memory_kb = $memlist[1]/1024; @@ -334,7 +334,7 @@ sub init {      else {        getopts('c:fuCvw:');      } -     +      # Shortcircuit the switches      if (!$opt_w or $opt_w == 0 or !$opt_c or $opt_c == 0) {        print "*** You must define WARN and CRITICAL levels!\n"; @@ -344,7 +344,7 @@ sub init {        print "*** You must select to monitor either USED or FREE memory!\n";        &usage;      } -     +      # Check if levels are sane      if ($opt_w <= $opt_c and $opt_f) {        print "*** WARN level must not be less than CRITICAL when checking FREE memory!\n"; | 
