counterintuitive behaviour of retain_state_information

Marc Powell marc at ena.com
Fri Aug 6 01:05:07 CEST 2004


----Original Message----
From: Chaos Golubitsky [mailto:walrus+nagios at glassonion.org]
Sent: Thursday, August 05, 2004 4:53 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] counterintuitive behaviour of
retain_state_information 

> Hi all,
> 
> So, i spent a large amount of time tracking down a problem i was
> having with Nagios configuration, and i would like some insight into
> why the program behaves this way.  
> 
> The problem i was having: after enabling performance data globally, i
> tried to turn it off for some services, that is, to have
> process_perf_data="yes" for some services, but not for others.  
> However, even if i set process_perf_data="no", those services still
> collected performance data. 
> 
> The solution: stop nagios, delete status.sav, restart nagios.
> 
> The reason: Nagios reads in its configuration file, and only after
> that reads in the state file, so any variables which are set in the
> state file, *including all the boolean configuration variables for
> services and hosts*, are overridden by the values in the state file. 
> 
> 
> Could someone please explain to me how this is not a bug?  Is there

It's documented --

http://nagios.sourceforge.net/docs/1_0/xodtemplate.html

Retention Notes 

It is important to point out that several directives in host and service
definitions may not be picked up by Nagios when you change them. Host
and service directives that can exhibit this behavior are marked with an
asterisk (*). The reason for this behavior is due to the fact that
Nagios chooses to honor values stored in the state retention file over
values found in the config files, assuming you have state retention
enabled on a program-wide basis. 

One way to get around this problem is to disable the retention of
non-status information using the retain_nonstatus_information directive
in the host and service definitions. Disabling this directive will cause
Nagios to take the initial values for these directives from your config
files, rather than from the state retention file when it (re)starts.
Using this option is not recommended, as it may result in some
unexpected (from your point of view) results. 

Alternatively, you can issue the appropriate external command or change
the value of the host or service directive via the web interface, so
that it matches what you've changed it to in the config files. This is
usually done by using the extended information CGI. This option takes a
bit more work, but is preferable to disabling the retention of
non-status information (mentioned above). 



> any way for me to keep the presumably useful last check information
> stored in status.sav across restarts, without losing the ability to
> reconfigure services?  Apologies for the frustration, but i have

'retain_nonstatus_information 0' in your host/service definition or
template should do it.

retain_nonstatus_information: This directive is used to determine
whether or not non-status information about the host is retained across
program restarts. This is only useful if you have enabled state
retention using the retain_state_information directive. Value: 0 =
disable non-status information retention, 1 = enable non-status
information retention.  

--
Marc



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.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