nagios and local syslog

Andreas Ericsson ae at op5.se
Sat Oct 13 19:17:49 CEST 2007


Marc Powell wrote:
> 
>> -----Original Message-----
>> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
>> bounces at lists.sourceforge.net] On Behalf Of oboissard at free.fr
>> Sent: Friday, October 12, 2007 5:31 PM
>> To: dennis at huenseler.net
>> Cc: nagios-users at 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                   andreas.ericsson at op5.se
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 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