Ad Widget

Collapse

Zabbix agent2 high consumption of CPU when added log discovery rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezols
    Member
    • Dec 2021
    • 33

    #1

    Zabbix agent2 high consumption of CPU when added log discovery rule


    Good day Zabbix people!

    Could I ask your assistance/help with understanding what could be causing cpu load from zabbix agent2.

    OS - Ubuntu 22.04 LTS
    Zabbix server version - 6.4.0
    Zabbix agent2 version - 6.4.4

    CPU load appears when I add to host template with discovery rule:

    Discovery rule key:
    Code:
    system.run[find /folder/ \( -path '/xxx/xxx' -o -path '/yyy/yyyyyy' \) -prune -o -name '*.log' -print]
    Discover rule preprocessing:
    JavaScript:
    Code:
    var lld = [];
    var lines = value.split("\n");
    
    for (i = 0; i < lines.length; i++) {
      lld.push({
        "{#FILE}": lines[i],
        "{#NAME}": lines[i].split("/").pop().split(".").slice(0,-1).join(".").toUpperCase()
      });
    }
    
    return JSON.stringify(lld);
    Item prototype key:
    Code:
    logrt[{#FILE},(?!.*errors text|.*skip_import_errors)^.*(ERROR|error|errors$),,,skip]
    Trigger prototype key:
    Code:
    last(/xxx APP LOGS/logrt[{#FILE},(?!.*errors text|.*skip_import_errors)^.*(ERROR|error|errors$),,,skip])<>0

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Testing:
    Launching discover rule system.run command finds the logs:

    testing preprocessing script:


    Logs are discovered, added to zabbix and triggers working, i just don't understand whats causing 100% load on cpu from zabbix-agent2.
    What additional information i should provide to shed some light on this?


    ​​
Working...