Jump to content

Run Monitor on one agent and execute script on different agent

Recommended Posts

Hello All-

We are trying to run a TCP port monitor on one of our external agents, we would like to execute a script to restart a service on a different internal agent when that monitor fails.  I reviewed the monitor configuration process and it appears that all of the monitor actions /alerts can only run on the local host/agent where the monitor is set.

I was wondering if we would be able to accomplish this either via a monitor + EDF or other solution.


I opened a ticket with support and currently do not have an answer that would work for us.  Any help or direction would be greatly appreciated.


Link to post
Share on other sites

Two different solutions for ya:

1) On the first agent, make the script set a location-edf (or client-edf). Then have a searchgroup filtered on whenever this location (or client) has the EDF ticked to start a script on the second agent (only). You could potentially mark the second agent with another EDF (or make it the probe/master and have it selected based on that). Or something non-scalable like specify the ID.

2) in the script you can just switch computers by changing the variable @computerid@ to the new ID. If you then also reload all variables in the script then most things like %computername% should then update. Any line after that will execute from the second agent. If you store the first agentID in something like @old_computerid@ then you can even switch back in the script.

You should go for option 2 here if you need speed, option 1 might take 30mins to kick in, but hey that could maybe work for another use-case.

Link to post
Share on other sites



thanks for the feedback. I will have to check and see if i can test this with a different type of monitor and script action in my dev environment to see if i get the desired results.  I have had very little luck in the past when attempting to run a script on one agent and expecting it to run something on a different agent in conjunction.  I have been forced to run separate scripts and timer to accomplish some tasks because of this.


If this allows me to change the computer id and manage the action on a different machine from one single agent, that would certainly resolve my issue.

Link to post
Share on other sites
  • 2 weeks later...

Braingears-  Thanks for the feedback.  I have been working with support to identify a way to accomplish this but have been told that the switching of computerid may not work as expected for the following reasons.


Server A is outside of the domain and there is no current admin account on that host that exists in Server B


When the script will try to execute the action, this will fail because the account (admin) used to execute does not exist on server B and thus will not have admin credentials.


I will try to post some screenshots of what the script steps would look like but it seems that i need to have some local account on the machines that can manage both devices.  We do not like to attach credentials in our shell commands so that is a challenge it seems.

Link to post
Share on other sites
  • 1 month later...

@mikey090tx If you didn't find an answer to this, on the client location for Server A you'll have to configure/use an account that has permissions to execute the commands on the other computer whether that's local or domain account.  Right click on Server A client location> open location> Passwords> configure with domain\user and pass for server B.  If non-domain joined then hostname\user.  This should allow you to execute the script from the originating server location.

Edited by networkguy
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...