Contact...has no service notification commands defined

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vornado
Posts: 85
Joined: Wed Jun 13, 2018 9:17 am

Contact...has no service notification commands defined

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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/
vornado
Posts: 85
Joined: Wed Jun 13, 2018 9:17 am

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

Post 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
Locked