[Xymon] Xymon on RHEL3 - not working?

John Horne john.horne at plymouth.ac.uk
Tue Jul 10 16:12:40 CEST 2012


On Tue, 2012-07-10 at 12:26 +0100, John Horne wrote:
> 
> Looking at the code (in ./common/xymonlaunch.c) I can see the
> ('running') loop that it runs through and it looks fine. But because
> nothing at all is logged with debug, and as far as I can see all
> eventualities should report something, then the 'for' loop of the task
> list is probably not being entered (the initial ('for') loop works, but
> subsequently is failing?) I'll add some more logging to the client
> xymonlaunch code and see what happens.
> 
As far as I can tell the problem in xymonlaunch.c comes from line 607:

   time_t now = gettimer();


Printing out what 'now' is gives 0 all the time. 'gettimer' comes from
lib/timefunc.c line 49:

======================================
time_t gettimer(void)
{
        int res;
        struct timespec t;

#if (_POSIX_TIMERS > 0) && defined(_POSIX_MONOTONIC_CLOCK)
        res = clock_gettime(CLOCK_MONOTONIC, &t);
        return (time_t) t.tv_sec;
#else
        return time(NULL);
#endif
}
======================================


However printing out 'res' shows that 'clock_gettime' is always
returning an error (-1). If I use 'time(NULL)' instead, then it all
works fine - the logs look correct and the purple results stay green. (I
have run this for about 30 mins now with no purple appearing.)

Not sure how you would want to fix this, but I changed it slightly to
say:

======================================
        res = clock_gettime(CLOCK_MONOTONIC, &t);
        if (res == 0) {
            return (time_t) t.tv_sec;
        }
        else {
            return time(NULL);
        }
======================================


I wrote a small test program using clock_gettime, and on RHEL 4 and 6
they both ran without error. On RHEL 3 it always gives an error.




John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001



More information about the Xymon mailing list