Purpose of use_syslog

Andreas Ericsson ae at op5.se
Sat Jun 6 11:33:03 CEST 2009


Sven-Göran Bergh wrote:
> 
> Andreas Ericsson wrote:
>> I like the current behaviour, but I'd accept a patch to take 'only' or something
>> as an argument to "use_syslog" to make the behaviour you're talking about happen.
>>
>> Do note that history browsing won't work in the CGI's if nagios.log doesn't get
>> written at all, so this option should very, very clearly be marked in such a way
>> that unsuspecting new users don't shoot themselves in the foot. Recreating a
>> proper nagios.log from the syslog messages is ofcourse possible, but I'd rather
>> avoid having to try it if at all possible. Especially given most distributions
>> tendency to only keep syslog files around for four weeks before rotating them
>> into oblivion. Four weeks means users that want availability reports on a month
>> or so won't even realize the data they need isn't where it should be before it
>> doesn't exist anymore. Bad Thing(tm) indeed.
> 
> I agree totally, but have a slightly related comment.
> 
> When using a supervisory process manager, like runit runsv(dir), you really do not
> want any output to appear on the console. To my knowledge there is currently no way
> to run Nagios in the foreground and not have any output on the console. During
> startup you always get something similar to this:
> 
>     Nagios 3.0.6
>     Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
>     Last Modified: 12-01-2008
>     License: GPL
>     
>     Nagios 3.0.6 starting... (PID=2071)
>     Local time is Fri Jun 05 12:26:53 CEST 2009
> 
> My first expectation on use_syslog was at least to get rid of this output.
> 
> Of cause, you may catch console messages when using a process supervisor and
> setup an alternative log daemon for them, but if you want them to end up in
> syslog that's quite awkward. Further more, redirection to /dev/null does not
> play well with process supervisors.
> 

It does if you use a sub-shell.

supervise (nagios nagios.cfg >/dev/null 2>&1)

should work just fine.

> use_syslog is probaly not the best fix for this, since you probably want to
> control the Nagios log output in conjuction with a process manager. Maybe a
> no_console or a --quiet startup flag is better suited.
> 

Agreed. Not my itch to scratch though, but patches welcome :-)

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get




More information about the Developers mailing list