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

Contents of /trunk/nl.nikhef.ndpf.tools/nagios-ndpf-sensors/scripts/check_wms_skeleton.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1327 - (show annotations) (download) (as text)
Tue Dec 22 14:50:34 2009 UTC (12 years, 1 month ago) by ronalds
File MIME type: text/x-prolog
File size: 1063 byte(s)
- check_service: use full (configurable) path to init script instead of service command
- added WMS probes

1 #!/usr/bin/perl -w
2
3 # Nagios probe skeleton for WMS
4
5 use strict;
6 use Getopt::Long;
7
8 my $verbose=0;
9 my $help;
10 my $hostname;
11 my $metric;
12 my $state;
13 my $debug;
14 my $warning_level=0;
15 my $critical_level=0;
16
17 my $TIMEOUT = 10;
18
19 GetOptions("help" => \$help,
20 "host:s" => \$hostname,
21 "metric:s" => \$metric,
22 "state:s" => \$state,
23 "warning|w:d" => \$warning_level,
24 "critical|c:d" => \$critical_level,
25 "debug" => \$debug,
26 "verbose" => \$verbose );
27
28 my %ERRORS=(OK=>0,
29 WARNING=>1,
30 CRITICAL=>2,
31 UNKNOWN=>3,
32 DEPENDENT=>4);
33
34 my $result = $ERRORS{"UNKNOWN"};
35
36 # Just in case of problems, let's not hang Nagios
37 $SIG{'ALRM'} = sub {
38 print ("ERROR: No response from $hostname (alarm timeout)\n");
39 exit $ERRORS{"UNKNOWN"};
40 };
41
42 alarm($TIMEOUT);
43
44 ##############################################################################
45
46
47 ##############################################################################
48 alarm(0);
49
50 print "$message\n";
51 exit($result);

Properties

Name Value
svn:keywords id

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