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.
- Open the Windows Services within the Windows control panel.
- Select the “[NXA] NETx.Voyager.BMS.Server.2.0” and open the property dialog
- Within the “Recovery” tab, you have to select “Run a program” for “First failure”.
- 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>
Related articles