Ad Widget

Collapse

Logging - Required server performance, new values per second

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #1

    Logging - Required server performance, new values per second

    Required server performance, new values per second
    system.run[script]

    Code:
    <?php
            chdir('/usr/local/share/zabbix');
    
            require_once "include/config.inc.php";
    
    
            $status=get_status();
    
            echo $status['qps_total'] . "\n";
    ?>
    Unofficial Zabbix Expert
    Blog, Corporate Site
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You can also run the following MySQL command

    Code:
    select count(*)/avg(delay) from items as i, hosts as h where i.hostid=h.hostid and h.status=0 and i.status=0 and h.available=1;
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • nelsonab
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2006
      • 1233

      #3
      Added a link in the wiki:

      http://www.zabbix.com/wiki/doku.php?id=howto:misc
      RHCE, author of zbxapi
      Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
      Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

      Comment

      • lauerdk
        Junior Member
        • Oct 2008
        • 6

        #4
        Solution to mysql4.1+(supports subqueries)

        This works in mysql 4.1+

        Code:
        SELECT sum(qps) AS qps 
          FROM (
            SELECT count(*),count(*)/i.delay as qps
              FROM items i,hosts h 
                WHERE i.status=0
                  AND i.hostid=h.hostid 
                  AND h.status=0
                GROUP BY i.type,i.delay
                ORDER BY i.type, i.delay
          ) as data;

        Comment

        • dawabz94
          Junior Member
          Zabbix Certified Specialist
          • Dec 2010
          • 2

          #5
          Originally posted by lauerdk
          This works in mysql 4.1+

          Code:
          SELECT sum(qps) AS qps 
            FROM (
              SELECT count(*),count(*)/i.delay as qps
                FROM items i,hosts h 
                  WHERE i.status=0
                    AND i.hostid=h.hostid 
                    AND h.status=0
                  GROUP BY i.type,i.delay
                  ORDER BY i.type, i.delay
            ) as data;
          Works perfectly on zabbix 1.8.4 / MySQL 5.0.51, thanks a lot !

          Comment

          Working...