diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-26 21:02:21 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-26 21:02:21 +0000 |
commit | 6728e60669cfa3011e5ab5f3315feccd6205668d (patch) | |
tree | 74d9596f6d37acab3fc338d642766825eb6be69b /plugins-scripts/utils.pm.in | |
parent | 287f5e29c6e91a4a7afa59158430db3f25f2eb1c (diff) | |
download | monitoring-plugins-6728e60669cfa3011e5ab5f3315feccd6205668d.tar.gz |
Fixed regression where hostnames with hyphens were rejected (1581402 - Holger Weiss)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1528 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-scripts/utils.pm.in')
-rw-r--r-- | plugins-scripts/utils.pm.in | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in index d4dddae9..e2458359 100644 --- a/plugins-scripts/utils.pm.in +++ b/plugins-scripts/utils.pm.in | |||
@@ -1,32 +1,9 @@ | |||
1 | # Utility drawer for Nagios plugins. | 1 | # Utility drawer for Nagios plugins. |
2 | # $Id$ | 2 | # $Id$ |
3 | # | 3 | # |
4 | # $Log$ | 4 | # This will be deprecated soon. Please use Nagios::Plugin from CPAN |
5 | # Revision 1.9 2006/10/19 18:44:53 tonvoon | 5 | # for new plugins |
6 | # Allow hostnames beginning with digits (O'Shaughnessy Evans - 1567390) | 6 | |
7 | # | ||
8 | # Revision 1.8 2006/06/07 14:23:12 seanius | ||
9 | # removed stale references to PATH_TO_NTPFOO, as it's no longer used. | ||
10 | # | ||
11 | # Revision 1.7 2003/04/13 04:25:36 sghosh | ||
12 | # update for check_mailq - qmail support | ||
13 | # | ||
14 | # Revision 1.6 2003/02/03 20:29:55 sghosh | ||
15 | # change ntpdc to ntpq (Jonathan Rozes,Thomas Schimpke, bug-656237 ) | ||
16 | # | ||
17 | # Revision 1.5 2002/10/30 05:07:29 sghosh | ||
18 | # monitor mailq | ||
19 | # | ||
20 | # Revision 1.4 2002/05/27 02:01:09 sghosh | ||
21 | # new var - smbclient | ||
22 | # | ||
23 | # Revision 1.3 2002/05/10 03:49:22 sghosh | ||
24 | # added programs to autoconf | ||
25 | # | ||
26 | # Revision 1.2 2002/05/08 05:10:35 sghosh | ||
27 | # is_hostname added, update CODES to POSIX | ||
28 | # | ||
29 | # | ||
30 | package utils; | 7 | package utils; |
31 | 8 | ||
32 | require Exporter; | 9 | require Exporter; |
@@ -76,7 +53,7 @@ sub usage { | |||
76 | 53 | ||
77 | sub is_hostname { | 54 | sub is_hostname { |
78 | my $host1 = shift; | 55 | my $host1 = shift; |
79 | if ($host1 && $host1 =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)$/) { | 56 | if ($host1 && $host1 =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z0-9][-a-zA-Z0-9]+(\.[a-zA-Z0-9][-a-zA-Z0-9]+)*)$/) { |
80 | return 1; | 57 | return 1; |
81 | }else{ | 58 | }else{ |
82 | return 0; | 59 | return 0; |