PDA

View Full Version : SNMP with cacti on 3.3.13


sth
07-24-2008, 03:56 AM
I'm using LSWS 3.3.13.
I have enable SNMPD configuring snmpd.conf with:

pass .1.3.6.1.4.1.22253 /usr/bin/php5/php /opt/lsws/add-ons/snmp_monitoring/sample.php


if i run manualy the sample.php I receive a response...

# /usr/bin/php5/php -q ./sample.php -n .1.3.6.1.4.1.22253.101
.1.3.6.1.4.1.22253.101.1
string
LiteSpeed Web Server


...but if I use snmpwalk I haven't response from snmpd.
On sample.php file I view that is need to pass two parameters ($type and $OID):

//get params from snmpd pass mechanism
if(array_key_exists(1,$_SERVER["argv"]) && array_key_exists(2,$_SERVER["argv"])) {

$type = trim($_SERVER["argv"][1]);
$oid = trim($_SERVER["argv"][2]);
$bridge = new litespeed_snmp_bridge($processes, $report_path, $cache_time, $cache_file);
$bridge->process($type, $oid);

}



snmpd "pass" method pass only $OID but not $type and then $bridge->process() is not run.

Thanks