How to monitor a Windows Service

The aim is to trigger an action (e.g. sending an e-mail) if a Windows service like the NETx BMS Server stops working.

To monitor a Windows service, you can use third party tools. For simply sending an e-mail, you can also use a powershell commando.

  1. Open the Windows Services within the Windows control panel.
  2. Select the “[NXA] NETx.Voyager.BMS.Server.2.0” and open the property dialog
  3. Within the “Recovery” tab, you have to select “Run a program” for “First failure”.
  4. As program you have to enter “powershell” and as command line parameters: “Send-MailMessage -From "<your from address>" -To "<destination address>" -Subject "BMS Alarm" -Body "BMS Server stopped working" -SmtpServer <host or IP of your local SMTP server>