Re: [Nagios-devel] Purpose of use_syslog
Posted: Sat Jun 06, 2009 8:33 am
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 [email protected]
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.
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
>
> 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 [email protected]
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.
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]