Kaseya Community

Passing machine ID to a script running on another machine

This question is answered

We manage a number of servers behind not-so-reliable ADSL and wireless/satellite connections. We want to know when they go down, but we don't always worry so much when the issue is simply an internet outage.

What I'm attempting to do is build a DB of server ids->external IP addresses. That was easy. Now when a server goes down, I'd like to run a script on our KServer to ping the IP of that external gateway, and only alert if that gateway is up. HOWEVER. I can't find any way of passing the ID of the machine triggering the alert to the machine which actually runs the script to check - the Kserver in this case. Can this be done?



[edited by: Greig McGill at 11:34 PM (GMT -7) on 10-10-2011] Changed to question.
Verified Answer
  • Sorry. It sounds like I misunderstood your question. You say, "it's that there doesn't seem to BE a variable for "machine which reported 'agent down' status." Maybe if you have your agent trigger an alert when it goes offline you can get the "machName" from the vAlert log? I understand and agree that sometimes it seems that one has to jump through a lot of hoops to do what ought to be a fairly simple thing.

All Replies
  • Did you want to alert if the gateway is up or down? Maybe you could setup a Ping monitor to a DynDns name (assuming the router or some machine on the network can register with dyndns)? Or maybe you'll have to create a seperate "ping" script for each of the sites that can go down and call the specific script for each server/system at that site when you detect it's down?

  • If you're using a VBScript to ping the machines you can certainly pass the machine name as an input parameter to the VBScript. If you're using a Kaseya script to ping the machines maybe you could pass the machine name in a global variable and then set it to Nothing or Null when the script is done?

  • @shankwc Yep, I could use ping monitors to alert on the gateway, but that's not what I'm trying to achieve. I'm monitoring the agent status, and if it is down for more than 2 minutes, I'd like to alert on that UNLESS the gateway for a site is down. Given that the agent reporting "down" status can't run a script, I want to determine whether to report or not based on whether the gateway for that agent is pingable. Your suggestion might work, but it seems a very convoluted way to solve what should be a simple problem. Something I find happens a lot with this framework. :( Thanks for the suggestion though, I'll keep it in reserve in case this can't be done.

    @zippo See explanation above, the problem isn't passing variables to scripts, it's that there doesn't seem to BE a variable for "machine which reported 'agent down' status".

  • Sorry. It sounds like I misunderstood your question. You say, "it's that there doesn't seem to BE a variable for "machine which reported 'agent down' status." Maybe if you have your agent trigger an alert when it goes offline you can get the "machName" from the vAlert log? I understand and agree that sometimes it seems that one has to jump through a lot of hoops to do what ought to be a fairly simple thing.

  • Hrm, that sounds like a promising approach! Certainly beats what I'm trying to do right now (parsing the alert email on a remote linux box, and scripting my logic to alert or not from there, thereby entirely bypassing Kaseya other than for the initial alert email). ;)