Ad Widget

Collapse

Remote command failed. Unknow metric system.run

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zabbix_Julian
    Junior Member
    • Jul 2022
    • 25

    #1

    Remote command failed. Unknow metric system.run

    Hello all,

    I just created a script, what should restart a windows service when the trigger "High memory utilization" start.
    If I test it, I receive the error "unknown metric syste.run". I already enabled the AllowKey in the Agent conf on both servers (zabbix host and windows host) but I unfortunately receive the error.
    Click image for larger version

Name:	image.png
Views:	8598
Size:	19.2 KB
ID:	458230
    I also tried this two things:
    1. I created a powershell script and saved it under "C:\zabbix-agent-scripts\RestartServiceNWS01.ps1", after that I created a Trigger action what will run this script, same error.

    2. I created a script in zabbix (Administration -> Scripts) with the command "net stop example.service && net start example.service". I also added this to the agent config file (AllowKey=system.run[C:\Windows\System32\net stop example.service && net start example.service*"]) but still receive the same error.​

    Here is a screenshot from the zabbix server conf:
    Click image for larger version

Name:	image.png
Views:	8495
Size:	40.8 KB
ID:	458231

    Here is a screenshot from the windows server agent conf.
    Click image for larger version

Name:	image.png
Views:	8473
Size:	63.5 KB
ID:	458232


    I thought it also should work without any changes in the conf files since they write "If no AllowKey or DenyKey rules defined, all keys are allowed".​​

    Thanks in advance.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    What is the server and agent version?

    Comment

    • Zabbix_Julian
      Junior Member
      • Jul 2022
      • 25

      #3
      Hi Hamardaban, both are running on version 6.2.1.

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        Please show a screenshots of the settings of this remote command (action & operations tab)

        Comment

        • Zabbix_Julian
          Junior Member
          • Jul 2022
          • 25

          #5
          Sure, here are the infos from the "Action"



          and the script is a simple simple net stop and start to restart the Service:
          net stop example.service && net start example.service
          ​​

          Comment


          • Hamardaban
            Hamardaban commented
            Editing a comment
            instead of pictures - empty white squares... ok - rectangles
        • Zabbix_Julian
          Junior Member
          • Jul 2022
          • 25

          #6
          Hi, what do you mean? You can tsee the screenthos?

          Lets try it again:
          Click image for larger version

Name:	image.png
Views:	8232
Size:	32.9 KB
ID:	458317



          Click image for larger version

Name:	image.png
Views:	8214
Size:	56.0 KB
ID:	458318

          Comment

          • Hamardaban
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2019
            • 2713

            #7
            try in operations options

            Click image for larger version  Name:	z1.png Views:	0 Size:	7.0 KB ID:	458321

            and check that you are editing the action for triggers (not for discovery or autoreg ).

            Comment

            • Zabbix_Julian
              Junior Member
              • Jul 2022
              • 25

              #8
              Thank you verry much! I added the Host but forgot the mark on "Current host". It works now, thank you!

              Comment

              Working...