Created 04-29-2016 07:21 PM
I was configuring Nagios server. I modified the needed changes to the config file in config folder of Nagios by logging into node where Nagios server is installed. Upon restart of Nagios server through Ambari, the old config is restored overiding my changes.
Entire config file is not shown in Ambari so that I can make config changes for Nagios in ambari directly.
Please let me know how to prevent this.
Created 05-04-2016 08:00 PM
On your ambari server, edit the nagios config file in this location: /var/lib/ambari-server/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/
This is the location where ambari stores the configuration files for nagios.
Once you have edited the file, restart the ambari-server process. This will push your new nagios changes to your nagios server. Then in ambari, restart the nagios service. You should now see your changes in the Nagios Admin UI.
We had a similiar case where we needed more than one contact in nagios. Updating the contacts.cfg.j2 on the ambari server pushed the new contacts into the nagios config and everything worked like a charm.
Created 04-29-2016 07:39 PM
You are not supposed to edit config files manually. Use Ambari to make required change. If you can't see that property in corresponding service you can add new property under "Custom <file-name>" section.
Created 05-04-2016 08:10 PM
Thank you!
Created 04-29-2016 09:16 PM
@Shankar B can you please let us know what version of ambari are you using ? What is Nagios file that you need to change and kind of changes that you want to do ?
Created 04-29-2016 09:20 PM
I am using Ambari 1.7.0 and Nagios Core 3
I need to setup email contacts and the commands to send a notification via email for every alert. In particular I am trying to update few parameters as mentioned here :
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectdefinitions.html#contact
Created 04-29-2016 09:31 PM
All the Nagios files are deployed via python Jinja templates (https://github.com/apache/ambari/tree/branch-1.7.0/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates).
UI exposes some of the basic setting of these files but not entire files.
For doing advances changes in Nagios files, you will need to search these templates and change them directly on Nagios server host and on ambari-server host.
Created 05-04-2016 08:09 PM
Thank you!
Created 05-04-2016 08:00 PM
On your ambari server, edit the nagios config file in this location: /var/lib/ambari-server/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/
This is the location where ambari stores the configuration files for nagios.
Once you have edited the file, restart the ambari-server process. This will push your new nagios changes to your nagios server. Then in ambari, restart the nagios service. You should now see your changes in the Nagios Admin UI.
We had a similiar case where we needed more than one contact in nagios. Updating the contacts.cfg.j2 on the ambari server pushed the new contacts into the nagios config and everything worked like a charm.
Created 05-04-2016 08:09 PM
Thanks a lot! This helped me a lot