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.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.
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$
It'd be nice to see this, or something like it, make it into the formal source tree. I grant full permission.
Cheers!