Using the import function to remove config items
Posted: Thu Jul 02, 2015 1:10 am
Hello,
I have a need to remove all "service group" configs from several services - about 800 of them. I don't want these services to be a part of any service group. Rather than using the GUI to do this, I'd like modify a list of cfg files, and then use the import function. The steps that I'm taking:
1. Copy /usr/local/nagios/etc/services/host.cfg to my local computer
2. Remove all "servicegroup" lines
3. Upload new config to /usr/local/nagios/etc/import/host.cfg
4. In Nagios CCM, import /usr/local/nagios/etc/import/host.cfg
5. Write configs to file/Verify/Apply
The problem I'm having is that the import seems to be additive - after the import the previously configured service group remains in the database. I can use the import to change the configuration (i.e.: change servicegroup from A to B), but not remove it. The "overwrite database" box is checked. Is this by design?
Thanks
I have a need to remove all "service group" configs from several services - about 800 of them. I don't want these services to be a part of any service group. Rather than using the GUI to do this, I'd like modify a list of cfg files, and then use the import function. The steps that I'm taking:
1. Copy /usr/local/nagios/etc/services/host.cfg to my local computer
2. Remove all "servicegroup" lines
3. Upload new config to /usr/local/nagios/etc/import/host.cfg
4. In Nagios CCM, import /usr/local/nagios/etc/import/host.cfg
5. Write configs to file/Verify/Apply
The problem I'm having is that the import seems to be additive - after the import the previously configured service group remains in the database. I can use the import to change the configuration (i.e.: change servicegroup from A to B), but not remove it. The "overwrite database" box is checked. Is this by design?
Thanks