Misc Settings Page - Notes URL export

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
opssupport
Posts: 5
Joined: Wed Apr 23, 2014 4:28 am

Misc Settings Page - Notes URL export

Post 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.
You do not have the required permissions to view the files attached to this post.
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: Misc Settings Page - Notes URL export

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Misc Settings Page - Notes URL export

Post 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:
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Re: Misc Settings Page - Notes URL export

Post 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%';
----------------------
Nagios Jedi in training.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Misc Settings Page - Notes URL export

Post by lmiltchev »

@opssupport

Let us know if your issue has been resolved.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked