Bulk remove parent?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Bulk remove parent?

Post by vAJ »

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?
Andrew J. - Do you even grok?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Bulk remove parent?

Post by tmcdonald »

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.
Former Nagios employee
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Bulk remove parent?

Post by vAJ »

Pinky promise
Andrew J. - Do you even grok?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Bulk remove parent?

Post by tmcdonald »

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:

Code: Select all

mysql> select * from tbl_lnkHostToHost;
+----------+---------+
| idMaster | idSlave |
+----------+---------+
|        2 |       3 |
+----------+---------+
1 row in set (0.00 sec)
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.
Former Nagios employee
Locked