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

Discussion in 'Install/Configuration' started by TiME, Feb 11, 2012.

  1. TiME

    TiME New Member

    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: Feb 15, 2012
  2. NiteWave

    NiteWave Administrator

  3. TiME

    TiME New Member

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

    webizen New Member

    /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:
  5. TiME

    TiME New Member

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

    ihost New Member

    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);
    DoctorTyrell likes this.
  7. DoctorTyrell

    DoctorTyrell New Member

    Thanks, that fixed them for me.
  8. DoctorTyrell

    DoctorTyrell New Member

    It's been a year, but let me ask @ihost where'd you come up with that solution?
    (still works btw)

Share This Page