Contactgroup.cfg error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Fenikas
Posts: 3
Joined: Tue Dec 10, 2019 2:13 pm

Contactgroup.cfg error

Post by Fenikas »

Hello everyone,

I am new to the Nagios XI world and need some help. I am trying to apply the configuration but keep getting this error:
Error: Contact 'TBlalock' specified in service 'CPU Usage' for host 'en-sql-p01.domain.local' is not defined anywhere!

I get it about 19 times. I know in the contactgroup.cfg the users name is in there. When I extract a copy of the file (via FTP), I delete the name and add it back (via FTP). After hitting apply config, the name goes right back and I get the same error. I am not a linux person so this is new to me.

How can I remove this person from the Application group (that is the contact group name he is) via command lines. Or just purge this contact from nagios. The user no longer works here.

I did try to go to our Nagios website (under Core Config manager) and delete him from there, but the user isnt even in the group. He only seems to exist in the contactgroup.cfg. How can I get rid of this contact?

Thanks in advance for the help.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Contactgroup.cfg error

Post by mbellerue »

Hi @Fenikas, welcome to the forums!

First, all configuration in XI should be done in the web interface. The configuration files get destroyed and re-written from the configuration in the database every time you apply your configuration. It's definitely useful to know how to work with the plain text configuration files, in case you need to troubleshoot something, or test a configuration, so you're ahead of the curve there. But just know that everything you do with those configuration files will be destroyed eventually.

To the issue at hand. Rogue contact. If this contact does not exist in Configure -> Core Config Manager -> Contacts, then it may be a ghost in the system, which can be a result of changing the configuration files manually. The best way to deal with these is to go to Configure -> Core Config Manager -> Tools -> Config File Management. On that page, hit the Delete Files button, then the Write Configs button, and then the Verify Files button. Sometimes you have to do this process twice. But if it verifies the files successfully, hit the Restart Nagios Core button.

If it doesn't verify the files, if it continues to complain about this particular contact, then we should download a system profile and see if we can find out where that contact exists. To get a system profile go to Admin -> System Config -> System Profile -> Download Profile. You can PM that file to me, and I'll see if I can find where the contact is referenced.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Fenikas
Posts: 3
Joined: Tue Dec 10, 2019 2:13 pm

Re: Contactgroup.cfg error

Post by Fenikas »

Thank you for helping. I ran into a small issue. My Nagios XI is a few version older. Under Tools, I dont see Config File Management.

Under Tools, I have:
Static Configurations
Renaming Tool
Bulk Modifications
Escalation Wizard
Import Config Files
Write Config Files (This is where i would Write config, verify and restart. There is no Delete button)
Delete Config Backups (This is under Legacy CCM. I see the old contact groups.cfg. Delete those?)

I have Nagios XI 2012R1.0 installed.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Contactgroup.cfg error

Post by mbellerue »

Okay, yes it looks like there is no way in the web interface to delete the config files. You will have to do that manually at the command line. It might be worth making a backup before going that route. But I think a delete/write/restart should take care of this.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Fenikas
Posts: 3
Joined: Tue Dec 10, 2019 2:13 pm

Re: Contactgroup.cfg error

Post by Fenikas »

What is the command line to delete it? Which file would I be deleting? THe contract group file only? Sorry, I am still new to the Nagios world.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Contactgroup.cfg error

Post by mbellerue »

Let's start with this,

Code: Select all

rm /usr/local/nagios/etc/hosts/*
rm /usr/local/nagios/etc/services/*
rm /usr/local/nagios/contacts.cfg
rm /usr/local/nagios/servicegroups.cfg
rm /usr/local/nagios/hostgroups.cfg
Or if you'd rather, you can just move those files to a temporary directory, just in case.

Then use the Write Files button, Verify, and then Restart.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked