List services without notes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

List services without notes

Post by vmesquita »

Hello!

We use the field "Notes" in Nagios Services to keep important information. Some services are lacking this field and we would like to know which. Do you know how we could do that? If it's not possible via the interface, a database query could also be used.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: List services without notes

Post by mbellerue »

A quick way to do this if you don't mind hopping into the database would be to run this query (assuming MySQL/MariaDB),

Code: Select all

connect nagios;
select host_object_id, display_name, notes from nagios_services where notes = "" or notes is null;
You should only need display_name and notes, but I added host_object_id in case it makes it easier to tie down the service check to the host.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: List services without notes

Post by vmesquita »

This was almost what I wanted, however finding hosts by ID is really hard. Would there be a way to get a similar output but with a "Host Name" Field?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: List services without notes

Post by mbellerue »

Sure, I should have made it this way to begin with. The original query is only viable in very small environments.

Code: Select all

select h.display_name, s.display_name, s.notes
from nagios_services as s
left join nagios_hosts as h
on s.host_object_id = h.host_object_id
where s.notes = ""
or s.notes is null
order by h.display_name;
This should do what you need it to do.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: List services without notes

Post by vmesquita »

Perfect! That's exactly what I needed.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: List services without notes

Post by mbellerue »

Excellent, glad we could help! Closing thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked