<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi!<DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This works well .... until the list of hosts on a node changes.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV>We still want to have retained state information, but we want it to ignore the last state due to an enable/disable active check.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>We can make it work using this patch:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--- nagios-2.4/xdata/xrddefault.c       2006-04-07 15:00:57.000000000 +0100</DIV><DIV>+++ nagios-2.5/xdata/xrddefault.c       2006-07-21 13:08:35.430520177 +0100</DIV><DIV>@@ -239,7 +239,7 @@</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>                fprintf(fp,"host {\n");</DIV><DIV>                fprintf(fp,"\thost_name=%s\n",temp_host->name);</DIV><DIV>-               fprintf(fp,"\tmodified_attributes=%lu\n",temp_host->modified_attributes);</DIV><DIV>+               fprintf(fp,"\tmodified_attributes=%lu\n",temp_host->modified_attributes&16381);</DIV><DIV>                fprintf(fp,"\tcheck_command=%s\n",(temp_host->host_check_command==NULL)?"":temp_host->host_check_command);</DIV><DIV>                fprintf(fp,"\tevent_handler=%s\n",(temp_host->event_handler==NULL)?"":temp_host->event_handler);</DIV><DIV>                fprintf(fp,"\thas_been_checked=%d\n",temp_host->has_been_checked);</DIV><DIV>@@ -293,7 +293,7 @@</DIV><DIV>                fprintf(fp,"service {\n");</DIV><DIV>                fprintf(fp,"\thost_name=%s\n",temp_service->host_name);</DIV><DIV>                fprintf(fp,"\tservice_description=%s\n",temp_service->description);</DIV><DIV>-               fprintf(fp,"\tmodified_attributes=%lu\n",temp_service->modified_attributes);</DIV><DIV>+               fprintf(fp,"\tmodified_attributes=%lu\n",temp_service->modified_attributes&16381);</DIV><DIV>                fprintf(fp,"\tcheck_command=%s\n",(temp_service->service_check_command==NULL)?"":temp_service->service_check_command);</DIV><DIV>                fprintf(fp,"\tevent_handler=%s\n",(temp_service->event_handler==NULL)?"":temp_service->event_handler);</DIV><DIV>                fprintf(fp,"\thas_been_checked=%d\n",temp_service->has_been_checked);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This alters the value in the retention file to strip off data re: active checks. My question is:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Would this be a useful parameter to put into nagios.cfg?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ton</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><A href="http://www.altinity.com">http://www.altinity.com</A></DIV><DIV>T: +44 (0)870 787 9243</DIV><DIV>F: +44 (0)845 280 1725</DIV><DIV>Skype: tonvoon</DIV></SPAN></SPAN></SPAN></SPAN></SPAN><BR class="Apple-interchange-newline"></SPAN></DIV><BR></DIV></BODY></HTML>