Ad Widget

Collapse

CPU Core monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bader97
    Junior Member
    • Nov 2020
    • 3

    #1

    CPU Core monitoring

    Hello.
    I am using a Zabbix server with a bunch of agents monitoring different servers (running latest version 5.2 for server and agents).
    I have run into a problem of one of my servers getting over 100% CPU utilization on 1 core but the rest are at about 15-20%, so my average would should up at about 40% which doesn't inform me when that spike happens.
    I am aware that there is a discovery rule "system.cpu.discovery" which would provide the 2 macros {#CPU.NUMBER} and {#CPU.STATUS}.
    Whenever I try to use the {#CPU.NUMBER} I am getting an error saying "Cannot evaluate expression: "Cannot evaluate function "<node-name>:system.cpu.util[{#CPU.NUMBER},system,avg1].last()": item is not supported.".
    I didn't find the system.cpu.discover item in any of the built-in templates for "Template OS Linux by Zabbix agent active" and "Template Module Linux CPU by Zabbix agent active". I tried adding it myself as a discovery rule but that didn't seem to do it.
    I may have misconfigured something in there. I tried adding the discovery rule to both templates and that did not get it working either.
    How I added it:

    Navigate to the Discovery link of the "Configuration > Templates" tab then fill out as follows.
    That still didn't resolve my issue (the node attempting the check uses the "Template OS Linux by Zabbix agent active" template which is linked to the "Template Module Linux CPU by Zabbix agent active" template.
    Any clues on how I can get this resolved? This would be of great assistance to me and would be greatly appreciated.
    Please let me know if you require any additional information.
    Thank you!
    Attached Files
  • Bader97
    Junior Member
    • Nov 2020
    • 3

    #2
    Ping.
    Anyone able to provide any insight on this?
    Thanks.

    Comment

    • guille.rodriguez
      Senior Member
      • Jun 2022
      • 114

      #3
      This week this need of monitoring every core of cpu appears in my work. This is how I solved.


      First in your Template Module Linux CPU by Zabbix agent (active) create a discovery rule with

      Name: CPU Threads Discovery
      Type: Zabbix Agent / Zabbix Agent Active (use the same as template uses)
      Key: system.cpu.num[online]
      Update interval: 1h

      Tab Preprocessing
      Javascript with
      Code:
      var arr = []; for (var i=0; i<parseInt(value); i++) { arr.push({"cpu_number":i}); }
      return JSON.stringify(arr);
      Tab LLD:
      LLD Macro: {#CPU.NUMBER} JSONPath: $.cpu_number

      Save this discovery rule.

      Now go to Item Prototypes and create one.

      Name: CPU {#CPU.NUMBER} utilization
      Type: Zabbix Agent / Zabbix Agent Active
      Key: system.cpu.util[{#CPU.NUMBER}]
      Type of information: Float
      Units: %

      Tab Tags:
      Tag Name: Application Tag Value: CPU

      Save this item prototype

      Create a Trigger prototype
      Name: CPU {#CPU.NUMBER}: High CPU usage over 5m
      Operational data: {ITEM.LASTVALUE}%
      Severity: Warning
      Expression:
      Code:
      min(/Template Module Linux CPU by Zabbix agent active/system.cpu.util[{#CPU.NUMBER}],5m)>80
      On tab dependencies, add a dependency for the general CPU warning of load (if all cpu is at high load, you might want to "hide" the warning of a single core cpu on full load.
      Dependency: Template Module Linux CPU by Zabbix agent active: High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m)


      Doing this way, you dont need to deploy any UserParameter, conf file, script on computers where zabbix-agent is installed. Just ensure to keep this discovery rule when you update the template when new version of template appears.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        But there is "system.cpu.discovery" specially for that.. https://www.zabbix.com/documentation...y/examples/cpu

        Comment


        • guille.rodriguez
          guille.rodriguez commented
          Editing a comment
          yeah, saw hours after post this message and doing "manually" XD
      Working...