Ad Widget

Collapse

I can't seem to get a simple command to work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edlentz
    Member
    • Oct 2013
    • 31

    #1

    I can't seem to get a simple command to work

    have a version 6.4.7 server running and an Agent2 version 6.4.2 on a Centos machine. I can assign a generic linux template and I can get info just fine. What I am trying to do is have a minimalist template. Just monitoring a few services and the disk space used. For instance I have this key service.info[mariadb,status] to get the status of the DB. I get an error: cannot monitor metric "service.info[mariadb,status]": Unknown metric service.info from the agent log. When I try a zabbix_get command (zabbix_get -s xxx.xxx.xxx.xxx -p 10050 -k "service.info[mariadb,state]" I get : ZBX_NOTSUPPORTED: Unknown metric service.info If I run this from the cli on the host zabbix_agent2 -t "service.info[mariadb.service,state]" I also get the same error I got in the log file.

    Can someone help me out in getting this to work?
    Thanks
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    This is because the "service.info" key does not exist natively on Agent 6.4 for Linux systems.
    The "service.info" key is a Windows specific key.

    For Linux, I guess you must be looking to use the "systemd.unit.info" key.

    Comment

    • edlentz
      Member
      • Oct 2013
      • 31

      #3
      Thanks markfree for the reply. I could not get the systemd.unit.info to work but I did get some items using system.run[systemctl is-active httpd.service] to work to monitor the http service on a Centos system. I get active and inactive responses at the correct times. My issue now is getting a trigger to work. So I use this as the expression {MinimalTest:system.run[systemctl is-active httpd.service].str(inactive)}=1 where my template name is MinimalTest and I get this as an error Invalid parameter "/1/expression": incorrect expression starting from "{MinimalTest:system.run[systemctl is-active httpd.service].str("inactive")}=1" I have checked and rechecked my spelling, punctuation, the result as text from the item. This shouldn't be this hard should it?

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #4
        You appear to be using the old expression syntax.
        Check the documentation for the current syntax.
        Code:
        function(/host/key,parameter)

        Comment

        Working...