[Nagios-devel] patch: extend navbar host lookup

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] patch: extend navbar host lookup

Post by Guest »

--=-g7iBYG34KcPnjGrXPm0m
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This small patch extends the 2.0 'Show Host:' lookup in the left navbar
to try matching against hostgroup and servicegroup entries before giving
up.

I find it handy. Thoughts?

--
Matthew Kent \ SA \ bravenet.com \ 1-250-954-3203 ext 108

--=-g7iBYG34KcPnjGrXPm0m
Content-Disposition: attachment; filename=nagios-2.0a1-navbar.patch
Content-Type: text/x-patch; name=nagios-2.0a1-navbar.patch; charset=
Content-Transfer-Encoding: 7bit

--- nagios-cvs_orig/cgi/status.c Thu Oct 2 17:07:04 2003
+++ nagios-cvs/cgi/status.c Sun Mar 21 20:58:57 2004
@@ -178,6 +178,8 @@
int result=OK;
char *sound=NULL;
host *temp_host=NULL;
+ hostgroup *temp_hostgroup=NULL;
+ servicegroup *temp_servicegroup=NULL;

time(&current_time);

@@ -255,7 +257,22 @@
}
}
}
- }
+ }
+ /* last effort, search hostgroups then servicegroups */
+ if(temp_host==NULL){
+ if((temp_hostgroup=find_hostgroup(host_name))!=NULL){
+ display_type=DISPLAY_HOSTGROUPS;
+ show_all_hostgroups=FALSE;
+ free(host_name);
+ hostgroup_name=strdup(temp_hostgroup->group_name);
+ }
+ else if((temp_servicegroup=find_servicegroup(host_name))!=NULL){
+ display_type=DISPLAY_SERVICEGROUPS;
+ show_all_servicegroups=FALSE;
+ free(host_name);
+ servicegroup_name=strdup(temp_servicegroup->group_name);
+ }
+ }
}

if(display_header==TRUE){

--=-g7iBYG34KcPnjGrXPm0m--






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