diff options
Diffstat (limited to 't')
| -rwxr-xr-x | t/check_stuff.pl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/t/check_stuff.pl b/t/check_stuff.pl index 4fc125c..dca4e58 100755 --- a/t/check_stuff.pl +++ b/t/check_stuff.pl | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | ### check_stuff.pl | 3 | ### check_stuff.pl |
| 4 | 4 | ||
| 5 | # an example Monitoring plugin using the Monitoring::Plugin modules. | 5 | # an example plugin using the Monitoring::Plugin module. |
| 6 | 6 | ||
| 7 | # Originally by Nathan Vonnahme, n8v at users dot sourceforge | 7 | # Originally by Nathan Vonnahme, n8v at users dot sourceforge |
| 8 | # dot net, July 19 2006 | 8 | # dot net, July 19 2006 |
| @@ -41,7 +41,7 @@ my $p = Monitoring::Plugin->new( | |||
| 41 | version => $VERSION, | 41 | version => $VERSION, |
| 42 | blurb => 'This plugin is an example of a monitoring plugin written in Perl using the Monitoring::Plugin modules. It will generate a random integer between 1 and 20 (though you can specify the number with the -n option for testing), and will output OK, WARNING or CRITICAL if the resulting number is outside the specified thresholds.', | 42 | blurb => 'This plugin is an example of a monitoring plugin written in Perl using the Monitoring::Plugin modules. It will generate a random integer between 1 and 20 (though you can specify the number with the -n option for testing), and will output OK, WARNING or CRITICAL if the resulting number is outside the specified thresholds.', |
| 43 | 43 | ||
| 44 | extra => " | 44 | extra => " |
| 45 | 45 | ||
| 46 | THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' | 46 | THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' |
| 47 | (or 'max'). If specified '\@min:max', a warning status will be generated | 47 | (or 'max'). If specified '\@min:max', a warning status will be generated |
| @@ -69,28 +69,28 @@ See more threshold examples at https://www.monitoring-plugins.org/doc/guidelines | |||
| 69 | # usage, help, version, timeout and verbose are defined by default. | 69 | # usage, help, version, timeout and verbose are defined by default. |
| 70 | 70 | ||
| 71 | $p->add_arg( | 71 | $p->add_arg( |
| 72 | spec => 'warning|w=s', | 72 | spec => 'warning|w=s', |
| 73 | 73 | ||
| 74 | help => | 74 | help => |
| 75 | qq{-w, --warning=INTEGER:INTEGER | 75 | qq{-w, --warning=INTEGER:INTEGER |
| 76 | Minimum and maximum number of allowable result, outside of which a | 76 | Minimum and maximum number of allowable result, outside of which a |
| 77 | warning will be generated. If omitted, no warning is generated.}, | 77 | warning will be generated. If omitted, no warning is generated.}, |
| 78 | 78 | ||
| 79 | # required => 1, | 79 | # required => 1, |
| 80 | # default => 10, | 80 | # default => 10, |
| 81 | ); | 81 | ); |
| 82 | 82 | ||
| 83 | $p->add_arg( | 83 | $p->add_arg( |
| 84 | spec => 'critical|c=s', | 84 | spec => 'critical|c=s', |
| 85 | help => | 85 | help => |
| 86 | qq{-c, --critical=INTEGER:INTEGER | 86 | qq{-c, --critical=INTEGER:INTEGER |
| 87 | Minimum and maximum number of the generated result, outside of | 87 | Minimum and maximum number of the generated result, outside of |
| 88 | which a critical will be generated. }, | 88 | which a critical will be generated. }, |
| 89 | ); | 89 | ); |
| 90 | 90 | ||
| 91 | $p->add_arg( | 91 | $p->add_arg( |
| 92 | spec => 'result|r=f', | 92 | spec => 'result|r=f', |
| 93 | help => | 93 | help => |
| 94 | qq{-r, --result=INTEGER | 94 | qq{-r, --result=INTEGER |
| 95 | Specify the result on the command line rather than generating a | 95 | Specify the result on the command line rather than generating a |
| 96 | random number. For testing.}, | 96 | random number. For testing.}, |
| @@ -106,7 +106,7 @@ if ( (defined $p->opts->result) && ($p->opts->result < 0 || $p->opts->result > 2 | |||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | unless ( defined $p->opts->warning || defined $p->opts->critical ) { | 108 | unless ( defined $p->opts->warning || defined $p->opts->critical ) { |
| 109 | $p->plugin_die( " you didn't supply a threshold argument " ); | 109 | $p->plugin_die( " you didn't supply a threshold argument " ); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | 112 | ||
| @@ -132,6 +132,6 @@ else { | |||
| 132 | # check the result against the defined warning and critical thresholds, | 132 | # check the result against the defined warning and critical thresholds, |
| 133 | # output the result and exit | 133 | # output the result and exit |
| 134 | $p->plugin_exit( | 134 | $p->plugin_exit( |
| 135 | return_code => $p->check_threshold($result), | 135 | return_code => $p->check_threshold($result), |
| 136 | message => " sample result was $result" | 136 | message => " sample result was $result" |
| 137 | ); | 137 | ); |
