[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     Re: hostmon question


Further info on hostmon write failure. I enabled libdebug in hostmon and
found that there is in fact an error occuring on write attempts
(shouldn't something like this log an error even if libdebug isn't 1,
Vikas?)  On debug I am seeing the following repeated for each
update_event that is sent.

(libdebug) eventlog syswrite error: 
(libdebug) update_event:
        
      SENDER= hostmon, mail1.toronto.i,-,
      VAR= SwapIn,0,10,si,
      DATE= 08,26,17,14,
      SEV= 4,4, 1 

>From the code in nocollib.pl I see we are at this point. (line 483) so
syswrite is returning a negative number, causing the write to silently
abort unless debugging is turned on. Rob, could you enable debugging on
FreeBSD and see if you are seeing this as well?

    ## Here only if socket has been opened and have to write out EVENT.
    $bytesleft = length ($event) ;
    while ($bytesleft)
    {
        local($written);
        local($offset) = 0;     
        $written = syswrite($logfd, $event, $bytesleft, $offset);
        if ($written <= 0)
        {
            ($libdebug > 0) &&
                print STDERR ("(libdebug) eventlog syswrite error: $!\n");
            close($logfd);
            return(-1);   
        }


-- 
  Artificial Intelligence stands no chance against Natural Stupidity.
            GAT d- -p+(--) c++++ l++ u++ t- m--- W--- !v
                 b+++ e* s-/+ n-(?) h++ f+g+ w+++ y*