Ad Widget

Collapse

system.cpu.util not working on HPUX 11.23

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EricWebb
    Junior Member
    • Jan 2006
    • 11

    #1

    system.cpu.util not working on HPUX 11.23

    Hi guys,

    Hopefully you can tell me what I'm doing wrong -- I have self-compiled 1.1b5 agentd running on HP-UX 11.23 (1.1b6 server running on Linux). I am trying to add item "system.cpu.util" to my HP-UX host but after I define it and ensure it is set to active, its status is set to "Not supported". I also see this in the log file if I set debug to level 4. Browsing through the code, it looks like it is defined for HP-UX, so I would expect it to work.

    I have three items to test various formulations:
    system.cpu.util[]
    system.cpu.util[all,system,avg1]
    system.cpu.util[cpu0,user,avg1]

    Errors:
    006757:20060306:102511 Got line:system.cpu.util[]
    006757:20060306:102511 Sending back:ZBX_NOTSUPPORTED
    ...
    006760:20060306:102527 Got line:system.cpu.util[all,system,avg1]
    006760:20060306:102527 Sending back:ZBX_NOTSUPPORTED
    ...
    006758:20060306:102545 Got line:system.cpu.util[cpu0,user,avg1]
    006758:20060306:102545 Sending back:ZBX_NOTSUPPORTED

    Any ideas?
  • EricWebb
    Junior Member
    • Jan 2006
    • 11

    #2
    Took a few more minutes to look around... looks like src/libs/zbxsysinfo/hpux/cpu.c calls function get_stat() to read the contents of /tmp/zabbix_agentd.tmp, which should contain stats collected from src/zabbix_agent/stats.c and cpustat.c. The problem is that function collect_stats_cpustat() reads from /proc/stat.

    Does HP-UX support the /proc filesystem? I can't find anything on it if it does, and it isn't present on my systems.

    Is HP-UX-specific support not yet fully developed? Who from the Zabbix team could I work with to fill in the blanks?


    -E.

    Comment

    • fmtaylor2
      Member
      • May 2006
      • 66

      #3
      HPUX /proc filesystem

      According to the information at this link:



      No, hpux does not support the /proc filesystem. And since I don't do C there is not much I can do about it, but it seems that they have all the information available to fix the hpux issues in zabbix..........

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        I'll be happy to receive a patch supporting monitoring of CPU utilisation under HP-UX. Anyone?
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • mariedling
          Junior Member
          • May 2006
          • 1

          #5
          Here is how to make cpu stats work for HPUX

          Here is the diff file for: zabbix-1.1beta9/src/zabbix_agent/cpustat.c

          59,63d58
          < #ifdef HPUX
          < #include <sys/pstat.h>
          < #include <sys/dk.h>
          < #endif
          <
          311,319d305
          < #ifdef HPUX
          < struct pst_dynamic stats;
          < float mrtotal;
          <
          < pstat_getdynamic( &stats, sizeof( struct pst_dynamic ), 1, 0 );
          <
          < add_values_cpustat(now,stats.psd_cpu_time[CP_USER],stats.psd_cpu_time[CP_SYS],stats.psd_cpu_time[CP_NICE],stats.psd_cpu_time[CP_IDLE]);
          <
          < #else
          340d325
          < #endif

          And the patch for zabbix-1.1beta9/src/zabbix_agent/stats.c

          82d81
          < #ifndef HPUX
          85d83
          < #endif


          You also need to define HAVE_PROC_NET_DEV in the config.h file

          Comment

          • brassel
            Junior Member
            • Aug 2006
            • 1

            #6
            IS this patch working on zabbix 1.1.1 ?

            Hello I am new to zabbix and I try to install the agent on HPUX 11iv1 so I have just installed the pre-compiled agent but I can not graph the cpu usage.

            I have seen your patch description but is it working for the 1.1.1 agent version ?

            And has someone graphed the cpu use on HPUX ?

            Regards

            Claude


            Originally posted by mariedling
            Here is the diff file for: zabbix-1.1beta9/src/zabbix_agent/cpustat.c

            59,63d58
            < #ifdef HPUX
            < #include <sys/pstat.h>
            < #include <sys/dk.h>
            < #endif
            <
            311,319d305
            < #ifdef HPUX
            < struct pst_dynamic stats;
            < float mrtotal;
            <
            < pstat_getdynamic( &stats, sizeof( struct pst_dynamic ), 1, 0 );
            <
            < add_values_cpustat(now,stats.psd_cpu_time[CP_USER],stats.psd_cpu_time[CP_SYS],stats.psd_cpu_time[CP_NICE],stats.psd_cpu_time[CP_IDLE]);
            <
            < #else
            340d325
            < #endif

            And the patch for zabbix-1.1beta9/src/zabbix_agent/stats.c

            82d81
            < #ifndef HPUX
            85d83
            < #endif


            You also need to define HAVE_PROC_NET_DEV in the config.h file

            Comment

            • den_crane
              Senior Member
              • Feb 2006
              • 272

              #7
              Yes, I have graph: system.cpu.load[all,avg15]

              Code:
              $ ./zabbix_agentd -c zabbix_agentd.conf -p |grep cpu
              cpu[idle1]                                    [m|ZBX_NOTSUPPORTED]
              system.cpu.switches                           [m|ZBX_NOTSUPPORTED]
              system.cpu.intr                               [m|ZBX_NOTSUPPORTED]
              system.cpu.util[all,user,avg1]                [u|0]
              system.cpu.load[all,avg1]                     [d|0.006152]
              
              $ ./zabbix_agentd -c zabbix_agentd.conf -v
              ZABBIX Agent (daemon) v1.1.1 (19 July 2006)
              Compilation time:  Aug  2 2006 07:39:48
              
              $ uname -a
              HP-UX L2000CO2 B.11.11 U 9000/800 1166971547 unlimited-user license
              Code:
              $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,system,avg15]
              system.cpu.util[all,system,avg15]             [u|0]
              $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,user,avg15]
              system.cpu.util[all,user,avg15]               [u|28]
              $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,idle,avg15]
              system.cpu.util[all,idle,avg15]               [u|58]
              Last edited by den_crane; 18-01-2007, 10:56.

              Comment

              • den_crane
                Senior Member
                • Feb 2006
                • 272

                #8
                however [util system] - return wrong value


                Code:
                $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,system,avg5]
                system.cpu.util[all,system,avg5]              [u|0]
                $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,system,avg15]
                system.cpu.util[all,system,avg15]             [u|0]
                $ ./zabbix_agentd -c /etc/zabbix_agentd.conf -t system.cpu.util[all,system,avg15]
                system.cpu.util[all,system,avg15]             [u|0]
                
                $ sar 1 5
                
                13:57:43    %usr    %sys    %wio   %idle
                13:57:44      20      13      10      57
                13:57:45      15       3       5      77
                13:57:46      17      11      24      48
                13:57:47      18      11      23      48
                13:57:48      23       7      13      57
                
                Average       19       9      15      57
                may be it return not SYS but SSYS?

                Code:
                Load averages: 0.26, 0.31, 0.35
                264 processes: 254 sleeping, 10 running
                Cpu states:
                CPU   LOAD   USER   NICE    SYS   IDLE  BLOCK  SWAIT   INTR   SSYS
                 0    0.30  11.9%   0.0%   3.0%  85.1%   0.0%   0.0%   0.0%   0.0%
                 1    0.21  17.8%   0.0%   5.9%  76.2%   0.0%   0.0%   0.0%   0.0%
                ---   ----  -----  -----  -----  -----  -----  -----  -----  -----
                avg   0.26  15.0%   0.0%   4.0%  81.0%   0.0%   0.0%   0.0%   0.0%

                cpu.util user, cpu.util idle -- return right value.
                Last edited by den_crane; 18-01-2007, 12:51.

                Comment

                • arli
                  Member
                  • Jan 2008
                  • 71

                  #9
                  I dug up one old thread, because I believe issue discussed here, is still unresolved.
                  I can't get the cpu utilization monitoring to work on a multiprocessor HP-UX B.11.31 U ia64 system.
                  Total utilization displays fine, but if I want to graph it by core, it reports that half of the cpu's are idle, while they are not.
                  The client side is HP RX6600 with 4 dual core processors.
                  Both Zabbix Server and Agent are version 1.8.2.

                  Zabbix server is able to find all 8 cores:
                  Code:
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.num
                  8
                  Code:
                  CPU   LOAD   USER   NICE    SYS   IDLE  BLOCK  SWAIT   INTR   SSYS
                   0    1.15  61.6%  20.1%   3.4%  14.9%   0.0%   0.0%   0.0%   0.0%
                   2    1.53  75.1%   3.8%   3.4%  17.7%   0.0%   0.0%   0.0%   0.0%
                   4    1.52  69.6%  21.7%   3.8%   5.0%   0.0%   0.0%   0.0%   0.0%
                   6    1.51  82.9%   6.4%   4.2%   6.6%   0.0%   0.0%   0.0%   0.0%
                   8    1.34  82.7%   0.6%   3.6%  13.1%   0.0%   0.0%   0.0%   0.0%
                  10    1.22  78.1%   6.4%   3.0%  12.5%   0.0%   0.0%   0.0%   0.0%
                  12    1.23  62.6%  17.3%   4.4%  15.7%   0.0%   0.0%   0.0%   0.0%
                  14    1.17  54.3%  24.5%   4.2%  17.1%   0.0%   0.0%   0.0%   0.0%
                  ---   ----  -----  -----  -----  -----  -----  -----  -----  -----
                  avg   1.33  70.8%  12.7%   3.6%  12.9%   0.0%   0.0%   0.0%   0.0%
                  The utilization numbers here are not exactly the same because of human delay, but the general idea should stand out.
                  Code:
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[0,,]
                  70.417423
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[1,,]
                  0.000000
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[2,,]
                  85.233460
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[3,,]
                  0.000000
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[4,,]
                  84.339934
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[5,,]
                  0.000000
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[6,,]
                  78.993399
                  [root@monitoring ~]# zabbix_get -s myserver -k system.cpu.util[7,,]
                  0.000000
                  ...just in case, I also tried numbers up to 16, but everyting above 7 became ZBX_NOTSUPPORTED
                  Can someone please try this on HP-UX to confirm this behaviour.

                  Comment

                  Working...