I've found that a large number of hosts on one of my instances has an invalid parent. The IP is valid, so the parent host check is successful, but should no longer be listed as a parent.
There's no bulk feature to remove parent, only add. Any best practices to accomplish this large task?
Bulk remove parent?
Bulk remove parent?
Andrew J. - Do you even grok?
Re: Bulk remove parent?
This functionality is being added to the Bulk Mods tool in the next release, but is not currently available publicly.
If you promise to make a good backup we can possibly do this with some DB manipulation.
If you promise to make a good backup we can possibly do this with some DB manipulation.
Former Nagios employee
Re: Bulk remove parent?
Alright. Meeting time now, and I don't want to rush it, but the tbl_lnkHostToHost is where I am going to start looking, in case you want to check for yourself while I am AFK.
Update:
Alright, so this is a bit confusing but bear with me. tbl_lnkHostToHost is laid out like this:
In this case, I had set "somehost" as the child of "anotherhost" - "somehost" has an id of 2, and "anotherhost" has an id of 3. However, in the db the "idMaster" field is actually for the child, and "idSlave" is for the parent.
Go figure.
Severing those with an appropriate "DELETE WHERE idSlave = <parent id>" command should work, just make sure you properly limit it.
Update:
Alright, so this is a bit confusing but bear with me. tbl_lnkHostToHost is laid out like this:
Code: Select all
mysql> select * from tbl_lnkHostToHost;
+----------+---------+
| idMaster | idSlave |
+----------+---------+
| 2 | 3 |
+----------+---------+
1 row in set (0.00 sec)
Go figure.
Severing those with an appropriate "DELETE WHERE idSlave = <parent id>" command should work, just make sure you properly limit it.
Former Nagios employee