Ad Widget

Collapse

start the service via system.run

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kamiloff7
    Junior Member
    • May 2024
    • 6

    #1

    start the service via system.run

    help a newbie pls. I configured an action that starts a windows service through a Zabbix agent 2.
    command script: system.run[powershell -Command Start-Service -Name 'ServiceName'] and second option system.run[sc start ServiceName]
    config zabbix : AllowKey=system.run[powershell -Command Start-Service -Name 'ServiceName'] and second option AllowKey=system.run[sc start ServiceName] and DenyKey=system.run[*]

    but the trigger can't start the service, error : Unknown metric system.run
  • Blevar
    Member
    • Jan 2025
    • 68

    #2
    Hi,
    Looks like you are denying all system.run keys.
    comment
    Code:
    # DenyKey=system.run[*]
    restart the agant and try again.

    Comment

    • kamiloff7
      Junior Member
      • May 2024
      • 6

      #3
      Originally posted by Blevar
      Hi,
      Looks like you are denying all system.run keys.
      comment
      Code:
      # DenyKey=system.run[*]
      restart the agant and try again.
      denykey and allowkey are combined so that it allows only a specific command.
      example:
      # AllowKey=system.run[echo hello]
      # DenyKey=system.run[*]
      In this case, only the echo hello command will be allowed, and all other commands through system.run will be blocked.

      Comment

      • kamiloff7
        Junior Member
        • May 2024
        • 6

        #4
        update:
        I found an error, it appears in the script in Zabbix, no need to write system.run

        Comment

        Working...