TheWitness wrote:
1) Please verify if php_snmp is installed. Post your findings.
It's installed. Sorry for not metioning it explicitly. The fact that with 0.8.6i (and with 0.8.6j, with the little mod I was talking in my previous post) I had no problems should nearly show that the problem is in some change between cacti 0.8.6i and 0.8.6j.
The thing (I think) is that in php-snmp version 4.3, snmpgetnext is not implemented. I had a look at php source code and, althought I'm not a programmer, I found no mention about it in the snmp module. Instead, in php version 5, snmpgetnext is implemented.
In 0.8.6i we did not use snmpgetnext, so there was no problem even using php 4.3. Now in 0.8.6j, since bug#0000886, we use snmpgetnext. But it is not implemented in php-snmp v4.3, and my cmd.php crashes.
TheWitness wrote:
2) Please verify that you have a valid path the the binary snmpgetnext. Post your findings.
It's in /usr/bin, and it works. But I'm using snmp v1 so in lib/snmp.php I'm using SNMP_METHOD_PHP, and not SNMP_METHOD_BINARY.
TheWitness wrote:
3) Please revert to ".1" and sniff utilizing Wireshark (Ethereal) and PM me the capture file.
I sniffed using the filter 'port 33439 or port 161'. The first being the UDP port used for UDP pinging, the second the SNMP port. Absolutely no packet was captured.
Not surprinsing for me, because of the way cmd.php works: it first pings the host, then it retrieves the data it needs. My cmd.php dies as soon as it tries to ping the host (the first is localhost) with a call to snmpgetnext (which is not implemented in php 4.3, and cmd.php suddenly dies).
If I should sniff using a different filter please ask me. My system is in production, so sniffing without a filter produces a lot of unuseful, and potentially private, infos.
<opinion>
I love network analyzers very much, but unfortunately in this case this kind of tool is of little help, since cmd.php dies just before sending its first packet.
</opinion>
TheWitness wrote:
This works perfectly fine on other systems.
Hmm.. with cacti = 0.8.6j and PHP < 5? Because only in this situation this problem arises.
Another info: I tried to use both the options "Ping and SNMP" and "SNMP" for "Downed Host Detection" in the poller options. Since the SNMP ping is tried in both cases, cmd.php dies in both cases.
On my side, things return to work perfectly if I only apply the following patch that reverts to the old-style (pre-0.8.6j) SNMP ping style if we are on php < 5:
Code:
--- lib/ping.php.lux 2007-01-20 08:49:25.000000000 -0500
+++ lib/ping.php 2007-01-20 12:21:05.000000000 -0500
@@ -289,6 +289,7 @@
return false;
}
+ if (PHP_VERSION >= 5) {
$output = cacti_snmp_getnext($this->host["hostname"],
$this->host["snmp_community"],
$oid,
@@ -298,6 +299,18 @@
$this->host["snmp_port"],
$this->host["snmp_timeout"],
SNMP_CMDPHP);
+ }else{
+ /* no snmpgetnext here :( */
+ $output = cacti_snmp_get($this->host["hostname"],
+ $this->host["snmp_community"],
+ ".1.3.6.1.2.1.1.3.0" ,
+ $this->host["snmp_version"],
+ $this->host["snmp_username"],
+ $this->host["snmp_password"],
+ $this->host["snmp_port"],
+ $this->host["snmp_timeout"],
+ SNMP_CMDPHP);
+ }
/* determine total time +- ~10% */
$this->time = $this->get_time($this->precision);
Thank you.