CPU discovery

Yet another discovery method supported by the Zabbix agent is CPU discovery. It returns all CPUs (or cores) present on a system. Now that we know how to get the LLD JSON, we only need to know which item key is used to return CPU information—that's system.cpu.discovery. Run this on A test host:

$ zabbix_get -s 127.0.0.1 -k system.cpu.discovery | json_pp

For a single-core system, it will return this:

{ 
   data : [ 
      { 
         {#CPU.NUMBER} : 0, 
         {#CPU.STATUS} : online 
      } 
   ] 
} 

The CPU discovery returns two macros for each discovered CPU:

  • {#CPU.NUMBER} is a CPU number, as assigned by the system.
  • {#CPU.STATUS} tells us the CPU's status, again, according to the host system.

This can be used to monitor various states on individual CPUs and cores. If our application is supposed to utilize all cores evenly, it might be useful to know when the utilization is not even. Simple CPU utilization monitoring will return the average result across all CPUs, so a runaway process that consumes 100% of a single CPU on a quad-core system would only register as having 25% utilization. We might also want to know when a CPU is not online for some reason.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset