diff options
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 6 | ||||
-rwxr-xr-x | plugins-scripts/check_file_age.pl | 5 | ||||
-rwxr-xr-x | plugins-scripts/check_flexlm.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_ifoperstatus.pl | 10 | ||||
-rwxr-xr-x | plugins-scripts/check_ifstatus.pl | 10 | ||||
-rwxr-xr-x | plugins-scripts/check_ircd.pl | 6 | ||||
-rwxr-xr-x | plugins-scripts/check_log.sh | 29 | ||||
-rwxr-xr-x | plugins-scripts/check_mssql.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_ntp.pl | 2 | ||||
-rwxr-xr-x | plugins-scripts/check_oracle.sh | 2 | ||||
-rwxr-xr-x | plugins-scripts/check_rpc.pl | 4 | ||||
-rw-r--r-- | plugins-scripts/utils.pm.in | 4 | ||||
-rw-r--r-- | plugins-scripts/utils.sh.in | 10 |
13 files changed, 43 insertions, 53 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 0c89db5..8b6cd2e 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | # check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port] | 4 | # check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port] |
5 | # | 5 | # |
6 | # Nagios host script to get the disk usage from a SMB share | 6 | # Monitoring host script to get the disk usage from a SMB share |
7 | # | 7 | # |
8 | # Changes and Modifications | 8 | # Changes and Modifications |
9 | # ========================= | 9 | # ========================= |
@@ -171,7 +171,7 @@ my $res = undef; | |||
171 | my $perfdata = ""; | 171 | my $perfdata = ""; |
172 | my @lines = undef; | 172 | my @lines = undef; |
173 | 173 | ||
174 | # Just in case of problems, let's not hang Nagios | 174 | # Just in case of problems, let's not hang the monitoring system |
175 | $SIG{'ALRM'} = sub { | 175 | $SIG{'ALRM'} = sub { |
176 | print "No Answer from Client\n"; | 176 | print "No Answer from Client\n"; |
177 | exit $ERRORS{"UNKNOWN"}; | 177 | exit $ERRORS{"UNKNOWN"}; |
@@ -293,7 +293,7 @@ sub print_help () { | |||
293 | print_revision($PROGNAME,'@NP_VERSION@'); | 293 | print_revision($PROGNAME,'@NP_VERSION@'); |
294 | print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop | 294 | print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop |
295 | 295 | ||
296 | Perl Check SMB Disk plugin for Nagios | 296 | Perl Check SMB Disk plugin for monitoring |
297 | 297 | ||
298 | "; | 298 | "; |
299 | print_usage(); | 299 | print_usage(); |
diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl index dcd5efa..2ae1138 100755 --- a/plugins-scripts/check_file_age.pl +++ b/plugins-scripts/check_file_age.pl | |||
@@ -17,9 +17,8 @@ | |||
17 | # GNU General Public License for more details. | 17 | # GNU General Public License for more details. |
18 | # | 18 | # |
19 | # you should have received a copy of the GNU General Public License | 19 | # you should have received a copy of the GNU General Public License |
20 | # along with this program (or with Nagios); if not, write to the | 20 | # along with this program if not, write to the Free Software Foundation, |
21 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 21 | # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
22 | # Boston, MA 02111-1307, USA | ||
23 | 22 | ||
24 | use strict; | 23 | use strict; |
25 | use English; | 24 | use English; |
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index 54d933c..574c1cc 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl | |||
@@ -9,7 +9,7 @@ | |||
9 | # Check and interpret the output of lmstat | 9 | # Check and interpret the output of lmstat |
10 | # and create returncodes and output. | 10 | # and create returncodes and output. |
11 | # | 11 | # |
12 | # Contrary to the nagios concept, this script takes | 12 | # Contrary to most other plugins, this script takes |
13 | # a file, not a hostname as an argument and returns | 13 | # a file, not a hostname as an argument and returns |
14 | # the status of hosts and services described in that | 14 | # the status of hosts and services described in that |
15 | # file. Use these hosts.cfg entries as an example | 15 | # file. Use these hosts.cfg entries as an example |
@@ -72,7 +72,7 @@ unless (defined $opt_F) { | |||
72 | print_usage(); | 72 | print_usage(); |
73 | exit $ERRORS{'UNKNOWN'}; | 73 | exit $ERRORS{'UNKNOWN'}; |
74 | } | 74 | } |
75 | # Just in case of problems, let's not hang Nagios | 75 | # Just in case of problems, let's not hang the monitoring system |
76 | $SIG{'ALRM'} = sub { | 76 | $SIG{'ALRM'} = sub { |
77 | print "Timeout: No Answer from Client\n"; | 77 | print "Timeout: No Answer from Client\n"; |
78 | exit $ERRORS{'UNKNOWN'}; | 78 | exit $ERRORS{'UNKNOWN'}; |
diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl index 43e09eb..abcec68 100755 --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl | |||
@@ -1,9 +1,9 @@ | |||
1 | #!/usr/local/bin/perl -w | 1 | #!/usr/local/bin/perl -w |
2 | # | 2 | # |
3 | # check_ifoperstatus.pl - nagios plugin | 3 | # check_ifoperstatus.pl - monitoring plugin |
4 | # | 4 | # |
5 | # Copyright (C) 2000 Christoph Kron, | 5 | # Copyright (C) 2000 Christoph Kron, |
6 | # Modified 5/2002 to conform to updated Nagios Plugin Guidelines | 6 | # Modified 5/2002 to conform to updated Monitoring Plugins Guidelines |
7 | # Added support for named interfaces per Valdimir Ivaschenko (S. Ghosh) | 7 | # Added support for named interfaces per Valdimir Ivaschenko (S. Ghosh) |
8 | # Added SNMPv3 support (10/2003) | 8 | # Added SNMPv3 support (10/2003) |
9 | # | 9 | # |
@@ -22,7 +22,7 @@ | |||
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 | # | 23 | # |
24 | # | 24 | # |
25 | # Report bugs to: help@nagios-plugins.org | 25 | # Report bugs to: help@monitoring-plugins.org |
26 | # | 26 | # |
27 | # 11.01.2000 Version 1.0 | 27 | # 11.01.2000 Version 1.0 |
28 | # | 28 | # |
@@ -97,7 +97,7 @@ my %session_opts; | |||
97 | $status = process_arguments(); | 97 | $status = process_arguments(); |
98 | 98 | ||
99 | 99 | ||
100 | # Just in case of problems, let's not hang Nagios | 100 | # Just in case of problems, let's not hang the monitoring system |
101 | $SIG{'ALRM'} = sub { | 101 | $SIG{'ALRM'} = sub { |
102 | print ("ERROR: No snmp response from $hostname (alarm)\n"); | 102 | print ("ERROR: No snmp response from $hostname (alarm)\n"); |
103 | exit $ERRORS{"UNKNOWN"}; | 103 | exit $ERRORS{"UNKNOWN"}; |
@@ -288,7 +288,7 @@ sub print_usage() { | |||
288 | sub print_help() { | 288 | sub print_help() { |
289 | print_revision($PROGNAME, '@NP_VERSION@'); | 289 | print_revision($PROGNAME, '@NP_VERSION@'); |
290 | print_usage(); | 290 | print_usage(); |
291 | printf "check_ifoperstatus plugin for Nagios monitors operational \n"; | 291 | printf "check_ifoperstatus plugin for monitoring operational \n"; |
292 | printf "status of a particular network interface on the target host\n"; | 292 | printf "status of a particular network interface on the target host\n"; |
293 | printf "\nUsage:\n"; | 293 | printf "\nUsage:\n"; |
294 | printf " -H (--hostname) Hostname to query - (required)\n"; | 294 | printf " -H (--hostname) Hostname to query - (required)\n"; |
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl index 63c71ff..a4be960 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl | |||
@@ -1,10 +1,10 @@ | |||
1 | #!/usr/local/bin/perl -w | 1 | #!/usr/local/bin/perl -w |
2 | # | 2 | # |
3 | # check_ifstatus.pl - nagios plugin | 3 | # check_ifstatus.pl - monitoring plugin |
4 | # | 4 | # |
5 | # | 5 | # |
6 | # Copyright (C) 2000 Christoph Kron | 6 | # Copyright (C) 2000 Christoph Kron |
7 | # Modified 5/2002 to conform to updated Nagios Plugin Guidelines (S. Ghosh) | 7 | # Modified 5/2002 to conform to updated Monitoring Plugins Guidelines (S. Ghosh) |
8 | # Added -x option (4/2003) | 8 | # Added -x option (4/2003) |
9 | # Added -u option (4/2003) | 9 | # Added -u option (4/2003) |
10 | # Added -M option (10/2003) | 10 | # Added -M option (10/2003) |
@@ -25,7 +25,7 @@ | |||
25 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 25 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
26 | # | 26 | # |
27 | # | 27 | # |
28 | # Report bugs to: ck@zet.net, nagiosplug-help@lists.sf.net | 28 | # Report bugs to: ck@zet.net, help@monitoring-plugins.org |
29 | # | 29 | # |
30 | # 11.01.2000 Version 1.0 | 30 | # 11.01.2000 Version 1.0 |
31 | # | 31 | # |
@@ -99,7 +99,7 @@ my %session_opts; | |||
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | # Just in case of problems, let's not hang Nagios | 102 | # Just in case of problems, let's not hang the monitoring system |
103 | $SIG{'ALRM'} = sub { | 103 | $SIG{'ALRM'} = sub { |
104 | print ("ERROR: No snmp response from $hostname (alarm timeout)\n"); | 104 | print ("ERROR: No snmp response from $hostname (alarm timeout)\n"); |
105 | exit $ERRORS{"UNKNOWN"}; | 105 | exit $ERRORS{"UNKNOWN"}; |
@@ -239,7 +239,7 @@ sub print_usage() { | |||
239 | sub print_help() { | 239 | sub print_help() { |
240 | print_revision($PROGNAME, '@NP_VERSION@'); | 240 | print_revision($PROGNAME, '@NP_VERSION@'); |
241 | print_usage(); | 241 | print_usage(); |
242 | printf "check_ifstatus plugin for Nagios monitors operational \n"; | 242 | printf "check_ifstatus plugin for monitoring operational \n"; |
243 | printf "status of each network interface on the target host\n"; | 243 | printf "status of each network interface on the target host\n"; |
244 | printf "\nUsage:\n"; | 244 | printf "\nUsage:\n"; |
245 | printf " -H (--hostname) Hostname to query - (required)\n"; | 245 | printf " -H (--hostname) Hostname to query - (required)\n"; |
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index 42a9bca..7612a0e 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl | |||
@@ -16,8 +16,6 @@ | |||
16 | # ----------------------------------------------------------------------------- | 16 | # ----------------------------------------------------------------------------- |
17 | # Copyright 1999 (c) Richard Mayhew | 17 | # Copyright 1999 (c) Richard Mayhew |
18 | # | 18 | # |
19 | # Credits go to Ethan Galstad for coding Nagios | ||
20 | # | ||
21 | # If any changes are made to this script, please mail me a copy of the | 19 | # If any changes are made to this script, please mail me a copy of the |
22 | # changes :) | 20 | # changes :) |
23 | # | 21 | # |
@@ -121,7 +119,7 @@ sub print_help () | |||
121 | print_revision($PROGNAME,'@NP_VERSION@'); | 119 | print_revision($PROGNAME,'@NP_VERSION@'); |
122 | print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop | 120 | print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop |
123 | 121 | ||
124 | Perl Check IRCD plugin for Nagios | 122 | Perl Check IRCD plugin for monitoring |
125 | 123 | ||
126 | "; | 124 | "; |
127 | print_usage(); | 125 | print_usage(); |
@@ -205,7 +203,7 @@ MAIN: | |||
205 | 203 | ||
206 | if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } | 204 | if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } |
207 | 205 | ||
208 | # Just in case of problems, let's not hang Nagios | 206 | # Just in case of problems, let's not hang the monitoring system |
209 | $SIG{'ALRM'} = sub { | 207 | $SIG{'ALRM'} = sub { |
210 | print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; | 208 | print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; |
211 | exit $ERRORS{"UNKNOWN"}; | 209 | exit $ERRORS{"UNKNOWN"}; |
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index a1bfb48..54408cb 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Log file pattern detector plugin for Nagios | 3 | # Log file pattern detector plugin for monitoring |
4 | # Written by Ethan Galstad (nagios@nagios.org) | 4 | # Written by Ethan Galstad (nagios@nagios.org) |
5 | # Last Modified: 07-31-1999 | 5 | # Last Modified: 07-31-1999 |
6 | # | 6 | # |
@@ -29,15 +29,15 @@ | |||
29 | # | 29 | # |
30 | # If you use this plugin make sure to keep the following in mind: | 30 | # If you use this plugin make sure to keep the following in mind: |
31 | # | 31 | # |
32 | # 1. The "max_attempts" value for the service should be 1, as this | 32 | # 1. The "max_attempts" value for the service should be 1, as this will |
33 | # will prevent Nagios from retrying the service check (the | 33 | # prevent the monitoring system from retrying the service check (the |
34 | # next time the check is run it will not produce the same results). | 34 | # next time the check is run it will not produce the same results). |
35 | # | 35 | # |
36 | # 2. The "notify_recovery" value for the service should be 0, so that | 36 | # 2. The "notify_recovery" value for the service should be 0, so that the |
37 | # Nagios does not notify you of "recoveries" for the check. Since | 37 | # monitoring system does not notify you of "recoveries" for the check. |
38 | # pattern matches in the log file will only be reported once and not | 38 | # Since pattern matches in the log file will only be reported once and |
39 | # the next time, there will always be "recoveries" for the service, even | 39 | # not the next time, there will always be "recoveries" for the service, |
40 | # though recoveries really don't apply to this type of check. | 40 | # even though recoveries really don't apply to this type of check. |
41 | # | 41 | # |
42 | # 3. You *must* supply a different <old_file_log> for each service that | 42 | # 3. You *must* supply a different <old_file_log> for each service that |
43 | # you define to use this plugin script - even if the different services | 43 | # you define to use this plugin script - even if the different services |
@@ -60,7 +60,6 @@ | |||
60 | # TV: removed PATH restriction. Need to think more about what this means overall | 60 | # TV: removed PATH restriction. Need to think more about what this means overall |
61 | #PATH="" | 61 | #PATH="" |
62 | 62 | ||
63 | ECHO="/bin/echo" | ||
64 | GREP="/bin/egrep" | 63 | GREP="/bin/egrep" |
65 | DIFF="/bin/diff" | 64 | DIFF="/bin/diff" |
66 | TAIL="/bin/tail" | 65 | TAIL="/bin/tail" |
@@ -86,7 +85,7 @@ print_help() { | |||
86 | echo "" | 85 | echo "" |
87 | print_usage | 86 | print_usage |
88 | echo "" | 87 | echo "" |
89 | echo "Log file pattern detector plugin for Nagios" | 88 | echo "Log file pattern detector plugin for monitoring" |
90 | echo "" | 89 | echo "" |
91 | support | 90 | support |
92 | } | 91 | } |
@@ -167,10 +166,10 @@ done | |||
167 | # If the source log file doesn't exist, exit | 166 | # If the source log file doesn't exist, exit |
168 | 167 | ||
169 | if [ ! -e $logfile ]; then | 168 | if [ ! -e $logfile ]; then |
170 | $ECHO "Log check error: Log file $logfile does not exist!\n" | 169 | echo "Log check error: Log file $logfile does not exist!" |
171 | exit $STATE_UNKNOWN | 170 | exit $STATE_UNKNOWN |
172 | elif [ ! -r $logfile ] ; then | 171 | elif [ ! -r $logfile ] ; then |
173 | $ECHO "Log check error: Log file $logfile is not readable!\n" | 172 | echo "Log check error: Log file $logfile is not readable!" |
174 | exit $STATE_UNKNOWN | 173 | exit $STATE_UNKNOWN |
175 | fi | 174 | fi |
176 | 175 | ||
@@ -180,7 +179,7 @@ fi | |||
180 | 179 | ||
181 | if [ ! -e $oldlog ]; then | 180 | if [ ! -e $oldlog ]; then |
182 | $CAT $logfile > $oldlog | 181 | $CAT $logfile > $oldlog |
183 | $ECHO "Log check data initialized...\n" | 182 | echo "Log check data initialized..." |
184 | exit $STATE_OK | 183 | exit $STATE_OK |
185 | fi | 184 | fi |
186 | 185 | ||
@@ -209,10 +208,10 @@ $RM -f $tempdiff | |||
209 | $CAT $logfile > $oldlog | 208 | $CAT $logfile > $oldlog |
210 | 209 | ||
211 | if [ "$count" = "0" ]; then # no matches, exit with no error | 210 | if [ "$count" = "0" ]; then # no matches, exit with no error |
212 | $ECHO "Log check ok - 0 pattern matches found\n" | 211 | echo "Log check ok - 0 pattern matches found" |
213 | exitstatus=$STATE_OK | 212 | exitstatus=$STATE_OK |
214 | else # Print total matche count and the last entry we found | 213 | else # Print total matche count and the last entry we found |
215 | $ECHO "($count) $lastentry" | 214 | echo "($count) $lastentry" |
216 | exitstatus=$STATE_CRITICAL | 215 | exitstatus=$STATE_CRITICAL |
217 | fi | 216 | fi |
218 | 217 | ||
diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl index cbf2ae7..e3e7391 100755 --- a/plugins-scripts/check_mssql.pl +++ b/plugins-scripts/check_mssql.pl | |||
@@ -21,7 +21,7 @@ | |||
21 | # along with this program; if not, write to the Free Software | 21 | # along with this program; if not, write to the Free Software |
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 | # | 23 | # |
24 | # Report bugs to: help@nagios-plugins.org | 24 | # Report bugs to: help@monitoring-plugins.org |
25 | # | 25 | # |
26 | # | 26 | # |
27 | 27 | ||
@@ -44,7 +44,7 @@ my $exitcode = $ERRORS{'OK'}; | |||
44 | 44 | ||
45 | process_arguments(); | 45 | process_arguments(); |
46 | 46 | ||
47 | # Just in case of problems, let's not hang Nagios | 47 | # Just in case of problems, let's not hang the monitoring system |
48 | $SIG{'ALRM'} = sub { | 48 | $SIG{'ALRM'} = sub { |
49 | print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n"); | 49 | print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n"); |
50 | exit $ERRORS{"UNKNOWN"}; | 50 | exit $ERRORS{"UNKNOWN"}; |
diff --git a/plugins-scripts/check_ntp.pl b/plugins-scripts/check_ntp.pl index 5c87e0a..d452b1b 100755 --- a/plugins-scripts/check_ntp.pl +++ b/plugins-scripts/check_ntp.pl | |||
@@ -172,7 +172,7 @@ if ($utils::PATH_TO_NTPQ && -x $utils::PATH_TO_NTPQ ) { | |||
172 | $have_ntpq = 0; | 172 | $have_ntpq = 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | # Just in case of problems, let's not hang Nagios | 175 | # Just in case of problems, let's not hang the monitoring system |
176 | $SIG{'ALRM'} = sub { | 176 | $SIG{'ALRM'} = sub { |
177 | print ("ERROR: No response from ntp server (alarm)\n"); | 177 | print ("ERROR: No response from ntp server (alarm)\n"); |
178 | exit $ERRORS{"UNKNOWN"}; | 178 | exit $ERRORS{"UNKNOWN"}; |
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 77eba2e..b653372 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | # latigid010@yahoo.com | 3 | # latigid010@yahoo.com |
4 | # 01/06/2000 | 4 | # 01/06/2000 |
5 | # | 5 | # |
6 | # This Nagios plugin was created to check Oracle status | 6 | # This Monitoring plugin was created to check Oracle status |
7 | # | 7 | # |
8 | 8 | ||
9 | PROGNAME=`basename $0` | 9 | PROGNAME=`basename $0` |
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index d2701e9..474067e 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/usr/local/bin/perl -w | 1 | #!/usr/local/bin/perl -w |
2 | # | 2 | # |
3 | # check_rpc plugin for nagios | 3 | # check_rpc plugin for monitoring |
4 | # | 4 | # |
5 | # usage: | 5 | # usage: |
6 | # check_rpc host service | 6 | # check_rpc host service |
@@ -254,7 +254,7 @@ $proto = 't' if ($opt_t); | |||
254 | $proto = 'u' if ($opt_u); | 254 | $proto = 'u' if ($opt_u); |
255 | 255 | ||
256 | 256 | ||
257 | # Just in case of problems, let's not hang Nagios | 257 | # Just in case of problems, let's not hang the monitoring system |
258 | $SIG{'ALRM'} = sub { | 258 | $SIG{'ALRM'} = sub { |
259 | print ("ERROR: No response from RPC server (alarm)\n"); | 259 | print ("ERROR: No response from RPC server (alarm)\n"); |
260 | exit $ERRORS{"UNKNOWN"}; | 260 | exit $ERRORS{"UNKNOWN"}; |
diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in index 37cd62c..b25def5 100644 --- a/plugins-scripts/utils.pm.in +++ b/plugins-scripts/utils.pm.in | |||
@@ -1,6 +1,6 @@ | |||
1 | # Utility drawer for Nagios plugins. | 1 | # Utility drawer for monitoring plugins. |
2 | # | 2 | # |
3 | # This will be deprecated soon. Please use Nagios::Plugin from CPAN | 3 | # This will be deprecated soon. Please use Monitoring::Plugin from CPAN |
4 | # for new plugins | 4 | # for new plugins |
5 | 5 | ||
6 | package utils; | 6 | package utils; |
diff --git a/plugins-scripts/utils.sh.in b/plugins-scripts/utils.sh.in index 4a07df8..031c035 100644 --- a/plugins-scripts/utils.sh.in +++ b/plugins-scripts/utils.sh.in | |||
@@ -6,19 +6,13 @@ STATE_CRITICAL=2 | |||
6 | STATE_UNKNOWN=3 | 6 | STATE_UNKNOWN=3 |
7 | STATE_DEPENDENT=4 | 7 | STATE_DEPENDENT=4 |
8 | 8 | ||
9 | if test -x /usr/bin/printf; then | ||
10 | ECHO=/usr/bin/printf | ||
11 | else | ||
12 | ECHO=echo | ||
13 | fi | ||
14 | |||
15 | print_revision() { | 9 | print_revision() { |
16 | echo "$1 v$2 (@PACKAGE@ @VERSION@)" | 10 | echo "$1 v$2 (@PACKAGE@ @VERSION@)" |
17 | $ECHO "@WARRANTY@" | sed -e 's/\n/ /g' | 11 | printf '%b' "@WARRANTY@" |
18 | } | 12 | } |
19 | 13 | ||
20 | support() { | 14 | support() { |
21 | $ECHO "@SUPPORT@" | sed -e 's/\n/ /g' | 15 | printf '%b' "@SUPPORT@" |
22 | } | 16 | } |
23 | 17 | ||
24 | # | 18 | # |