Zabbix Server: 5.2
Database Engine: mariadb (MySQL)
Problem: Hosts that have been decommissioned or are no longer in service, reappear in device list after being deleted
I searched long and hard on this and kept running into dead ends or forums that had a question but no answer. So I decided to look at the
database to see if maybe I can find an answer. Well, I looked at the
and the
tables. But when I tried to
remove devices manually, I kept on getting an error because of the Foreign Key. Well, I found an obscure article by complete accident
that had the answer to my problem. Below is the queries that I put into my mysql instance:
I'll also put the article that I found at the end of this post. But this is essentially disabling the checks that sql does to the foreign
keys between tables, truncating the dhosts and dservices (respectively) and re-enabling the foreign keys checks.
After you truncate the table, you will notice that the "Discovery" menu in Monitoring>Discovery is empty or already re-listing devices that
are discovered. This will keep you from having to painfully remove a Discovery Rule and readding it.
Hopefully this helps someone else having this issue.
Command Source: https://www.edureka.co/community/815...int-references
Database Engine: mariadb (MySQL)
Problem: Hosts that have been decommissioned or are no longer in service, reappear in device list after being deleted
I searched long and hard on this and kept running into dead ends or forums that had a question but no answer. So I decided to look at the
database to see if maybe I can find an answer. Well, I looked at the
Code:
zabbix.dhosts
Code:
zabbix.dservices
remove devices manually, I kept on getting an error because of the Foreign Key. Well, I found an obscure article by complete accident
that had the answer to my problem. Below is the queries that I put into my mysql instance:
Code:
SET FOREIGN_KEY_CHECKS = 0; TRUNCATE table $table_name; SET FOREIGN_KEY_CHECKS = 1;
keys between tables, truncating the dhosts and dservices (respectively) and re-enabling the foreign keys checks.
After you truncate the table, you will notice that the "Discovery" menu in Monitoring>Discovery is empty or already re-listing devices that
are discovered. This will keep you from having to painfully remove a Discovery Rule and readding it.
Hopefully this helps someone else having this issue.
Command Source: https://www.edureka.co/community/815...int-references
Comment