SHARE
TWEET

How remove Items from a Host directly on Zabbix DB

xsbr Dec 19th, 2012 1,070 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Discovery the HostID
  2. SELECT hostid FROM hosts WHERE host = 'servername';
  3. +--------+------------+
  4. | hostid | host       |
  5. +--------+------------+
  6. |  10094 | servername |
  7. +--------+------------+
  8. 1 ROW IN SET (0.00 sec)
  9.  
  10. # Remove Triggers FROM HostID 10094
  11. DELETE triggers
  12.         FROM triggers
  13.         LEFT JOIN functions ON triggers.triggerid=functions.triggerid
  14.         LEFT JOIN items ON functions.itemid=items.itemid
  15.         WHERE items.hostid=10094;
  16.  
  17. # Remove Functions FROM HostID 10094
  18. DELETE functions
  19.         FROM functions
  20.         LEFT JOIN items ON functions.itemid=items.itemid
  21.         WHERE items.hostid=10094;
  22.  
  23. # Remove Itens FROM HostID 10094
  24. DELETE FROM items WHERE hostid=10094;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top