Xymon Mailing List Archive search

Figuring out the ntp(date) check

list Carl Melgaard
Wed, 25 Aug 2010 12:55:21 +0200
Message-Id: <user-b6561842b705@xymon.invalid>

Hi,

I was trying to figure out, how the ntp-check works, as I sometimes get a "no server suitable for synchronization" error when performing this check.

Im not much of a C-coder, so I have why this line is triggered in the code from bbtest-net.c below:

void run_ntp_service(service_t *service)
{
        testitem_t      *t;
        char            cmd[1024];
        char            *p;
        char            cmdpath[PATH_MAX];

        p = xgetenv("NTPDATE");
        strcpy(cmdpath, (p ? p : "ntpdate"));
        for (t=service->items; (t); t = t->next) {
                if (!t->host->dnserror) {
                        sprintf(cmd, "%s -u -q -p 2 %s 2>&1", cmdpath, ip_to_test(t->host));
                        t->open = (run_command(cmd, "no server suitable for synchronization", t->banner, 1, extcmdtimeout) == 0);
                }
        }
}

Can anyone explain under what conditions that phrase occurs?

Regards,

Carl Melgaard