Changeset ae22e3bd765158b778bd93baa267afae17fe7fa2

Show
Ignore:
Timestamp:
07/01/08 15:57:07 (6 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1214927827 +0000
git-parent:

[22ac6469b995e21fe0bd0d3f0c1aa0bf567ac6ed]

git-author:
Mark Harrison <mark@omniti.com> 1214927827 +0000
Message:

Moving the fresh_status and set_status code outside of the modules themselves,
making module development simpler. Also fixed an issue with the fresh_status
function where it didn't return a cached message, and resmon showed nothing
for the message. refs #1

git-svn-id: https://labs.omniti.com/resmon/trunk@135 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Module.pm

    r442851e rae22e3b  
    4242  print STDERR "$rmloading $type monitor\n"; 
    4343} 
     44 
    4445sub fresh_status { 
     46  my $arg = shift; 
     47  print STDERR $arg->{type} . ": Warning: fresh_status() is deprecated, and no longer required."; 
     48  return undef; 
     49} 
     50 
     51sub fresh_status_msg { 
     52  # Deal with result caching if an 'interval' entry is placed in the config 
     53  # for that module 
    4554  my $arg = shift; 
    4655  return undef unless $arg->{interval}; 
    4756  my $now = time; 
    4857  if(($arg->{lastupdate} + $arg->{interval}) >= $now) { 
    49     return $arg->{laststatus}
     58    return $arg->{laststatus}, $arg->{lastmessage}
    5059  } 
    5160  return undef; 
    5261} 
     62 
    5363sub set_status { 
    5464  my $arg = shift; 
  • lib/Resmon/Module/A1000.pm

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $unit = $arg->{'object'}; 
    119  my $output = cache_command("/usr/lib/osa/bin/healthck -a", 500); 
    1210  my ($line) = grep(/^$unit:/, split(/\n/, $output)); 
    1311  if ($line =~ /:\s+(.+)/) { 
    14     return $arg->set_status("OK($1)") if($1 eq $arg->{'status'})
    15     return $arg->set_status("BAD($1)")
     12    return "OK($1)") if($1 eq $arg->{'status'}
     13    return "BAD($1)"
    1614  } 
    17   return $arg->set_status("BAD(no data)")
     15  return "BAD(no data)"
    1816}; 
    19171; 
  • lib/Resmon/Module/DATE.pm

    r748aca8 rae22e3b  
    55sub handler { 
    66  my $arg = shift; 
    7   my $os = $arg->fresh_status(); 
    8   return $arg->set_status("OK(".time().")"); 
     7  return "OK(".time().")"; 
    98} 
    109 
  • lib/Resmon/Module/DHCPLEASES.pm

    r634e123 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $net = $arg->{'object'}; 
    119  my $file = "/var/db/dhcpd.leases"; 
     
    4543  my ($warn,$crit)=($arg->{'warn'},$arg->{'crit'}); 
    4644  if ($actives < $warn) { 
    47     return($arg->set_status("OK($actives leases)")); 
     45    return("OK($actives leases)"); 
    4846  }elsif ($actives < $crit) { 
    49     return($arg->set_status("WARN($actives leases)")); 
     47    return("WARN($actives leases)"); 
    5048  }else { 
    51     return($arg->set_status("BAD($actives leases)")); 
     49    return("BAD($actives leases)"); 
    5250  } 
    5351}; 
  • lib/Resmon/Module/DISK.pm

    red0c3d1 rae22e3b  
    88sub handler { 
    99  my $arg = shift; 
    10   my $os = $arg->fresh_status(); 
    11   return $os if $os; 
    1210  my $devorpart = $arg->{'object'}; 
    1311  my $output = cache_command("$dfcmd $devorpart", 120); 
     
    1513  if($line =~ /(\d+)%/) { 
    1614    if($1 > $arg->{'limit'}) { 
    17       return $arg->set_status("BAD($1% full)")
     15      return "BAD($1% full)"
    1816    } 
    1917    if(exists $arg->{'warnat'} && $1 > $arg->{'warnat'}) { 
    20       return $arg->set_status("WARNING($1% full)")
     18      return "WARNING($1% full)"
    2119    } 
    22     return $arg->set_status("OK($1% full)")
     20    return "OK($1% full)"
    2321  } 
    24   return $arg->set_status("BAD(0 -- no data)")
     22  return "BAD(0 -- no data)"
    2523} 
    26241; 
  • lib/Resmon/Module/DNS.pm

    ra58fad4 rae22e3b  
    1111sub handler { 
    1212    my $self = shift; 
    13     my $os = $self->fresh_status(); 
    14     return $os if $os; 
    1513    my $object = $self->{object}; 
    1614 
  • lib/Resmon/Module/ECCMGR.pm

    r748aca8 rae22e3b  
    1717sub handler { 
    1818  my $arg = shift; 
    19   my $os = $arg->fresh_status(); 
    20   return $os if $os; 
    2119  my $proc = $arg->{'object'}; 
    2220  my $socket = $arg->{'socket'} || '/tmp/2026'; 
     
    3028      # Catch any could not connect error 
    3129      $@ =~ /^(.*) at/; # Fetch just the error message and no file/line no. 
    32       return $arg->set_status("BAD($1)")
     30      return "BAD($1)"
    3331  } 
    3432  if ($version =~ /(eccmgr version: .*)\n/) { 
    35       return $arg->set_status("OK($1)")
     33      return "OK($1)"
    3634  } else { 
    3735      # Something other than eccmgr responded, print out a version string 
    3836      $version =~ s/\n/ /g; 
    3937      $version =~ s/#//g; 
    40       return $arg->set_status("BAD(eccmgr not running: $version)")
     38      return "BAD(eccmgr not running: $version)"
    4139  } 
    4240}; 
  • lib/Resmon/Module/FAULTS.pm

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $proc = $arg->{'object'}; 
    119  my $output = cache_command("/usr/sbin/fmadm faulty | sed '1,2d'|grep -v -- '^----'", 500); 
     
    1311    $output =~s /\n/:/gs; 
    1412    $output =~s /\s+/ /gs; 
    15     return $arg->set_status("BAD($output)")
     13    return "BAD($output)"
    1614  } 
    17   return $arg->set_status("OK(no faults)")
     15  return "OK(no faults)"
    1816}; 
    19171; 
  • lib/Resmon/Module/FILEAGE.pm

    rcab0e0f rae22e3b  
    55sub handler { 
    66  my $arg = shift; 
    7   my $os = $arg->fresh_status(); 
    8   return $os if $os; 
    97  my $file = $arg->{'object'}; 
    108  my @statinfo = stat($file); 
    119  my $age = time() - $statinfo[9]; 
    12   return $arg->set_status("BAD($age seconds, too old)") 
     10  return "BAD($age seconds, too old)" 
    1311        if($arg->{maximum} && ($age > $arg->{maximum})); 
    14   return $arg->set_status("BAD($age seconds, too new)") 
     12  return "BAD($age seconds, too new)" 
    1513        if($arg->{minimum} && ($age > $arg->{minimum})); 
    16   return $arg->set_status("OK($age seconds)")
     14  return "OK($age seconds)"
    1715} 
    18161; 
  • lib/Resmon/Module/FILECOUNT.pm

    rf407274 rae22e3b  
    66sub handler { 
    77        my $arg = shift; 
    8         my $os = $arg->fresh_status(); 
    9         return $os if $os; 
    108        my $dir = $arg->{'object'}; 
    119        my $hlimit = $arg->{'hard_limit'}; 
  • lib/Resmon/Module/FILESIZE.pm

    rcab0e0f rae22e3b  
    55sub handler { 
    66  my $arg = shift; 
    7   my $os = $arg->fresh_status(); 
    8   return $os if $os; 
    97  my $file = $arg->{'object'}; 
    108  my @statinfo = stat($file); 
     
    1210  my $minsize = $arg->{minimum}; 
    1311  my $maxsize = $arg->{maximum}; 
    14   return $arg->set_status("BAD($size, too big)") 
     12  return "BAD($size, too big)" 
    1513        if($maxsize && ($size > $maxsize)); 
    16   return $arg->set_status("BAD($size, too small)") 
     14  return "BAD($size, too small)" 
    1715        if($minsize && ($size > $minsize)); 
    18   return $arg->set_status("OK($size)")
     16  return "OK($size)"
    1917} 
    20181; 
  • lib/Resmon/Module/FRESHSVN.pm

    r748aca8 rae22e3b  
    1818 
    1919  my $arg = shift; 
    20   my $os = $arg->fresh_status(); 
    21   return $os if $os; 
    2220  my $dir = $arg->{'object'}; 
    2321  my $moutput = cache_command("$svn info $dir", 60); 
     
    2826    elsif (/^Revision:\s*(\d+)/) { $mr = $1; } 
    2927  } 
    30   return ($arg->set_status("BAD(wrong URL, in conf:".$arg->{'URL'}.", checked out: $URL)")) if ($URL ne $arg->{'URL'})
     28  return ("BAD(wrong URL, in conf:".$arg->{'URL'}.", checked out: $URL)")) if ($URL ne $arg->{'URL'}
    3129  my $uoutput = cache_command("$svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL", 60); 
    3230  my @ulines = split (/\n/,$uoutput); 
     
    3533    if (/^Last Changed Rev:\s*(\d+)/) { $ur = $1; } 
    3634  } 
    37   if($ur <= $mr){ return($arg->set_status("OK(rev:$ur)")); } 
     35  if($ur <= $mr){ return "OK(rev:$ur)"; } 
    3836  else{ 
    3937    my ($cY,$cM,$cD,$ch,$cm,$cs) = split (/ /, `date '+%Y %m %d %H %M %S'`); 
     
    5149    my $maxlag=$arg->{'maxlag'}*60 || 330; 
    5250    if ($lag <= $maxlag){ 
    53       return($arg->set_status("OK(delay = $lag < $maxlag)"));  
     51      return "OK(delay = $lag < $maxlag)"; 
    5452    } 
    5553    elsif ( ( ($us+60*($um+60*($uh+24*$uD))) < $maxlag )  
     
    5755          ) 
    5856    { 
    59       return($arg->set_status("WARNING(check unreliable, check later)")); 
     57      return("WARNING(check unreliable, check later)"); 
    6058    } 
    6159    else { 
    62       return($arg->set_status("BAD(now $dNow, my rev:$mr, repo rev:$ur, committed: $dCommitted)")); 
     60      return("BAD(now $dNow, my rev:$mr, repo rev:$ur, committed: $dCommitted)"); 
    6361    } 
    6462  } 
  • lib/Resmon/Module/INODES.pm

    r748aca8 rae22e3b  
    2020sub handler { 
    2121  my $arg = shift; 
    22   my $os = $arg->fresh_status(); 
    23   return $os if $os; 
    2422  my $devorpart = $arg->{'object'}; 
    2523  my $output = cache_command($dfcmd, 30); 
     
    2725  if($line =~ /$dfregex/) { 
    2826    if($4 <= $arg->{'limit'}) { 
    29       return $arg->set_status("OK($2 $4% full)")
     27      return "OK($2 $4% full)"
    3028    } 
    31     return $arg->set_status("BAD($2 $4% full)")
     29    return "BAD($2 $4% full)"
    3230  } 
    33   return $arg->set_status("BAD(no data)")
     31  return "BAD(no data)"
    3432} 
    3533 
  • lib/Resmon/Module/LARGEFILES.pm

    ra71565c rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $dir = $arg->{'object'}; 
    119  opendir(DIR, $dir); 
     
    1311  closedir(DIR); 
    1412  if (scalar(@bigfiles) > 0) { 
    15     return $arg->set_status("BAD(large files exist)")
     13    return "BAD(large files exist)"
    1614  } else { 
    17     return $arg->set_status("OK(no large files)")
     15    return "OK(no large files)"
    1816  } 
    1917} 
  • lib/Resmon/Module/LOGFILE.pm

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $file = $arg->{'object'}; 
    119  my $match = $arg->{'match'}; 
     
    1715      if($arg->{lastsize} == $statinfo[7]) { 
    1816        if($arg->{errors}) { 
    19           return $arg->set_status("BAD($arg->{nerrs}: $arg->{errors})")
     17          return "BAD($arg->{nerrs}: $arg->{errors})"
    2018        } 
    21         return $arg->set_status("OK(0)")
     19        return "OK(0)"
    2220      } 
    2321    } else { 
     
    2927  } 
    3028  if(!open(LOG, "<$file")) { 
    31     return $arg->set_status("BAD(ENOFILE)")
     29    return "BAD(ENOFILE)"
    3230  } 
    3331  seek(LOG, $arg->{lastsize}, 0); 
     
    5048 
    5149  if($arg->{nerrs}) { 
    52     return $arg->set_status("BAD($arg->{nerrs}: $arg->{errors})")
     50    return "BAD($arg->{nerrs}: $arg->{errors})"
    5351  } 
    54   return $arg->set_status("OK(0)")
     52  return "OK(0)"
    5553} 
    56541; 
  • lib/Resmon/Module/NETBACKUPTAPE.pm

    r748aca8 rae22e3b  
    77sub handler { 
    88  my $arg = shift; 
    9   my $os = $arg->fresh_status(); 
    10   return $os if $os; 
    119  my $unit = $arg->{'object'}; 
    1210  my $output = cache_command("/usr/openv/volmgr/bin/vmoprcmd -d ds", 500); 
     
    2119  } 
    2220  if($down || !$up) { 
    23     return $arg->set_status("BAD($up UP, $down DOWN)\n")
     21    return "BAD($up UP, $down DOWN)\n"
    2422  } 
    25   return $arg->set_status("OK($up UP)\n")
     23  return "OK($up UP)\n"
    2624}; 
    27251; 
  • lib/Resmon/Module/NETSTAT.pm

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $output = cache_command("netstat -an", 30); 
    119  my @lines = split(/\n/, $output); 
     
    1816        if($arg->{remoteport}); 
    1917  my $count = scalar(@lines); 
    20   return $arg->set_status("BAD($count)") 
    21         if($arg->{limit} && ($count > $arg->{limit})); 
    22   return $arg->set_status("BAD($count)") 
    23         if($arg->{atleast} && ($count < $arg->{atleast})); 
    24   return $arg->set_status("OK($count)"); 
     18  return "BAD($count)" if($arg->{limit} && ($count > $arg->{limit})); 
     19  return "BAD($count)" if($arg->{atleast} && ($count < $arg->{atleast})); 
     20  return "OK($count)"; 
    2521} 
    26221; 
  • lib/Resmon/Module/OLDFILES.pm

    re8b460b rae22e3b  
    2525sub handler { 
    2626    my $arg = shift; 
    27     my $os = $arg->fresh_status(); 
    28     return $os if $os; 
    2927    my $dir = $arg->{'object'}; 
    3028    $minutes = $arg->{'minutes'}; 
  • lib/Resmon/Module/PGREP.pm

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $proc = $arg->{'object'}; 
    119  my $args = join(' ',$arg->{'arg0'},$arg->{'arg1'},$arg->{'arg2'}); 
     
    1412  if($output) { 
    1513    chomp $output; 
    16     return($arg->set_status("OK(pid:$output)")); 
     14    return("OK(pid:$output)"); 
    1715  } 
    18   return($arg->set_status("BAD(no output)")); 
     16  return("BAD(no output)"); 
    1917}; 
    20181; 
  • lib/Resmon/Module/QUEUESIZE.pm

    rcab0e0f rae22e3b  
    1313sub handler { 
    1414    my $arg = shift; 
    15     my $os = $arg->fresh_status(); 
    16     return $os if $os; 
    1715 
    1816    my $domain = $arg->{'object'}; 
  • lib/Resmon/Module/REMOTEFILESIZE.pm

    rcab0e0f rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $host = $arg->{'host'}; 
    119  my $file = $arg->{'object'}; 
     
    1513  my $minsize = $arg->{minimum}; 
    1614  my $maxsize = $arg->{maximum}; 
    17   return $arg->set_status("BAD($size, too big)") 
     15  return "BAD($size, too big)" 
    1816        if($maxsize && ($size > $maxsize)); 
    19   return $arg->set_status("BAD($size, too small)") 
     17  return "BAD($size, too small)" 
    2018        if($minsize && ($size > $minsize)); 
    21   return $arg->set_status("OK($size)")
     19  return "OK($size)"
    2220} 
    23211; 
  • lib/Resmon/Module/RESMON.pm

    r6f36197 rae22e3b  
    1616sub handler { 
    1717    my $arg = shift; 
    18     my $os = $arg->fresh_status(); 
    1918 
    2019    # Get the global config object 
     
    6261    $arg->{'modstatus'} = $modstatus || "OK"; 
    6362 
    64     return $arg->set_status($status, "$hostname $statusmsg ($revision)")
     63    return $status, "$hostname $statusmsg ($revision)"
    6564} 
    6665 
  • lib/Resmon/Module/SCRIPT.pm

    rabab5d6 rae22e3b  
    1313sub handler { 
    1414    my $arg = shift; 
    15     my $os = $arg->fresh_status(); 
    16     return $os if $os; 
    1715    my $object = $arg->{'object'}; 
    1816    my $script = $arg->{'script'} || return "BAD", "No script specified"; 
     
    2119    if ($output) { 
    2220        chomp($output); 
    23         return $arg->set_status($output)
     21        return $output
    2422    } else { 
    2523        return "BAD", "No output from command"; 
  • lib/Resmon/Module/SIMPLESVN.pm

    rcab0e0f rae22e3b  
    1717sub handler { 
    1818    my $arg = shift; 
    19     my $os = $arg->fresh_status(); 
    20     return $os if $os; 
    2119    my $wc = $arg->{'object'}; 
    2220    my $output = cache_command("svn st -u -q $wc", 60); 
  • lib/Resmon/Module/SMFMAINTENANCE.pm

    r748aca8 rae22e3b  
    1313sub handler { 
    1414  my $arg = shift; 
    15   my $os = $arg->fresh_status(); 
    16   return $os if $os; 
    1715  my $proc = $arg->{'object'}; 
    1816  my $output = cache_command("/usr/bin/svcs | grep maintenance", 500); 
     
    2119    chomp($output); 
    2220    $output =~s /\n/, /gs; 
    23     return $arg->set_status("BAD($output)")
     21    return "BAD($output)"
    2422  } 
    25   return $arg->set_status("OK(no services in maintenance mode)")
     23  return "OK(no services in maintenance mode)"
    2624}; 
    27251; 
  • lib/Resmon/Module/SWAPSIZE.pm

    rc2112fb rae22e3b  
    77sub handler { 
    88  my $arg = shift; 
    9   my $os = $arg->fresh_status(); 
    10   return $os if $os; 
    119  my $object = $arg->{'object'}; 
    1210  my $output = cache_command("df -k /tmp", 30); 
     
    1412  if($line =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%/) { 
    1513    if($1 >= $arg->{'limit'}) { 
    16       return $arg->set_status("OK($1 k size)")
     14      return "OK($1 k size)"
    1715    } 
    18     return $arg->set_status("BAD($1 k size)")
     16    return "BAD($1 k size)"
    1917  } 
    20   return $arg->set_status("BAD(no data)")
     18  return "BAD(no data)"
    2119}; 
    2220 
  • lib/Resmon/Module/TCPSERVICE.pm

    rac558e1 rae22e3b  
    1212sub handler { 
    1313  my $self = shift; 
    14   my $os = $self->fresh_status(); 
    15   return $os if $os; 
    1614  my $host = $self->{host}; 
    1715  my $port = $self->{port}; 
  • lib/Resmon/Module/UPDATE.pm

    r22ac646 rae22e3b  
    1313    # Set the default interval to 10 minutes 
    1414    $arg->{interval} ||= 600; 
    15  
    16     # This code deals with the update interval 
    17     my $os = $arg->fresh_status(); 
    18     return $os, $arg->{lastmessage} if $os; 
    1915 
    2016    my $output = `/opt/resmon/update/update.pl`; 
     
    4137    } 
    4238 
    43     return $arg->set_status($status, $msg)
     39    return $status, $msg
    4440} 
    4541 
  • lib/Resmon/Module/WALCHECK.pm

    rc0f18d2 rae22e3b  
    3131sub handler { 
    3232  my $arg = shift; 
    33   my $os = $arg->fresh_status(); 
    34   return $os if $os; 
    3533  my $logdir = $arg->{'logdir'}; 
    3634  opendir(D, $logdir); 
     
    6058  if ($diff > 3600) 
    6159  { 
    62         return $arg->set_status( "BAD($diff seconds behind)")
     60        return "BAD($diff seconds behind)"
    6361  } else { 
    64         return $arg->set_status( "OK($diff seconds behind)")
     62        return "OK($diff seconds behind)"
    6563  } 
    6664} 
  • lib/Resmon/Module/ZIMBRA.pm

    r748aca8 rae22e3b  
    77sub handler { 
    88        my $arg = shift; 
    9         my $os = $arg->fresh_status(); 
    10         return $os if $os; 
    119        my $unit = $arg->{'object'}; 
    1210        my $output = cache_command("su - zimbra -c 'zmcontrol status' | grep 'not running'", 500); 
    1311        if($output) { 
    1412                $output =~s /\n/:/gs; 
    15                 return $arg->set_status("BAD($output)")
     13                return "BAD($output)"
    1614        } 
    17         return $arg->set_status("OK(All services running)")
     15        return "OK(All services running)"
    1816}; 
    19171; 
  • lib/Resmon/Module/ZPOOL.pm

    r748aca8 rae22e3b  
    77sub handler { 
    88        my $arg = shift; 
    9         my $os = $arg->fresh_status(); 
    10         return $os if $os; 
    119        my $unit = $arg->{'object'}; 
    1210        my $output = cache_command("zpool list -H | grep -v ONLINE", 500); 
     
    1816                } 
    1917                chop($errstring); 
    20                 return $arg->set_status("BAD($errstring)")
     18                return "BAD($errstring)"
    2119        } 
    22         return $arg->set_status("OK(all pools are healthy)")
     20        return "OK(all pools are healthy)"
    2321}; 
    24221; 
  • lib/Resmon/Module/ZPOOLERRS.pm

    r748aca8 rae22e3b  
    1616sub handler { 
    1717    my $arg = shift; 
    18     my $os = $arg->fresh_status(); 
    19     return $os if $os; 
    2018    my $unit = $arg->{'object'}; 
    2119    my $output = cache_command( 
  • lib/Resmon/Module/ZPOOLFREE.pm

    rcab0e0f rae22e3b  
    1717sub handler { 
    1818  my $self = shift; 
    19   my $os = $self->fresh_status(); 
    20   return $os if $os; 
    2119  my $object = $self->{object}; 
    2220  my $output = cache_command("zpool list", 120); 
  • resmon

    r2d60573 rae22e3b  
    114114      my $check_mess = 'no data'; 
    115115      my $starttime = [gettimeofday]; 
    116       if($coderef) { 
    117         eval { ($check_rv, $check_mess) = $coderef->($monobj); }; 
    118       } else { 
    119         eval { ($check_rv, $check_mess) = $monobj->handler(); }; 
     116      # Get old status if it hasn't expired 
     117      my ($check_rv, $check_mess) = Resmon::Module::fresh_status_msg($monobj); 
     118      # Otherwise, run the check 
     119      if (!$check_rv) { 
     120          if($coderef) { 
     121            eval { ($check_rv, $check_mess) = $coderef->($monobj); }; 
     122          } else { 
     123            eval { ($check_rv, $check_mess) = $monobj->handler(); }; 
     124          } 
     125          # Store the last status for use by fresh_status_msg later 
     126          # Also converts old style status messages 
     127          ($check_rv, $check_mess) = 
     128            Resmon::Module::set_status($monobj, $check_rv, $check_mess); 
    120129      } 
    121130      my $checkstat = $@;