Deleted user creating config commit errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RwynneZAS
Posts: 22
Joined: Thu Mar 15, 2018 4:21 pm

Deleted user creating config commit errors

Post by RwynneZAS »

We had a person leave our organisation, and I deleted them from Nagios.

Since them, I'm getting many random errors in CCM. The commit fails, with the following:


Error: Contact '[redacted]' is not defined anywhere!
Error: Could not add contact '[redacted]' to host (config file '/usr/local/nagios/etc/hosts/[redacted].cfg', starting on line 16)

I tried adding the name back as a contact, which seemed to work for a bit, but now it's back. I tried deleting the contact and adding it back as a full user (including contact), but that didn't work either.

I see the contact entry in the /usr/loca/nagios/etc/contacts.cfg

I really need to get the user out of all configs, because they aren't here anymore, but I can't seem to figure out how to accomplish it.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted user creating config commit errors

Post by lmiltchev »

Try using the Bulk Mod tool.

CCM > Tools > Bulk Modifications Tool > Remove Contact > Select your contact from the drop-down menu > Find Relationships > Check All (for hosts and services) > Save Changes > Apply Configuration

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
RwynneZAS
Posts: 22
Joined: Thu Mar 15, 2018 4:21 pm

Re: Deleted user creating config commit errors

Post by RwynneZAS »

When i do that, it tells me:

"No relationships for this contact"

Under both hosts and services.

Meanwhile, if I grep for the username in /usr/local/nagios/etc/hosts and /usr/local/nagios/etc/services, I find it referenced in 30 host files and 29 services files.

I tried manually removing it from one of the hsots files (the one which it was throwing a complaint for above), but it not only still throws the error, it throws it for the same file.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted user creating config commit errors

Post by lmiltchev »

Go to the CCM > Tools > Config File Management, and click on all three buttons in the following order: Delete Files > Write Configs > Verify Files.

Show the output after each click. If you don't see any config errors - apply configuration. If you do see errors, post them on the forum.
Be sure to check out our Knowledgebase for helpful articles and solutions!
RwynneZAS
Posts: 22
Joined: Thu Mar 15, 2018 4:21 pm

Re: Deleted user creating config commit errors

Post by RwynneZAS »

Delete files, write files, verify files all ran without error.

When I hit "Apply configuration", I got the same error as in the original post:

Error: Contact '[redacted]' is not defined anywhere!
Error: Could not add contact '[redacted]' to host (config file '/usr/local/nagios/etc/hosts/[redacted].cfg', starting on line 16)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted user creating config commit errors

Post by lmiltchev »

This is very strange... You removed old configs, wrote new ones from the database, and verified configuration with no errors, but then when you tried to apply it, it errored out.

Can you check if you have a config, left by chance in the /usr/local/nagios/etc/import directory?

Code: Select all

ls /usr/local/nagios/etc/import 
Go to the CCM > Hosts, click on the host that gives you an error, click on the "Alert Settings", then on "Manage Contacts". Check to see if your contact is still added to the host. It it is - remove it, click on Close, than "Save". It the contact is not present, still click on "Close" and "Save".

Don't apply configuration yet. Make sure that the contact is removed in the CCM:
CCM > Contacts
and also, the xi user is removed:
Admin > Manage Users
Check to see if the contact is added to a contact group, and remove it from it (if this is the case).

Try applying configuration again.

If it doesn't work, PM me your latest profile:

Admin > System Config > System Profile > Download Profile
Be sure to check out our Knowledgebase for helpful articles and solutions!
RwynneZAS
Posts: 22
Joined: Thu Mar 15, 2018 4:21 pm

Re: Deleted user creating config commit errors

Post by RwynneZAS »

PM with profile sent.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted user creating config commit errors

Post by lmiltchev »

I replied via a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Deleted user creating config commit errors

Post by lmiltchev »

Update: The issue was caused by a config, that was "left over" in the imports directory. The problem was resolved via PM. I am closing this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked