Page 2 of 2

Re: Freshness threshold in passive host checks

Posted: Sun Sep 04, 2011 2:53 pm
by crfriend
mguthrie wrote:The icon issue may be a little more tricky, I think the change might need to take place in the actual cgi (and need to be recompiled). However, there are still a lot of tricks with Core that I don't know yet, so there could be a solution out there for that.
Pursuant to my last comment on the matter that getting the icon to change when active checks are disabled for hosts but passives are enabled requiring a change to the CGIs, I tweaked my copy of "status.c" here to good effect. I now see the "passive" icon for hosts with active checks disabled (but passives enabled) and the "disabled" one on hosts which have both disabled.

The diff output:

Code: Select all

bash-3.00$ diff nagios-3.3.1-stock/cgi/status.c nagios-3.3.1-crf/cgi/status.c
1610c1610,1613
<                                       printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Checks of this host have been disabled'd TITLE='Checks of this host have been disabled'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, DISABLED_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
---
>                                       if (temp_hoststatus->accept_passive_host_checks == TRUE) {
>                                               printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Only passive checks are being processed' TITLE='Only passive checks are being accepted'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, PASSIVE_ONLY_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
>                                       } else {
>                                               printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Only passive checks are being processed' TITLE='Passive checks only are being accepted'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, DISABLED_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
1611a1615
>                                       }
2105c2109,2112
<                               printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Checks of this host have been disabled' TITLE='Checks of this host have been disabled'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, DISABLED_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
---
>                               if (temp_status->accept_passive_host_checks == TRUE) {
>                                       printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Only passive checks are being processed' TITLE='Passive checks only are being accepted'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, PASSIVE_ONLY_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
>                               } else {
>                                       printf("<TD ALIGN=center valign=center><A HREF='%s?type=%d&host=%s'><IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='Checks of this host have been disabled' TITLE='Checks of this host have been disabled'></A></TD>", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_status->host_name), url_images_path, DISABLED_ICON, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT);
2106a2114
>                               }
bash-3.00$ 
The usual disclaimers and mea cuplas apply.

It'd be nice to see this, or something like it, make it into the formal source tree. I grant full permission.

Cheers!

Re: Freshness threshold in passive host checks

Posted: Tue Sep 06, 2011 1:29 pm
by perezpau1
Thank you! The actual core environment pertaining to web host quality experienced completely handed myself by simply.

You actually rescued us a lots of debugging period. Wonderful! :)

Re: Freshness threshold in passive host checks

Posted: Tue Sep 06, 2011 10:15 pm
by ElsaLSA
Great to find this forum and it help me so much. Thanks for sharing!!

Re: Freshness threshold in passive host checks

Posted: Thu Sep 08, 2011 10:15 am
by hunterr
Try using the ochp_command command to send over passive results.