Ad Widget

Collapse

data collect mechanism for cpu and memory in linux server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluesky
    Junior Member
    • Jul 2016
    • 9

    #1

    data collect mechanism for cpu and memory in linux server

    I would like to know the zabbix agent data collection mechanism.
    I need to know what is the actual command zabbix use for cpu and memory usage metrics.
    For example,
    (1) if cpu utilization, the zabbix item is like 'system.cpu.util[ system or user,etc.]. How zabbix gets the value?

    Does zabbix piggy-backing on another data gathering mechanism like the “sar” command / “sysstat” package? or other system command?
    (2) How about memory usage? what actual command zabbix use to get the value for the vm.memory.size[pused] on linux.

    Thank you,
  • bluesky
    Junior Member
    • Jul 2016
    • 9

    #2
    I can guess maybe cpu collector use Linux TOP command, but I am not sure..
    PLEASE help, thank you
    Last edited by bluesky; 29-07-2019, 13:52.

    Comment

    • bluesky
      Junior Member
      • Jul 2016
      • 9

      #3
      Thank you, splitek,
      Can you please let me know where and how to get the agent source codes? Thanks

      Comment

      • bluesky
        Junior Member
        • Jul 2016
        • 9

        #4
        I have looked at the source codes but hard to find the code which actually describes how zabbix agent calculate the cpu utilization. There are some system.cpu.util but it points to other codes and there are bunch of counters...so hard to figure it out....
        Can someone please let me know what are the data collect details(mechanism or methods) for cpu and memory utilization?

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          (1)
          Information in file /proc/stat is referenced. Zabbix agent periodically refers to this file and stores the value in memory. When a request for getting the item value is received from the Zabbix server, it seems that the value of the item is returned after calculating how much processing of the type specified in the parameter has been executed.

          source file: src/zabbix_agent/cpustat.c

          (2)
          Information in the file /proc/meminfo and sysinfo() of the system call are referenced. If the mode is pused, it is calculated using the total memory value and the free memory value.

          source file: src/libs/zbxsysinfo/linux/memory.c

          Comment

          • bluesky
            Junior Member
            • Jul 2016
            • 9

            #6
            Atsushi, thank you so much...

            Comment

            Working...