Page 1 of 2

Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 9:38 am
by celticpiping
Howdy, I'm curious to know why the following contact is still activated in the system, with what I assumed were comments, on every line?

Image

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 12:11 pm
by scottwilkerson
Can you run the following to see if this exists anywhere else in configurations( changing USERNAME and path)?

Code: Select all

grep USERNAME /usr/local/nagios/etc

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 12:33 pm
by celticpiping
Didn't have luck there, but I did run:
sudo grep -rnw /usr/local/nagios/ -e 'USERNAME'

It came back only the contacts.cfg file, and a notification message

Rich

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 12:44 pm
by lmiltchev
Have you restarted nagios service after commenting out all of the lines in the contact's config?

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 1:10 pm
by celticpiping
yes.

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 1:21 pm
by celticpiping
ok, I just found out a couple of things:

1) There are multiple "contacts.cfg" files on the machine
2) Several of them contain his contact info NOT commented out...


So, I guess my searching didn't catch it after all..
And I'm assuming that Nagios for whatever reason, is reading in one of those files..
Every one of them is in my home directory: /HOME/RICH/.......
Only one is in the Nagios directory..


hmmmm

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 1:38 pm
by lmiltchev
That would do it. You can review the nagios.cfg to see the paths (what directories are included). Also, try running:

Code: Select all

ps -ef | grep [n]agios.cfg
to see what config is being used. Commenting out the lines in the additional configs, and restarting nagios should take of the issue.

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 3:31 pm
by celticpiping
looked at nagios.cfg, and it points to 'contacts.cfg', so that's good
Ran the command, and it returned two lines: both of which point
to the same contacts.cfg

Image

Maybe I'll try commenting all instances of the code in the other files, restart nagios & see..

Thanks much,
R

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 3:46 pm
by lmiltchev
Seeing two lines is normal - as you can see, the PID and PPID are the same - 3095. It's just a parent and a child process.

I would recommend that you get rid of all additional contacts.cfg configs. Place all of your contacts in the "default" contacts.cfg file, comment out that contact that you don't want, then restart nagios.

Let us know if your issue has been resolved.

Re: Why aren't my comments(#) working?

Posted: Thu Jul 11, 2019 3:52 pm
by celticpiping
done.

Thanks a bunch.
I'll have to wait till tomorrow to re-test..
R