Marc Powell wrote:
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:nagios-users-
>> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
>> Sent: Friday, October 12, 2007 5:31 PM
>> To: [EMAIL PROTECTED]
>> Cc: nagios-users@lists.sourceforge.net
>> Subject: Re: [Nagios-users] nagios and local syslog
>>
>> Hi
>>
>> I think it would be very good to implement it on syslog .
>> As nagios is written in C language , I think i's just syslog function
>> arguments to change .
> 
> Doesn't look like it's _quite_ that simple. The syslogging is done in
> base/logging.c in the write_to_syslog function. The code specifies the
> log levels (USER and INFO), but does not specify the facility to use,
> relying on the default syslog facility to catch it. From man 3 syslog,
> an openlog call needs to be added to specify the log facility to use for
> subsequent syslog() calls.
> 

LOG_USER is the facility. LOG_INFO is the severity. openlog() is only used
to set a default facility in case one isn't passed to the syslog() function.

The code (in glibc's syslog() function) should look something like this:

        if (!(priority & 0x3f8))
                priority |= default_priority;

except that 0x3f8 is a macro called LOG_FACMASK.

-- 
Andreas Ericsson                   [EMAIL PROTECTED]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Nagios-users mailing list
Nagios-users@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

Reply via email to