Page 1 of 1

notes_url doesn't work with hostgroup but works hostextinfo

Posted: Mon Apr 23, 2012 6:05 pm
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

Re: notes_url doesn't work with hostgroup {}

Posted: Wed Apr 25, 2012 2:03 pm
by agriffin
The notes are not displayed everywhere. As far as I know, you can only view them in the Extended Information CGI.

Re: notes_url doesn't work with hostgroup {}

Posted: Wed Apr 25, 2012 5:07 pm
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

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

Posted: Fri Apr 27, 2012 10:11 am
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.