Page 1 of 1

nrds.cfg being overwritten

Posted: Thu Oct 12, 2017 10:59 am
by ks6764
I have a template defined on my Nagios XI monitoring servers that our monitored servers are able to pull and this functionality works great and I am able to import the monitoring via the Unconfigured Objects in the GUI.
My question is that the servers we are monitoring are owned by an application team that would like to append the nrds.cfg file with custom monitoring on a per server basis....so no two servers may have the monitoring they would be adding on to nrds.cfg. When they add on monitoring to nrds.cfg, it is being overwritten and based on the time stamp in which it is changing, I think it is occurring when cron kicks off the job to report in to the Nagios xi monitoring server.

What is the best way for them to do what they are seeking to do ? Should they change

Code: Select all

UPDATE_CONFIG="1"
to

Code: Select all

UPDATE_CONFIG="0"
as I would think this would keep the nrds.cfg file from being overwritten ?
Alternatively, should they setup a separate nrds.cfg file called something like nrds_myapp.cfg and populate it and call this configuration via a separate cron entry ? If so, what would that cron entry need to look like ?

Thanks for any assistance.

Kerry

Re: nrds.cfg being overwritten

Posted: Thu Oct 12, 2017 12:56 pm
by tacolover101
which directory is nrds.cfg located in?

Re: nrds.cfg being overwritten

Posted: Thu Oct 12, 2017 1:13 pm
by ks6764
/usr/local/nrdp/clients/nrds

Re: nrds.cfg being overwritten

Posted: Thu Oct 12, 2017 1:40 pm
by dwasswa

Re: nrds.cfg being overwritten

Posted: Mon Oct 16, 2017 5:24 pm
by ks6764
Anything on this ??

Re: nrds.cfg being overwritten

Posted: Tue Oct 17, 2017 9:58 am
by kyang
Yes, the nrds.cfg still does overwrite.

You could define a cron to run both nrds.cfgs. A previous post mentions this same exact topic. You can take a look at it. :D
Quoted from another forum post
https://support.nagios.com/forum/viewto ... 16&t=39238

You could manually place a different config in there and adjust your cron in /var/spool/cron/nagios from:

Code: Select all

 */5 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H 'TEST1' 2>&1
To:

Code: Select all

*/5 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H 'TEST1' 2>&1
    */5 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H 'TEST1' -c /path/to/your/second/nrds.cfg 2>&1
That way it will run both.

Note: If you run the installer again after making this change it WILL overwrite your cron entries and you'll need to re-implement them.

Does this help?

Re: nrds.cfg being overwritten

Posted: Tue Oct 17, 2017 10:10 am
by ks6764
Perfect, thanks.

Re: nrds.cfg being overwritten

Posted: Tue Oct 17, 2017 10:11 am
by kyang
Let us know if you have any more questions.