How to send automatic powershell commands when certain alarms go off.

Started by brawlerbear5, January 29, 2019, 09:18:47 PM

Previous topic - Next topic

brawlerbear5

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!  :) :) :) :)

Tursiops

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