Page 1 of 1

Contact...has no service notification commands defined

Posted: Tue Oct 22, 2019 3:41 pm
by vornado
Trying to resolve "Contact Steve has no service notification commands defined" error(when applying configuration), I ran ./reconfigure_nagios.sh and got these errors:

Code: Select all

--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
  - Importing: /usr/local/nagios/etc/import/localhost.cfg .. PHP Notice:  Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice:  Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
PHP Notice:  Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 570
PHP Notice:  Undefined index: host_name in /usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php on line 924
ERROR
   Duplicate entry '1' for key 'config_name'Entry host_name:: inside tbl_host could not be inserted: 1<br>Entry host_name:: inside tbl_host could not be inserted: 1<br>
--------------------------------------

Importing into the CCM failed!
[email protected]:/usr/local/n
Restoring from yesterday's backup did not fix the original issue. Also, adding the missing contact information (service notification and host notification commands) did not fix.

Show written configs shows this:

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Configuration file: localhost.cfg successfully written!
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
Thanks for your usual quick response.

Steve

Re: Contact...has no service notification commands defined

Posted: Tue Oct 22, 2019 3:55 pm
by ssax
Are you specifically trying to import?

If not, please remove the files from this directory and try again:

Code: Select all

/usr/local/nagios/etc/import/

Re: Contact...has no service notification commands defined

Posted: Wed Oct 23, 2019 11:33 am
by vornado
Thanks -- deleting localhost.cfg from /usr/local/nagios/etc/import/ solved the problem. Other files with that name were also in
/usr/local/nagios/etc/hosts/ and /usr/local/nagios/etc/services. Are they created during an upgrade?

Thanks again -- case closed.

Steve