External commands changes not reflecting in Nagios xi

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
durgaraoyv
Posts: 18
Joined: Mon Jun 04, 2018 7:58 am

External commands changes not reflecting in Nagios xi

Post by durgaraoyv »

Hi

We have enabled Notifications for all the services in a service group through Service group links provided in Service Summary. The notifications are flowing as expected. But the particular services, in CCM, are not showing them as "Notifications Enabled". Is this as expected or we need to any more for this to get reflected in CCM ?

Thank you.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External commands changes not reflecting in Nagios xi

Post by ssax »

It is expected.

The changes to the notifications/etc through the hostgroup/servicegroup commands (or through external commands) will only modify the runtime settings and are by default preserved across apply configs/nagios service restarts. If you want them reflected in the CCM you would need to make the changes in the CCM.

Please note that the runtime settings override the CCM settings if you make changes to them so it's always good to check the + (advanced) tab when viewing the host/service if you are having issues to see if the runtime settings have been modified.
- NOTE: That is also the case for Admin > Monitoring Engine Status changes and the associated /usr/local/nagios/etc/nagios.cfg settings

Thank you!
durgaraoyv
Posts: 18
Joined: Mon Jun 04, 2018 7:58 am

Re: External commands changes not reflecting in Nagios xi

Post by durgaraoyv »

Hi

Is there a way to generate a report that can be generated with runtime settings, to get a list of all so that we can compare with that in CCM ?

Thank you.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External commands changes not reflecting in Nagios xi

Post by ssax »

There isn't currently a report for it, you would need to look in your /usr/local/nagios/var/status.dat file or use the API to see them:

Code: Select all

http://YOURxiSERVER/nagiosxi/help/api-object-reference.php#objects-hoststatus
http://YOURxiSERVER/nagiosxi/help/api-object-reference.php#objects-servicestatus
http://YOURxiSERVER/nagiosxi/help/api-system-reference.php#system-status
I have submitted a feature-request to development on your behalf with a link back to this post:

Code: Select all

FR: xi - Add report to show running configuration settings for hosts/services/programstatus/etc and what they are in the nagios.cfg/configs and the ability to only show ones with differences from the configs
Please keep in mind that the decision to implement the enhancement is at the discretion of our development team.

Thank you!
durgaraoyv
Posts: 18
Joined: Mon Jun 04, 2018 7:58 am

Re: External commands changes not reflecting in Nagios xi

Post by durgaraoyv »

Hi

"the ability to only show ones with differences from the configs"
Can we get this info from DB ?

We do have a script currently getting the below details from status.dat
host_name,service_description,check_interval,warning_threshold,critical_threshold,units_of_measure,notifications_enabled,check_command

Thank you.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External commands changes not reflecting in Nagios xi

Post by ssax »

You could probably get it from the databases but nothing is currently written to do it, I'll take a look and update shortly.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External commands changes not reflecting in Nagios xi

Post by ssax »

These should get you started:

Config vs Runtime settings for notifications_enabled for Hosts:

Code: Select all

mysql -uroot -pnagiosxi nagios -e "SELECT nagios_objects.name1 AS HOST, 'notifications_enabled' AS ITEM, nagios_hosts.notifications_enabled AS CONFIG, nagios_hoststatus.notifications_enabled AS RUNTIME FROM nagios_objects LEFT JOIN nagios_hosts ON nagios_hosts.host_object_id = nagios_objects.object_id LEFT JOIN nagios_hoststatus on nagios_hoststatus.host_object_id = nagios_objects.object_id WHERE nagios_objects.is_active = 1 AND nagios_objects.objecttype_id = 1;"
Config vs Runtime settings for notifications_enabled for Services:

Code: Select all

mysql -uroot -pnagiosxi nagios -e "SELECT nagios_objects.name1 AS HOST, nagios_objects.name2 AS SERVICE, 'notifications_enabled' AS ITEM, nagios_services.notifications_enabled AS CONFIG, nagios_servicestatus.notifications_enabled AS RUNTIME FROM nagios_objects LEFT JOIN nagios_services ON nagios_services.service_object_id = nagios_objects.object_id LEFT JOIN nagios_servicestatus on nagios_servicestatus.service_object_id = nagios_objects.object_id WHERE nagios_objects.is_active = 1 AND nagios_objects.objecttype_id = 2;"
The nagios.cfg settings are not stored in the database so I'm unable to compare those for the program status.
durgaraoyv
Posts: 18
Joined: Mon Jun 04, 2018 7:58 am

Re: External commands changes not reflecting in Nagios xi

Post by durgaraoyv »

Hi

Thank you so much for all your support.
Will check using the shared query and get back to you.

Thank you.
durgaraoyv
Posts: 18
Joined: Mon Jun 04, 2018 7:58 am

Re: External commands changes not reflecting in Nagios xi

Post by durgaraoyv »

Hi

Thank you for the SQL. It helped in getting the differences between the runtime and those displayed in CCM.
Please mark this as closed.

Thank you.