Nagios CGI modification

Florent HOUBART Florent.HOUBART at Ajilon.fr
Tue Nov 13 14:42:18 CET 2007


Hello,


>Changing the link is no big deal of course.  My big question is, how do I
>get a list of all the hosts in that host group passed?


You may find exemple of such tasks in status.cgi. You need to loop over all the hosts and check for each if the belong to the hostgroup or not.

Below is an extract of status.c where I only keep what would be relevant for you (extract from function show_hostgroup_overview). 

--------------------------

/* find all the hosts that belong to the hostgroup */
for(temp_hoststatus=hoststatus_list;temp_hoststatus!=NULL;temp_hoststatus=temp_hoststatus->next){

     /* find the host... */
     temp_host=find_host(temp_hoststatus->host_name,NULL);

     /* make sure this host a member of the hostgroup */
     if(!is_host_member_of_hostgroup(hstgrp,temp_host))
          continue;

     /* make sure the user is authorized to see this host */
     if(is_authorized_for_host(temp_host,&current_authdata)==FALSE)
          continue;

 
     /* Do something with the host temp_host */
}

---------------------------

Regards,

Florent Houbart


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20071113/3fae71eb/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list