Ad Widget

Collapse

LiteSpeed Web Server Monitoring Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bmcclure
    Junior Member
    • Apr 2010
    • 14

    #1

    LiteSpeed Web Server Monitoring Script

    There are plenty of scripts available for monitoring of the Apache server-status page. I didn't find any such scripts for LiteSpeed Web Server upon first glance, however, so I created one in Perl and it's working great so far.

    Download the attached lsws.zip file and you will find two files.

    First, on the server with lsws installed, place the attached send_lsws_stats.pl script.

    Then, add a cron entry for the script, such as:
    */5 * * * * /etc/zabbix/scripts/send_lsws_stats.pl --host=[host] --server=[server] > /dev/null 2>&1

    Other options you can use:
    --reportfile=[reportfile] The path to LiteSpeed's report file. (Default: /tmp/lshttpd/.rtreport)
    --tmpfile=[tmpfile] An alternate path for the temporary file sent to the server (Default: /tmp/zabbix_lshttpd_stats.txt)
    --sender=[sender] The path to zabbix_sender (Default is zabbix_sender, which assumes it is in your path)
    --verbose Provides the -vv argument to zabbix_sender, providing output

    Then import the attached lsws_stats.xml file into the Zabbix server, and link your host with the Template_App_LSWS template.

    Let me know if you have any questions or feature requests.
    Attached Files
  • arta
    Junior Member
    • Jan 2020
    • 4

    #2
    Is this still working with latest version of zabbix 4.4.2 ?
    I am surprised to see that this isn't already in zabbix templates.

    Comment

    • mixmox
      Member
      • Apr 2020
      • 54

      #3
      Hello
      all items are not supported

      7391:20200404:015151.234 active check "lsws.plainconn" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.req_per_sec" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.req_processing" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.sslconn" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.ssl_bps_in" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.ssl_bps_out" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.tot_reqs" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.uptime" is not supported: Unsupported item key.
      7391:20200404:015151.235 active check "lsws.version" is not supported: Unsupported item key.

      Comment

      • mons
        Junior Member
        • Oct 2021
        • 1

        #4
        Well as of the 13.10.2021 this is not working (with php 7+):
        first of all instead of lsphp5 should be lsphp in both lsws_stats.xml and send_lsws_stats.pl file
        the lite speed process is also called litespeed and not lsws

        And after correcting those 2 mistakes still the zabbix server returns:
        Zabbix server returns:
        erroritem type "7" cannot be used with traps
        So you also have to change the item types in the lsws_stats.xml from item type="7" to item type="2"

        So here you go, updated file which is tested and working on zabbix 4.4

        Attached Files

        Comment

        • Execula
          Junior Member
          • May 2023
          • 1

          #5
          ERROR: [line 17] 'Key value' required
          ​How to fix it?

          Comment

          • pounaj
            Junior Member
            • Feb 2024
            • 1

            #6
            @Execula
            the error ERROR: [line 17] 'Key value' required is notifying you that a parameter is missing values.
            The file is /tmp/zabbix_lshttpd_stats.txt

            for example :
            root@ec-mt-mu-rb-selfcare-app-uat-1 scripts $ cat /tmp/zabbix_lshttpd_stats.txt
            "ec-mt-mu-rb-selfcare-app-uat-1" lsws.version LiteSpeed Web Server/Open/1.7.18
            "xxx-server-xxx" lsws.uptime 01:44:49
            "xxx-server-xxx" lsws.bps_in 0
            "xxx-server-xxx" lsws.bps_out 0
            "xxx-server-xxx" lsws.ssl_bps_in 0
            "xxx-server-xxx" lsws.ssl_bps_out 0
            "xxx-server-xxx" lsws.maxconn 10000
            "xxx-server-xxx" lsws.maxssl_conn 10000
            "xxx-server-xxx" lsws.plainconn 0
            "xxx-server-xxx" lsws.availconn 10000
            "xxx-server-xxx" lsws.idleconn 0
            "xxx-server-xxx" lsws.sslconn 0
            "xxx-server-xxx" lsws.availssl 10000
            "xxx-server-xxx" lsws.req_processing 0
            "xxx-server-xxx" lsws.req_per_sec 0
            "xxx-server-xxx" lsws.tot_reqs 23
            "xxx-server-xxx" lsws.php_cmaxconn [MISSING VALUE LINE17]

            One work around is comment the parameter in the script.
            print TMPFILE "$host lsws.tot_reqs $tot_reqs\n";
            print TMPFILE "$host lsws.php_cmaxconn $php_cmaxconn\n";
            print TMPFILE "$host lsws.php_emaxconn $php_emaxconn\n";
            #print TMPFILE "$host lsws.php_pool_size $php_pool_size\n";
            #print TMPFILE "$host lsws.php_inuse_conn $php_inuse_conn\n";
            #print TMPFILE "$host lsws.php_idle_conn $php_idle_conn\n";
            #print TMPFILE "$host lsws.php_waitque_depth $php_waitque_dep​


            this should resolve your issue

            Comment

            Working...