invalid hostname
Simon Østengaard
simon at ostengaard.dk
Wed May 7 12:16:25 CEST 2003
As Patrick wrote:
Here is the code that is causing you problems:
/* from RFC-1035
*
* The labels must follow the rules for ARPANET host names. They must
* start with a letter, end with a letter or digit, and have as interior
* characters only letters, digits, and hyphen. There are also some
* restrictions on the length. Labels must be 63 characters or less. */
int
is_hostname (char *s1)
{
if (!s1 || strlen (s1) > 63) {
return FALSE;
}
if (strcspn (s1,
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXYZ0123456789-.")
!= 0) {
return FALSE;
}
if (strspn (s1, "0123456789-.") == 1) { /* change to if (strspn (s1, "-.") == 1) { */
return FALSE;
}
while ((s1 = index (s1, '.'))) {
s1++;
if (strspn (s1, "0123456789-.") == 1) { /* change to if (strspn (s1, "-.") == 1) { */
return FALSE;
}
}
return TRUE;
}
in the utils.c
delete the number in the check and the plugin will check mail.2aa.dk.
I have tried the latest snapshot but it still won't check mail.2aa.dk
:) Simon
Iain Young wrote:
>On Tue, May 06, 2003 at 09:48:49AM -0400, Simon Wrote:
>
>
>
>>The plugin refuses to check a host that contains a number in the
>>beginning of the hosts fully-qualified-domain-name. I.e mail.2aa.dk.
>>
>>
>
>Actually, IIRC, that is the correct DNS behaviour, according to
>RFC1034. Relavent paragraph from 1034:
>
>The labels must follow the rules for ARPANET host names. They must
>start with a letter, end with a letter or digit, and have as interior
>characters only letters, digits, and hyphen. There are also some
>restrictions on the length. Labels must be 63 characters or less.
>
>[SNIP]
>
>
>
>>[root at columbia nagios-plugins-1.3.0]# telnet mail.2aa.dk 25
>>Trying 80.80.7.208...
>>Connected to mail.2aa.dk.
>>Escape character is '^]'.
>>220 mail.2aa.dk ESMTP Tue, 06 May 2003 15:02:58 +0200
>>
>>
>
>telnet, $MTA, and your resolver/DNS servers being kind. And yes
>it works, and will probably continue to work, but strict adherence
>to 1034 specifies that they are 'illegal'.
>
>My understanding is that a strict implementation of 1034/DNS would
>fail to resolve labels starting with a digit.
>
>
>
>>>Any help will be usefull.
>>>
>>>
>
>How is the plugin determining what a legal hostname is ? Does
>it have a switch or option to make it more kind ?
>
>
>Iain
>
>
>-------------------------------------------------------
>Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
>The only event dedicated to issues related to Linux enterprise solutions
>www.enterpriselinuxforum.com
>
>_______________________________________________
>Nagios-users mailing list
>Nagios-users at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/nagios-users
>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
>::: Messages without supporting info will risk being sent to /dev/null
>
>
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list