Ad Widget

Collapse

system.run Manual Host Action but fails in Trigger Action "Unknown metric system.run"

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mkhan2
    Junior Member
    • Nov 2025
    • 6

    #1

    system.run Manual Host Action but fails in Trigger Action "Unknown metric system.run"

    Hello everyone,

    I am running Zabbix 7.4 on Windows hosts using Zabbix Agent 2, and I’m facing an issue where the same system.run command works in Manual Host Action, but fails when executed through a Trigger Action.

    What works
    In my zabbix_agent2.conf, I have explicitly allowed the command:
    AllowKey=system.run[powershell.exe -Command "Restart-Service -Name 'service.service.service.exe' -Force"]
    To test, I created a manual host action (Alerts → Scripts → Scope: Manual host action) with:
    powershell.exe -Command "Restart-Service -Name 'Interflex.Workflow.Wakeup.exe' -Force"
    When I manually execute this from the host’s frontend:
    It works perfectly.
    The service restarts, no errors.

    What fails
    Using the same exact script inside an Action → Operations (trigger-based automatic action), Zabbix shows the following error:
    Unknown metric system.run
    Agent 2 starts without error when using only AllowKey with a specific command
    The manual execution confirms that the agent accepts this system.run key
    The trigger action fails every time

    Problem Summary
    The Zabbix Agent allows this specific system.run[...] command when run manually, but rejects the same command when called automatically by a Trigger Action.
    It looks like system.run is not treated the same way between:
    Manual host actions (works)
    Trigger actions (Unknown metric system.run)

    What I need help with
    Is this a known limitation or bug in Zabbix 7.4?
    Does Zabbix handle manual actions and trigger-based actions differently regarding system.run permissions or AllowKey validation?
    Is there some additional setting required for agent-initiated execution triggered from the server?

    System info
    Zabbix Server: 7.4
    Zabbix Agent: Zabbix Agent 2 (Windows)
    Windows Server 2019
    Single host test environment
    Any help, clarification, or confirmation would be greatly appreciated.
    Thank you!

    Click image for larger version

Name:	image.png
Views:	121
Size:	9.5 KB
ID:	508923
    Click image for larger version

Name:	image.png
Views:	80
Size:	44.8 KB
ID:	508924
    Click image for larger version

Name:	image.png
Views:	84
Size:	35.3 KB
ID:	508925
    Click image for larger version

Name:	image.png
Views:	79
Size:	5.9 KB
ID:	508926
    Click image for larger version

Name:	image.png
Views:	80
Size:	14.0 KB
ID:	508927

  • Answer selected by mkhan2 at 20-11-2025, 10:21.
    Andrejs Poddubņaks
    Junior Member
    • Nov 2025
    • 18

    Hi!

    This is not a bug, it’s how system.run + AllowKey work.
    Important note: manual scripts and trigger actions use different modes:
    - Manual action on host → Zabbix calls system.run[<command>] (wait mode)
    - Trigger operation action → Zabbix calls system.run[<command>,nowait] in the background
    In zabbix_agent2.conf, you have written:
    Code:
    AllowKey=system.run[powershell.exe -Command "Restart-Service -Name 'Interflex.Workflow.Wakeup.exe' -Force"]
    This only allows the option without nowait, i.e.:
    - system.run[powershell.exe … -Force] → allowed → manual action works
    - system.run[powershell.exe … -Force,nowait] → Does NOT match AllowKey → agent responds with Unknown metric system.run.

    How to solve the problem:
    Both versions (wait/nowait) of this command must be allowed (or a more general pattern must be specified):
    Code:
    AllowKey=system.run[powershell.exe -Command "Restart-Service -Name 'Interflex.Workflow.Wakeup.exe' -Force",*]
    or, if any PowerShell suits you:
    Code:
    AllowKey=system.run[powershell*]
    After making the change, don't forget to restart the agent service on this Windows host so that the new AllowKey is picked up.

    I hope it will help you.

    Comment


    • mkhan2
      mkhan2 commented
      Editing a comment
      Hi, Thank you so much buddy it actually resolved my issue <3 .
  • Viktors Fomics
    Member
    • Oct 2025
    • 42

    #2
    Hello

    According to the documentation (https://www.zabbix.com/documentation...estrict_checks):
    AllowKey=<pattern> - which checks are allowed; <pattern> is specified using a wildcard (*) expression
    Your configuration specifies it without the wildcard, while it is required to work correctly.

    Comment


    • mkhan2
      mkhan2 commented
      Editing a comment
      AllowKey=system.run[powershell.exe -Command "Restart-Service*"]

      I tried with this expression as well its still saying same
  • Andrejs Poddubņaks
    Junior Member
    • Nov 2025
    • 18

    #3
    Hi!

    This is not a bug, it’s how system.run + AllowKey work.
    Important note: manual scripts and trigger actions use different modes:
    - Manual action on host → Zabbix calls system.run[<command>] (wait mode)
    - Trigger operation action → Zabbix calls system.run[<command>,nowait] in the background
    In zabbix_agent2.conf, you have written:
    Code:
    AllowKey=system.run[powershell.exe -Command "Restart-Service -Name 'Interflex.Workflow.Wakeup.exe' -Force"]
    This only allows the option without nowait, i.e.:
    - system.run[powershell.exe … -Force] → allowed → manual action works
    - system.run[powershell.exe … -Force,nowait] → Does NOT match AllowKey → agent responds with Unknown metric system.run.

    How to solve the problem:
    Both versions (wait/nowait) of this command must be allowed (or a more general pattern must be specified):
    Code:
    AllowKey=system.run[powershell.exe -Command "Restart-Service -Name 'Interflex.Workflow.Wakeup.exe' -Force",*]
    or, if any PowerShell suits you:
    Code:
    AllowKey=system.run[powershell*]
    After making the change, don't forget to restart the agent service on this Windows host so that the new AllowKey is picked up.

    I hope it will help you.

    Comment


    • mkhan2
      mkhan2 commented
      Editing a comment
      Hi, Thank you so much buddy it actually resolved my issue <3 .
Working...