Page 1 of 2

Apply Configuration - error

Posted: Tue Sep 04, 2018 3:28 am
by TechTeam Finance
Hello,

I have a problem with Apply Configuration function. I'm using Nagios XI in version 5.4.12. and i have the error like below.

Error: Contact 'xxxxxx' has no service notification commands defined!
Error: Contact 'xxxxxx' has no host notification commands defined!

But problem is when i open contacts in Core Config Manager > Contacts. This contacts are already removed. So why there is still problem with this contacts.

I already tried to use this:

Code: Select all

rm -f /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
and then this:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
but when i start the last .sh with sudo i revived the error like in the screen shot attached

and when i try to start this without sudo i get this:

- bash: ./reconfigure_nagios.sh: Permission denied

Please advise what can i do to solve the problem. I believe that reconfigure_nagios.sh show me more details about the error when i aplly my new configuration.


Best regards,
Alek

Re: Apply Configuration - error

Posted: Tue Sep 04, 2018 1:03 pm
by npolovenko
@TechTeam Finance, In XI web interface please go to Configure -> Core Configurations Manager, then click on Tools -> Config File Management in the left column. Then perform the following actions in order:
1)Write
2)Delete
3)Write
4)Verify

Right after that please ssh into the nagios server and check out the contact file and add the notification command. Then repeat the procedure:

1)Write
2)Delete
3)Write
4)Verify

Re: Apply Configuration - error

Posted: Wed Sep 05, 2018 9:15 am
by TechTeam Finance
please, two quick question before i try to perform as you suggested,

1. Is there any chance that this Config File Management crash the existing monitoring ?
2. Are we talking about the /usr/local/nagios/etc/contacts.cfg file ? What do you mean by add the notification command ? Should i find the not working contacts (contacts from error) and check the host_notifications_comands and service_notification_comands in file mentioned above ? What result i should expect ?

Sorry but I'm quiet a new Nagios user and I don't understand everything ............. yet :)

Re: Apply Configuration - error

Posted: Wed Sep 05, 2018 11:00 am
by npolovenko
@TechTeam Finance, No worries. The config file management will not crash Nagios. It acts like the "Apply Configuration" function, except that if it finds an error in the configs instead of automatically reverting to the latest "successful/working" snapshot it shows you the error and allows you to fix it.
No danger here at all.

2. Yes, that file -> /usr/local/nagios/etc/contacts.cfg. Let's do the following. After you do Delete Write Verify make a screenshot of the error, AND if the error will say something about contacts please upload the /usr/local/nagios/etc/contacts.cfg file here, so I can review it.

Re: Apply Configuration - error

Posted: Thu Sep 06, 2018 7:08 am
by TechTeam Finance
What i did:

Write Configs
Delete Files
Write Configs
Verify

and i get this popup (please find the screenshot attached). There is no error at all.

I add a one more service to one of my host and then tried to apply configuration and i revived the same error as in my first post. So i repeat procedure suggested by you and i get the same notification without an error (4.png). What does it mean ? :)

Re: Apply Configuration - error

Posted: Thu Sep 06, 2018 7:46 am
by TechTeam Finance
one more thing come to my mind. When i change something and delete files write files and verify it and there will be no error there. To see this changes i have to use restart nagios core ? e.g. to see additional service on the dashboard ?

So what is the difference between this restart nagios core and apply configuration ? Is this apply configuration function also restart the nagios core ?

Re: Apply Configuration - error

Posted: Thu Sep 06, 2018 9:59 am
by npolovenko
@TechTeam Finance, The Apply Configuration functionality -> 1) Verifies configs in CCM 2) If everything is OK it writes them to the Database, if not it reverts to the last "working" snapshot 3)Restarts the nagios process to refresh the data in the GUI/sync it to whatever there is in the DB.

It is unusual that you get no error if you repeat the write verify procedure multiple times. Are you sure you haven't clicked on the Apply Configuration between these two cycles?

Please sign in as the Nagios user:
su - nagios
Run the follwoing command as the nagios user and provide me with the output:
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

Re: Apply Configuration - error

Posted: Fri Sep 07, 2018 3:44 am
by TechTeam Finance
you are correct i click applay configuration after write delete write and verify. So i understand i have to repeat what you posted before and make like this:

Write
delete
write
verify

if there is an error with contacts send you an contacts file
if there is no error with contacts after veirfy repeat procedure

write
delete
write
verify

Am i correct understand everything ?

what if the second write delete write and verify action doesn't show any errors with contacts ? What is the next step ?

Hmm maybe one more thing is worthy to add. After I write/delete/write/verify checked the contacts.cfg file there was no contact file what cause the error in very beginning.

How can i safly restart nagios to refresh the date and read a new configuration. Because it looks like the configuration was saved correctly.

Thank you a lot for your patience :)

Re: Apply Configuration - error

Posted: Fri Sep 07, 2018 11:41 am
by npolovenko
@TechTeam Finance, Yes, correct. This is unusual that the errors in your configs are not consistently showing during the verify procedure. Can you send me the output of these commands:
su - nagios
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

Re: Apply Configuration - error

Posted: Mon Sep 10, 2018 9:19 am
by TechTeam Finance
when i try to run reconfigure_nagios.sh i get inforamtion as in screen shot,
the question is it normal ? I need a password to Nagios user account when i was running this ?
I didn't have a password to nagios user ... I try to get there by going sudo su - and then su - nagios.
Is there a default password to user nagios ?