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.
Deleted user creating config commit errors
Re: Deleted user creating config commit errors
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.
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!
Re: Deleted user creating config commit errors
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.
"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.
Re: Deleted user creating config commit errors
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.
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!
Re: Deleted user creating config commit errors
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)
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)
Re: Deleted user creating config commit errors
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?
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:
Try applying configuration again.
If it doesn't work, PM me your latest profile:
Admin > System Config > System Profile > Download Profile
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 Don't apply configuration yet. Make sure that the contact is removed in the CCM:
and also, the xi user is removed:CCM > Contacts
Check to see if the contact is added to a contact group, and remove it from it (if this is the case).Admin > Manage Users
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!
Re: Deleted user creating config commit errors
PM with profile sent.
Re: Deleted user creating config commit errors
I replied via a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Deleted user creating config commit errors
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!