Page 1 of 1

Misc Settings Page - Notes URL export

Posted: Wed May 07, 2014 6:44 am
by opssupport
Hello Support,
We would like your assistance with the following:
To each alert received on Nagios, there is a notes button, that leads to a knowledge base article.
We would like to export a list of all alerts in NagiosXI that have a link to that knowledge base assigned.
We configure this by putting the URL to the KB, as seen in the attached screen shot, in the XI configuration page.

the URL in XI is: ipaddress/nagiosxi/includes/components/ccm/xi-index.php

Can you please assist?

Thanks!
Sharon Alper,
OPSsupport.

Re: Misc Settings Page - Notes URL export

Posted: Wed May 07, 2014 10:45 am
by Stuart Watts
All of the service configurations for each host are contained in /usr/local/nagios/etc/services/"HOSTNAME".cfg - these are plain text files, so if you're okay with tools like grep, knock yourself out (something like "grep -hi -B5 notes_url /usr/local/nagios/etc/services/* | grep -e "host_name" -e "service_description" -e "notes_url"" worked for me, YMMV).

A more reliable way is to get it out of the MySQL DB (DB name is "nagios") with a query like:

Code: Select all

SELECT nagios_hosts.display_name AS hostname,nagios_services.display_name,nagios_services.notes_url FROM nagios_hosts,nagios_services WHERE (nagios_hosts.host_object_id = nagios_services.host_object_id) AND nagios_services.notes_url<>"";
I've not picked through the DB too much, so that might not be the most efficient way of getting that info, but it should work!

Re: Misc Settings Page - Notes URL export

Posted: Wed May 07, 2014 11:51 am
by scottwilkerson
You can get these in XML from the Backend API Component as well
Admin -> Manage Components -> Backend API URL

Select URL for either
Hosts:
Services:

Re: Misc Settings Page - Notes URL export

Posted: Thu May 08, 2014 11:27 am
by technick
If you know the specific URL you could use this

Code: Select all

select config_name,service_description from tbl_service where notes_url="";
Just add the URL inside the quotes at the end.

If you want to search for wildcards

Code: Select all

select config_name,service_description from tbl_service where notes_url like '%string%';

Re: Misc Settings Page - Notes URL export

Posted: Thu May 08, 2014 3:49 pm
by lmiltchev
@opssupport

Let us know if your issue has been resolved.