/[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 2593 by ronalds, Wed Dec 19 10:55:15 2012 UTC revision 2594 by ronalds, Tue Jan 22 15:11:50 2013 UTC
# Line 6  use Getopt::Long; Line 6  use Getopt::Long;
6  my $verbose = 0;  my $verbose = 0;
7  my $debug = 0;  my $debug = 0;
8  my $mode;  my $mode;
9    my $conffile = '';
10    
11  &GetOptions(  &GetOptions(
12      'verbose|v'         => \$verbose,      'verbose|v'         => \$verbose,
13      'debug|d'           => \$debug,      'debug|d'           => \$debug,
14      'wms'               => sub { $mode = 'wms'; },      'wms'               => sub { $mode = 'wms'; },
15      'cream'             => sub { $mode = 'cream'; },      'cream'             => sub { $mode = 'cream'; },
16        'conf:s'        => \$conffile,
17  );  );
18    
19  my %retcode = (  my %retcode = (
# Line 28  if ( $mode eq "cream" ) { Line 30  if ( $mode eq "cream" ) {
30          print "UNKNOWN: Could not find glite_cream_load_monitor\n";          print "UNKNOWN: Could not find glite_cream_load_monitor\n";
31          exit $retcode{UNKNOWN};          exit $retcode{UNKNOWN};
32      }      }
33    
34        # the configuration file MUST be the first argument
35        if ( $conffile ) {
36            # verify that $conffile is a normal path without malicious content
37            if ( $conffile =~/^([-\/\@\w.]+)$/ ) {
38                $cmd .= " $1";
39                }
40            else {
41                print "CRITICAL: Insecure argument: $conffile\n";
42                exit $retcode{CRITICAL};
43            }
44        }
45    
46        # ... before options
47      $cmd .= " --test --show";      $cmd .= " --test --show";
48  }  }
49  elsif ( $mode eq "wms" ) {  elsif ( $mode eq "wms" ) {

Legend:
Removed from v.2593  
changed lines
  Added in v.2594

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