Cacti Templates "ExtApp" and "Vhost" queries not working

#1
I've setup LiteSpeed's Cacti templates according to this article: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:snmp_cacti_monitoring
However, the data queries for "ExtApp" and "Vhost" return 0 items and 0 rows. The "General" data query is working fine though and it's graphs too.

Cacti version: 0.8.7i
LiteSpeed version: 4.1.10 Standard
SNMPD: net-snmp-5.3.2.2

ExtApp query debug:
Code:
+ Running data query [11].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/litespeed_extapp.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.22253.300' Index Count: 0
+ No SNMP data returned
Vhost query debug:
Code:
+ Running data query [10].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/litespeed_vhost.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.22253.200' Index Count: 0
+ No SNMP data returned
snmpd.conf
Code:
rocommunity xxx
pass .1.3.6.1.4.1.22253 /usr/local/lsws/lsphp5/bin/php /usr/local/lsws/add-ons/snmp_monitoring/sample.php
sample.php
Code:
<?

/*--------------------------------
assuming  following entry in /etc/snmp/snmpd.conf

pass .1.3.6.1.4.1.22253 /usr/bin/php smaple.php

if you change the default parent oid node: .1.3.6.1.4.1.22253, you must also modify the OID entries .xml files.
--------------------------------*/


require_once("class.litespeed_snmp_bridge.php");

$processes = 0; //<-- value of > 1 only valid LiteSpeed Enterprise (num of cpus licensed)
$report_path = "/tmp/lshttpd/"; //<-- path to .rtreport folder. Default is /tmp/lshttpd/

$cache_time = 0; //<-- seconds to cache parsed data
$cache_file = "/tmp/_lsws_sampe_cache.txt"; //<-- cache file..full path.


//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);
	
}

?>
PS: I have to correct my statement about "General" query graphs are working. They're displayed (eg. rrd files existing), but don't show any data. Also with the above configuration, all my other graphs stopped working. :(
 
Last edited:
#6
class.litespeed_stats.php

change;
$found = preg_match_all("/REQ_RATE \[([^\]]*)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9]+).([0-9]+), TOT_REQS: ([0-9]+)/i",$content,$result);
and
$found = preg_match_all("/EXTAPP \[([^\]]*)\] \[([^\]]*)\] \[([^\]]*)\]: CMAXCONN: ([0-9]+), EMAXCONN: ([0-9]+), POOL_SIZE: ([0-9]+), INUSE_CONN: ([0-9]+), IDLE_CONN: ([0-9]+), WAITQUE_DEPTH: ([0-9]+), REQ_PER_SEC: ([0-9]+).([0-9]+), TOT_REQS: ([0-9]+)/i",$content,$result);
 
#7
change;
$found = preg_match_all("/REQ_RATE \[([^\]]*)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9]+).([0-9]+), TOT_REQS: ([0-9]+)/i",$content,$result);
and
$found = preg_match_all("/EXTAPP \[([^\]]*)\] \[([^\]]*)\] \[([^\]]*)\]: CMAXCONN: ([0-9]+), EMAXCONN: ([0-9]+), POOL_SIZE: ([0-9]+), INUSE_CONN: ([0-9]+), IDLE_CONN: ([0-9]+), WAITQUE_DEPTH: ([0-9]+), REQ_PER_SEC: ([0-9]+).([0-9]+), TOT_REQS: ([0-9]+)/i",$content,$result);
Thanks, that fixed them for me.
 
Top