Q. Is there a way to restart a Windows service that is monitored with the NT Services probe?

A. If you are monitoring Windows services with the NT Services probe, you can use a command-line notifier to launch the SC.exe command-line utility to restart the service. SC.exe is a Windows system file found in the C:\Windows\System32 directory on Windows XP\2003, and in the Windows 2000 Server Resource Kit.

To configure the command-line notifier to restart a service:

1. Create a command (.CMD) file that contains the following command and save it to the C:\Program Files\InterMapper\InterMapper Settings\Tools folder on the InterMapper server.

NET USE \\%~1\IPC$ %~3 /USER:%~2
SC \\%~1 start %4

2. Configure a command-line notifier to restart a specific service:

In the Configure Notifier window, choose "Command Line" from the Notifier Type pop- up menu.

In the Command box, enter the command to be executed:

.CMD ${MESSAGE}, where .CMD is the name of the command file created in step 1.

Click the Edit Message button, and enter the following parameters in the Message box:

[user] [password] [service to restart]

Where [user] is a user with administrative permissions on the target machine, [password] is the password for the user account and [service to restart] is the specific service the command-line utility will restart.

Note: Do not substitute with an IP address. This parameter tells InterMapper to restart the service on the device that triggered the notification.

 3. Click OK .

4. In order to test the notifier, you will need to manually replace the macro in the Notifier Message box with a real address in order for the Test Notifier button to work. Alternatively, you can test the notifier by assigning it to a live device and manually stopping the specified service on the device in order to trigger the notification.

Note: Currently there is no automatic way to pass just the service name to a notifier, so the service name needs to be specified in the notifier definition. This means you will need a separate notifier for each service that you want to restart, and you would need to monitor only one service per device.