Manually remove contact

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
christopher.thompson
Posts: 4
Joined: Mon Jul 27, 2020 11:52 am

Manually remove contact

Post by christopher.thompson »

I have an old employee that's been removed from the contacts, now when I try to commit changes it spits errors as a result of their username being referenced in host cfg files. How do I best remove the username from all files in order to apply the configuration
lazzarinof
Posts: 50
Joined: Thu Sep 23, 2021 12:26 pm

Re: Manually remove contact

Post by lazzarinof »

When I had this issue, I used sed to delete the contact:

For the area in quotes: the s indicates a string, then a slash. After the slash is the string to be deleted/replaced, then another slash. Then the string to replace (leave blank to just delete the first string. Then a slash. Then a lowercase g, indicating to delete/replace all instances:
sed -i 's/string to be deleted or replaced here/string to replace with, or leave blank to just delete/g' /usr/example/directory//*

But I'd always hesitate extreme caution when manually editing the config files.
Post Reply