Ad Widget

Collapse

Trigger tag value inside a remote command script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shlomia
    Member
    • Jul 2020
    • 38

    #1

    Trigger tag value inside a remote command script?

    Hi, I'm trying to achieve the following scenario:
    I monitor the status of few Windows services and I would like to create an action script that will attempt to re-start the service that triggered the alarm.
    Now, I managed to create the script with the following remote command:
    Code:
    net start servicename
    Now, I don't want to create a different action for every service name so I was thinking about settings a tag on each trigger with the servicename and then set the name of the value in my remote command, For example:
    Code:
    net start service-name
    where service-name is a tag in my trigger with value of my actual service that I'm monitoring.
    I didn't find a way to do that..

    Thanks
  • shlomia
    Member
    • Jul 2020
    • 38

    #2
    Thanks but I still didn't get it to be honest..
    my trigger has a tag "service-name" with the value of the actual service name.
    then I go to my remote command and I type something like "sc start {service-name}" or something like that?

    thanks

    Comment

    • shlomia
      Member
      • Jul 2020
      • 38

      #3
      Found the solution thanks to a really nice guy in whatsapp.
      You should add for example a tag in your trigger "servicename = w32time"
      and then create action script with the following command:
      net start {EVENT.TAGS.service}

      Comment

      Working...