invalid hostname

Patrick LeBoutillier patrick_leboutillier at hotmail.com
Tue May 6 15:25:07 CEST 2003


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) {
                return FALSE;
        }
        while ((s1 = index (s1, '.'))) {
                s1++;
                if (strspn (s1, "0123456789-.") == 1) {
                        return FALSE;
                }
        }
        return TRUE;
}


There seems to be some standard (RFC-1035) for hostnames that does not allow
a number as the first character in a hostname label.

Maybe you can create an alias for that host, use the IP address or change
the code
and recompile your plugins. I suspect the Perl utils.pm will have the same
check.


Cheers,

Patrick

---------------------
Patrick LeBoutillier
Laval, Quebec, Canada
----- Original Message -----
From: "Simon Østengaard" <simon at ostengaard.dk>
To: <nagios-users at lists.sourceforge.net>
Sent: Tuesday, May 06, 2003 9:00 AM
Subject: [Nagios-users] invalid hostname


> Hi
> I use the check_smtp plugin  ver. 1.3.0
>
> 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.
>
> [root at columbia nagios-plugins-1.3.0]# ./plugins/check_smtp -H mail.2aa.dk
> Invalid host name
> Usage: check_smtp -H host [-e expect] [-p port] [-f from addr] [-w warn]
> [-c crit] [-t timeout] [-v]
>        check_smtp --help
>        check_smtp --version
> [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
>
>
> Any help will be usefull.
>
> Best regards.
> Simon
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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
>


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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