Code: Select all
curl -XPUT -k "https://$NAGSERVER/nagiosxi/api/v1/config/host/localhost?apikey=$NAGAPI&pretty=1&host_name=$NAGSERVER"Code: Select all
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
Error: Could not find any host matching 'localhost' (config file '/usr/local/nagios/etc/services/localhost.cfg', starting on line 104)
Error: Failed to expand host list 'localhost' for service 'Total Processes' (/usr/local/nagios/etc/services/localhost.cfg:104)Problem is I need an automatic fix for this -- so, how do I avoid this, or failing that automate my workaround of the error?