How to send automatic powershell commands when certain alarms go off.
-
Good Afternoon,
I am new to NetXMS so I am hoping someone can point me in the right direction, I would like to be able to lets say: Server-A has SQL process "a" running. If that process was to unexpected stop, the netxms agent would execute a power-shell command to restart that service as soon as that warning came out.
Thank You for any help in this matter in advance!

-
Hi,
If I understand correctly you want to monitor the state of MSSQL services (e.g. different instances) under Windows?
We use instance discovery for that. Agent List with List name System.Services.
An instance discovery filter script picks up any service that starts with "MSSQL$" in the name (excluding SQLEXPRESS) or is called "MSSQLSERVER" (default instance).
To restart the service if it fails, a threshold is triggered if the service is not running.
That threshold generates an event that in turn executes a Server Action via Event Processing Policies.
That action is a script (inside the NetXMS script library).
The script pulls out the service name from the parameters passed to it and executes a pre-configured action on the agent itself which effectively comes down to running "net start <servicename>".The restart part can obviously be used for any service, not just MSSQL.

Hope that helps get you started.
Cheers
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login