Can The Dude 3.4 restart a windows service?

Subject says it all - I know I can monitor services by probing snmp but can I restart a Windows service if failed/off ?

I’ve done a search, high and low - any help is appreciated.

You can call an external at the time of notification and run a batch job or script that checks and tries to restart the service. You will need administrative access to start and stop scripts remotely.

You might want the batch job to try to start the service, wait and check to see if the service starts then and try a few times before it gives up and sends you an email (another cmd line program). Mainly you don’t want to get into a tight loop of some sort.

I would try to find one that has already been written and or pieces of it and improve on it. I couldn’t find a decent example quickly… You can pass the server name and the service name to your batch job so it shouldn’t be too hard as long as the device.name and device.service match or are close enough for you to add the correct string when executed.

I am fairly certain you already know this but I am including it just in case, in the dude click the notification panel and then click new, execute on server. Put the path to your batch file and the environment variables you want passed to your batch in the envrionment variables area. I have not personally done this so you might want to search execute server in the dude forum, execute server :slight_smile: wouldn’t we all love to!!

Anyhow here is a web site that lists a few tools that can do things remotely from a command line and some of their text…

http://www.cramsession.com/articles/get-article.asp?aid=858

You can use a few utilities from the NT Resource
Kit and the Supplement 2 Resource Kit to minimize the
damage and stop and start services remotely using a
batch file. A useful implementation of this would be
to give your help desk the ability to reset the spooler
on one of your print servers. I have provided an example
later in this document.

The two utilities are called SC.EXE from the resource
kit and NTSVC.EXE from Supplement 2 Resource Kit.

SC.exe is a tool that provides a way to communicate with
Service Controller (SERVICES.EXE) from the command prompt
to retrieve information about services. You can also use
it to control services from the command prompt.

Netsvc.exe is a new tool that also provides a way to remotely
start, stop, and query the status of services from the
command prompt. The usage of the command is as follows:

HTH,
SD