notes_url doesn't work with hostgroup but works hostextinfo

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
stefanlasiewski
Posts: 9
Joined: Fri Apr 20, 2012 3:24 pm

notes_url doesn't work with hostgroup but works hostextinfo

Post by stefanlasiewski »

We recently upgraded our Nagios 2.x installation to Nagios 3.2.x .

We used to provide `notes` and `notes_url` as part of the hostextinfo, like this:

Code: Select all

define hostextinfo{
    host_name    host1, host2, host3
    notes            These are special hosts
    notes_url      https://wiki.example.org/problemsolving/SpecialHosts
    }
define hostgroup {
    hostgroup_name specialhosts
    alias                  Special Hosts
    members           host1, host2, host3
}
howextinfo{} has been depreciated, so we want to get rid of it. Also, we would like to simplify the Nagios rules by consolidating the hostextinfo{} info into the hostgroup{} info, like this:

Code: Select all

define hostgroup {
    hostgroup_name specialhosts
    alias            Special Hosts
    members      host1, host2, host3
    notes            These are special hosts
    notes_url      https://wiki.example.org/problemsolving/SpecialHosts
}
But if I use the hostextinfo{} definition above, the notes_url does work.

However, when we do this the notes_url does not appear in the CGI. Can anyone help me figure out why?

-= Stefan
Last edited by stefanlasiewski on Wed Apr 25, 2012 5:27 pm, edited 1 time in total.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: notes_url doesn't work with hostgroup {}

Post by agriffin »

The notes are not displayed everywhere. As far as I know, you can only view them in the Extended Information CGI.
stefanlasiewski
Posts: 9
Joined: Fri Apr 20, 2012 3:24 pm

Re: notes_url doesn't work with hostgroup {}

Post by stefanlasiewski »

agriffin wrote:The notes are not displayed everywhere. As far as I know, you can only view them in the Extended Information CGI.
In my case, the notes are not displayed either in extinfo.cgi or status.cgi.

In nagios 2, they were displayed in status.cgi and extinfo.cgi. It appears this should be the case in Nagios 3.2.3. Here is the sourcecode from status.c , which shows that notes_url should be called:

Code: Select all

                if(temp_host->notes_url!=NULL){
                    printf("<TD align=center valign=center>");
                    printf("<A HREF='");
                    process_macros(temp_host->notes_url,&processed_string,0);
                    printf("%s",processed_string);
                    free(processed_string);
                    printf("' TARGET='%s'>",(notes_url_target==NULL)?"_blank":notes_url_target);
                    printf("<IMG SRC='%s%s' BORDER=0 WIDTH=%d HEIGHT=%d ALT='%s' TITLE='%s'>",url_images_path,NOTES_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT,"View Extra Host Notes","View Extra Host Notes");
                    printf("</A>");
                    printf("</TD>\n");
                        }

In addition, here's a screenshot from another user shows the "notes_url" icon (the red folder icon) from status.cgi :

http://www.doxer.org/wp-content/uploads ... on_url.jpg
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: notes_url doesn't work with hostgroup but works hostexti

Post by agriffin »

I just tried this myself to refresh my memory on how this works, and I got the icon for notes_url in the list of services as well as the notes text displayed right in the service detail page. Did you restart Nagios after making the changes? If you're on 3.2.3 I don't really know what could be causing this.
Locked