Page 1 of 2

Preventing to add a contact

Posted: Fri Aug 05, 2016 11:00 am
by mdsupersonic
Hi Nagios Support team,
I have a question ,how can I prevent Nagios to add the admin contact to the host and it's services which are newly added to the server?
Whenever I add a new host, Nagios will add my contact for notification either for host or for all services related to that host.How can I prevent that from the beginning ?

Regards

Majid

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 11:24 am
by bwallace
Just how are you adding these hosts / services - are you using templates or host / service groups? The reason I ask if you add a single host (without templates or applying it to a host group), you must manually specify a contact, if not, the contact field will be left blank. On the Alert Settings tab click 'Manage Contacts'

One
Alert settings tab click manage contacts.jpg
Two
No conacts by default.jpg

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 12:11 pm
by mdsupersonic
Thank you for your reply,I'm adding by wizards both windows and Linux servers.Bu t I don't know why Nagios add my contact for notification.I went through more than 500 services to remove my contact which is frustrating.

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 12:43 pm
by scottwilkerson
On step 4 of the wizard you can uncheck
Myself (Adjust my settings)
Also, if you want this to be the default behavior you can go through a wizard until the end (unchecking that box) and then save it as a template.

Once saved you can set that template as the default template

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 12:52 pm
by mdsupersonic
Perfect,thank you for your reply.
I have another question I made mistake in configuration once but I corrected that and saved the configuration.
But Nagios still shows that error again and again and when I click 'Try again' it will be fine.I check the error several time and there is nothing I can do.How can I overcome this issue to not happening again?
scrennshots are attached

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 1:12 pm
by lmiltchev
Go to the CCM->Tools->Write Config Files->Click on "Delete", "Write", and "Verify" in the exact same order. If you see any config errors - go back to the CCM, and fix them, then verify configuration one more time. If you don't see any config errors, apply configuration.

If this doesn't help, run the following command to begin capturing log output:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log &> /tmp/cmd.txt
Attempt to Apply Configuration from the web interface. After the browser has returned some output to the screen, press Ctrl+C to stop the log tail, and post the cmd.txt file, generated in the "/tmp" directory by the above instructions.

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 1:26 pm
by mdsupersonic
Here is the output of cmd.txt file :

[root@tornagios3 tmp]# cat cmd.txt
..............
PROCESSED 1 COMMANDS
temctl status nagios.service" and "journalctl -xe" for details.
OUTPUT=RET: 0
RETURNCODE=6

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 1:35 pm
by mdsupersonic
Another output:
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
OUTPUT=RET: 0
RETURNCODE=6

PROCESSED 4 COMMANDS

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 2:03 pm
by bwallace
Thanks for those details.

Check to see if there are multiple Nagios processes running, as this will cause an array of problems.

run this cmd on your nagios server:
ps - aef | grep nagios.cfg

* Look for multiple parent (PPID) processes. The Nagios process forks itself to run checks therefore subprocesses are normal. The nagios user should probably be the only owner of the nagios process. If in any doubt post the output here.

If there are multiple Nagios processes running, run these commands to resolve:

Code: Select all

service nagios stop
killall -9 nagios
service nagios start

Re: Preventing to add a contact

Posted: Fri Aug 05, 2016 2:23 pm
by mdsupersonic
Unfortunately still I have the problem.
I did everything,killed nagios services an restart it but still I have that Error message . :(