Version: 0.8.6j
OS: Gentoo Linux
Problem: I am currently graphing about 25 machines, 10 of which are behind a firewall. Everything had been working great for these 10 machines for the past 2 years, until the external IP for that machine was switched to something else. Now, the way I had SNMP setup was to have the firewall forward ports 162-171 to port 161 on the respective machines behind the firewall. Everything was working fine until the IP of the firewall changed.
So, before you start saying it's a problem with the firewall, etc., etc. let me explain how these "devices" were setup in cacti and what I changed about them. When things were working I had an entry in my hosts file on the polling machine (where cacti runs) for each of these machines (even though they had the same external IP, which was the firewall IP). That is also how I had them setup in cacti as well, with the "Hostname" field populated with the hostname I had in my hosts file (such as ep-apache1, ep-apache2, ep-apache3, etc) and the correct port in "SNMP Port" field (162/162/163/etc).
So, when the firewall IP changed, instead of going into the hosts file on my polling machine, I just updated the "Hostname" field in cacti to the new IP for each of the 10 machines. From that point forward, only 1 out of the 10 machines behind the firewall was being graphed. argh!
I turned on full logging to watch the poller as it ran, and I noticed it was only picking up the first of the 10 hosts, ep-apache1. So, I started tracing through the code and came to the following lines in cmd.php:
Code: Select all
.....
$current_host = $item["hostname"];
if ($current_host != $last_host) {
$new_host = true;
.....
Yes, I know I can just update my hosts file and get things working again, but this is obviously a bug that I feel should be taken care of. I'd be willing to submit a fix if needed.