/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/nagios-ndpf-sensors/scripts/check_glite_load_monitor
ViewVC logotype

Diff of /trunk/nl.nikhef.ndpf.tools/nagios-ndpf-sensors/scripts/check_glite_load_monitor

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2584 by ronalds, Fri Apr 20 15:16:58 2012 UTC revision 2585 by ronalds, Wed Dec 19 10:55:15 2012 UTC
# Line 106  else { Line 106  else {
106  # collect performance data  # collect performance data
107  my $perfdata = "";  my $perfdata = "";
108  if ( $mode eq "cream" ) {  if ( $mode eq "cream" ) {
109      my $done = 0;      my ( $ftp_conn, $active_jobs );
110      foreach my $file ( $outfil, $errfil ) {      foreach my $file ( $outfil, $errfil ) {
111          open PERF, $file;          open PERF, $file;
112          while ( my $line = <PERF> ) {          while ( my $line = <PERF> ) {
113              if ( $line =~ /active jobs\: (\d+)$/ ) {              if ( $line =~ /active jobs\: (\d+)$/ ) {
114                  $perfdata = sprintf "|active jobs=%d;;;;", $1;                  $active_jobs = $1;
115                  $done = 1;                  # $perfdata .= sprintf " 'active jobs'=%d", $1;
                 last;  
116              }              }
117          }              elsif ( $line =~ /FTP Connection\: (\d+)$/ ) {
118          close PERF;                  $ftp_conn = $1;
119          last if ( $done );                  # $perfdata .= sprintf " FTP_conn=%d", $1;
120                }
121            }
122            close PERF;
123            $perfdata = sprintf "'active jobs'=%d FTP_conn=%d", $active_jobs, $ftp_conn;
124      }      }
125  }  }
126    
127  ( ! $debug ) and unlink $outfil, $errfil;  ( ! $debug ) and unlink $outfil, $errfil;
128    
129  print "$msg$perfdata\n";  print "$msg|$perfdata\n";
130  exit $retval;  exit $retval;
131    
132    

Legend:
Removed from v.2584  
changed lines
  Added in v.2585

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28