Ad Widget

Collapse

zabbix agent UserParameter item-key not shown in the logs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davama
    Junior Member
    • Oct 2019
    • 22

    #1

    zabbix agent UserParameter item-key not shown in the logs

    I am trying to add a new item-key to my agent config. Specifically rpm.check.sh.jbrain.server
    I have a working key and my new NOT working key:

    Code:
    UserParameter=rpm.check.sh.jbrain.server,grep -E 'sh-jbrain-server-' /tmp/shsolutions-pkgs-zabbix | sed 's/sh-jbrain-server-//g'
    UserParameter=tomcat.mem.leak.status,grep -E -A1 "$(date --date='yesterday' +'%Y-%m-%d')|$(date '+%Y-%m-%d')" /var/log/tomcat/engine.log | grep -B1 OutOfMemoryError| head -1 | wc -l
    When I test the item-key i get results back as expected from the `cmd`

    Code:
    zabbix_agentd -t rpm.check.sh.jbrain.server
    zabbix_agentd [28728]: Warning: both HostMetadata and HostMetadataItem defined, using [Jbrain-old-7]
    rpm.check.sh.jbrain.server [t|2.3.1.1-75]
    
    zabbix_agentd -t tomcat.mem.leak.status
    zabbix_agentd [29405]: Warning: both HostMetadata and HostMetadataItem defined, using [Jbrain-old-7]
    tomcat.mem.leak.status [t|0]
    I have no issues with seeing tomcat.mem.leak.status on my /var/log/zabbix/zabbix_agentd.log but I do not see rpm.check.sh.jbrain.server ... i cannot comprehend what I am doing wrong....

    Code:
    grep rpm.check.sh.jbrain.server /var/log/zabbix/zabbix_agentd.log | wc -l
    0
    grep tomcat.mem.leak.status /var/log/zabbix/zabbix_agentd.log | wc -l
    32
    Any input is much appreciated

    Using:
    CentOS Linux release 7.3.1611 (Core)
    zabbix-agent-5.0.0-0.2alpha2.el7.x86_64


    Thanks,
    Dave
  • davama
    Junior Member
    • Oct 2019
    • 22

    #2
    Thank you for the reply cyber

    Perhaps I was not clear.

    I am trying to have this item-key, rpm.check.sh.jbrain.server, appear in my zabbix server but I dont see it at all, not even in my "Latest Data" page for this host.
    I dont have any issues with the other one, tomcat.mem.leak.status, I can see the results the agent gives me. Whether 0 or 1 as expected. And I can see it fine on the Zabbix Server under "Latest Data".

    Here is my item-key defined in my zabbix server.

    Click image for larger version

Name:	screen_2021-05-14-08-54-45.png
Views:	346
Size:	73.7 KB
ID:	424645

    I could not understand why my other UserParameters would appear on Latest Data but not this new one I created.
    So after setting DebugLevel=5 I noticed that the agent was not even attempting to do a check on the item-key rpm.check.sh.jbrain.server . So that's why I was asking why the item-key was not even showing on the logs, which tells me that the agent was not even making the check. I even removed all my custom UserParameters and only left my rpm.check.sh.jbrain.server and nothing (╯°□°)╯︵ ┻━┻

    And I know it's not a permission issue:
    Code:
    su zabbix -s /bin/bash -c 'grep -E 'sh-jbrain-server-' /tmp/shsolutions-pkgs-zabbix | sed 's/sh-jbrain-server-//g''
    2.3.1.1-75
    Im at lost

    Thanks!

    Comment

    • davama
      Junior Member
      • Oct 2019
      • 22

      #3
      Sorry for the bump....just want to make sure it doesnt get lost in the void
      Please let me know if I am missing something.

      Thank you for the support!

      Comment

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

        #4
        Why should there be anything about those things in agent log at all, if everything is OK?
        I would look, why there is something about that tomcat.mem.leak.status at all...

        Comment

        Working...