Fix for duplicate hosts using discover

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
rgardam
Posts: 5
Joined: Fri Mar 09, 2012 12:09 am

Fix for duplicate hosts using discover

Post by rgardam »

I noticed that Nothing was being populated in the plugin_discover_hosts table when the discover plugin ran.

I have Found a fix that solves my problem by editing the findhosts.php

Bad Code -

Code: Select all

$isDuplicateSysName = sizeof(db_fetch_assoc("SELECT * FROM plugin_discover_hosts WHERE sysName='" . $snmp_sysName[0] . "'"));
By having it look up the description from the host table it didn't add hosts that had the same system description already present.

Fixed code -

Code: Select all

$isDuplicateSysName = sizeof(db_fetch_assoc("SELECT * FROM host WHERE description='" . $snmp_sysName[0] . "'"));
Let me know what you think of this change.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest