Page 1 of 1

[Nagios-devel] Ignore specific retention data

Posted: Fri Jul 21, 2006 6:29 am
by Guest

--Apple-Mail-35--908721712
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Hi!

We have been working on load balanced, failover nodes for distributed
slaves (phew - lots of keywords in that sentence!). The idea we had
was that you have 2 Nagios slave servers that load balanced a set of
hosts (and their services) and forward those results back to the
master. We call those 2 Nagios slave servers the nodes in the slave
cluster.

The design is that those two nodes would have all hosts defined in
the cluster, but some would have active checks turned off (via the
configuration files). There would be a service on each node to
monitor the other node and in the event of a failure, an event
handler would then turn active checks on for the hosts on the other
node via the command file.

This works well .... until the list of hosts on a node changes.

It seems that with retain_state_information=1, there's a variable in
retention.dat for each host or slave called modified_attributes. This
is altered when a command is entered via the command file.

So, hosts that have had active checks turned on will be saved with
modified_attributes=2 (the bit is defined as
MODATTR_ACTIVE_CHECKS_ENABLED in include/common.h). Then, on Nagios
reload, it will use the value for active_checks_enabled in here,
rather than the value we want it to use in the configuration file.

We still want to have retained state information, but we want it to
ignore the last state due to an enable/disable active check.

We can make it work using this patch:

--- nagios-2.4/xdata/xrddefault.c 2006-04-07 15:00:57.000000000
+0100
+++ nagios-2.5/xdata/xrddefault.c 2006-07-21 13:08:35.430520177
+0100
@@ -239,7 +239,7 @@

fprintf(fp,"host {\n");
fprintf(fp,"\thost_name=%s\n",temp_host->name);
- fprintf(fp,"\tmodified_attributes=%lu\n",temp_host-
>modified_attributes);
+ fprintf(fp,"\tmodified_attributes=%lu\n",temp_host-
>modified_attributes&16381);
fprintf(fp,"\tcheck_command=%s\n",(temp_host-
>host_check_command==NULL)?"":temp_host->host_check_command);
fprintf(fp,"\tevent_handler=%s\n",(temp_host-
>event_handler==NULL)?"":temp_host->event_handler);
fprintf(fp,"\thas_been_checked=%d\n",temp_host-
>has_been_checked);
@@ -293,7 +293,7 @@
fprintf(fp,"service {\n");
fprintf(fp,"\thost_name=%s\n",temp_service->host_name);
fprintf(fp,"\tservice_description=%s\n",temp_service-
>description);
- fprintf(fp,"\tmodified_attributes=%lu\n",temp_service-
>modified_attributes);
+ fprintf(fp,"\tmodified_attributes=%lu\n",temp_service-
>modified_attributes&16381);
fprintf(fp,"\tcheck_command=%s\n",(temp_service-
>service_check_command==NULL)?"":temp_service->service_check_command);
fprintf(fp,"\tevent_handler=%s\n",(temp_service-
>event_handler==NULL)?"":temp_service->event_handler);
fprintf(fp,"\thas_been_checked=%d\n",temp_service-
>has_been_checked);


This alters the value in the retention file to strip off data re:
active checks. My question is:

Would this be a useful parameter to put into nagios.cfg?

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon



--Apple-Mail-35--908721712
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1

Hi!We have been working on =
load balanced, failover nodes for distributed slaves (phew - lots of =
keywords in that sentence!). The idea we had was that you have 2 Nagios =
slave servers that load balanced a set of hosts (and their services) and =
forward those results back to the master. We call those 2 Nagios slave =
servers the nodes in the slave cluster.The design is that those =
two nodes would have all hosts defined in the cluster, but some would =
have active checks turned off (via the configuration files). There would =
be a servi

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]