Page 1 of 1

Extract data from Nagios

Posted: Tue Jan 12, 2021 9:31 pm
by RebeccaIlene
Hi Team,

Is there a way we can extract the critical and warning thresholds for all services for each server in Nagios?

Re: Extract data from Nagios

Posted: Wed Jan 13, 2021 5:45 pm
by cdienger
Export the configuration using the API and you can grep for some key lines. For example:

Code: Select all

curl -XGET "https://xi_ip/nagiosxi/api/v1/config/service?apikey=api_key&pretty=1" | grep 'config_name\|service_description\|check_command'
This info can also be found in /usr/local/nagios/var/objects.cache.