LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Install/Configuration (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=11)
-   -   Cacti Templates "ExtApp" and "Vhost" queries not working (http://www.litespeedtech.com/support/forum/showthread.php?t=5690)

TiME 02-11-2012 05:39 AM

Cacti Templates "ExtApp" and "Vhost" queries not working
 
I've setup LiteSpeed's Cacti templates according to this article: http://www.litespeedtech.com/support...cti_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. :(

NiteWave 02-12-2012 06:46 PM

Can you try "Monitor LiteSpeed Server Status via RRD Graph"
http://www.litespeedtech.com/support...aph_monitoring

it's simple and easy to setup, and we recommend it.

if RRD working fine, probably "class.litespeed_snmp_bridge.php" need some update, to fix your cacti issue.

TiME 02-15-2012 04:56 AM

Code:

[root@xxx]# /usr/local/lsws/lsphp5/bin/php /xxx/ls_stats/update.php
Working on cpu
Memory read error


webizen 02-15-2012 02:41 PM

/path/to/lsphp5 usually refers to /usr/local/lsws/fcgi-bin/lsphp5 (/usr/local/lsws is the lsws install root). iow, the correct command is:
Quote:

/usr/local/lsws/fcgi-bin/lsphp5 /xxx/ls_stats/update.php

TiME 02-16-2012 04:35 AM

Thanks for your reply, but same result, I've already tried that.

ihost 04-14-2013 05:29 AM

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


All times are GMT -7. The time now is 02:12 AM.