Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ambari is overiding the config change

avatar

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.

1 ACCEPTED SOLUTION

avatar
Rising Star
@Shankar B

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.

View solution in original post

8 REPLIES 8

avatar
Expert Contributor

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.

avatar

Thank you!

avatar
Super Collaborator

@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 ?

avatar

@jaimin

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

avatar
Super Collaborator

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.

avatar

Thank you!

avatar
Rising Star
@Shankar B

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.

avatar

Thanks a lot! This helped me a lot