We are using classic monitoring to check that client servers are online (monitor - alerts - agent status). We have numerous clients that we only monitor their server, so no other on-site resources to rely on. These clients are often behind unreliable ADSL circuits, so it's a 50/550 call if it's the ADSL down or the server down, when an offline alert comes up. Also, these clients frequently aren't on a static IP and/or don't have any public-facing services to check.
So, I want to check if the client's Internet is down when a server goes offline. To this end I was going to use the alert to trigger an agent procedure which runs on OUR server & pings the client's public IP address to see if their 'net is down. clearly, if the ping fails it's either Internet or power, not necessarily a server failure.
I have store the client's public IP in a custom field to assist with this (we update the IP every 15 minutes by scheduled agent procedure -or we can just use the gateway Kaseya detects automatically, if we know the client is static).
The problem is, there is no way of passing the ID/Name of the agent that has gone offline to the agent procedure that does the ping check - hence the script doesn't know which of our 50+ monitored clients to check. It would be so much nicer if you could pass parameters to procedures !!
I realize I could probably use the ping check monitor and setup every client on OUR server, but that would be a crazy load we don't need to run 24/7.
I don't think I can use KNM either - since if the gateway is down (same box as the monitored server) we can't get KNM data from a server that isn't online :)
Has any bright spark found a work-around to this dilemma?
I could solve it with some external code - but looking for a solution that works "out of the box" without any third party hackery. I considered making a custom SQL query to return the list of currently offline servers, but feel that's going a bit extreme & also means that if >1 server is offline, you might get a bunch of ping results and end up with more confusion than you started with.
The variables #id# and #gr# can be passed to the agent procedure even though you are running this on the VSA , as it is the actual Offline machine that triggers the script , so kaseya does know whcih machine went offline
So if the procedure knows the #id# then using some SQL you can get it's Gateway IP Address etc. and then use your VSA to ping it.
I also have a slightly different variant of the above and use the Service Desk for this plus an agent procedure.
Basically if a machine goes offline I check what group etc it belonged to and then check the Kaseya DB to see if any other machines are Online in that same group and on the same subnet.
If there is I run a script on that online machine and get it to ping the offline one
If I get a response I update the Ticket and change the Subject to indicate the machine is actually running and it's just an agent issue
Same script also tries to do a remote restart of the agent.
I also note in 18.104.22.168 released last week they have resolved some oissie with agents incorrectly reporting as being offline
Thanks Paul. Yes, #id# works and helps us solve our issue.
Next issue is getting getvariable(sql view data) to return what we want. Hmm.
Whats the variable your looking for next ?
I might be able to help
Is it already in the database , or as you had suggested in your own SQL table ?
Got it working. Just a slightly unusual format required in the getvariable parameters.