ServiceMon Plugins

 

 

Designing ServiceMon plugins is very simple. Each plugin is a COM Object, and only needs to expose one method. Just register the object with Regsvr32.exe, then list it in the plugins.ini file. Read more below.

 

Methods

Your COM object must only support one method: CheckService. That's it.

When ServiceMon runs your plugin, it creates the object, then calls CheckService, passing in the host and the service name. The rest is up to you. The return value is expected to be a string. A value of "OK" signifies that everything is normal. Any other value tells ServiceMon that the string is the error code/description, and it should restart the service. Get this straight right away: Any other value besides "OK" (without the quotes) will cause ServiceMon to mark the service as FAILED and it will attempt to stop and restart it!

VB: string = object.CheckService ( strName, strHost )

C: lzStr = object.CheckService ( string svcName, string svcHost) 

If you return something other than "OK", whatever you return will be logged in the error log.

 

Plugins.ini

Just list your plugin with its library. For example, if you compile a library "MyPlugins", with a class "SMTPChecker", you would enter

PluginX=MyPlugins.SMTPChecker

into the INI file. Be sure you've registered your COM component first.

 

 

That's all there is to it! Drop me a line if you have any questions. I am currently working on a POP3 checker. Future versions of ServiceMon will also include the default "FailSvc" and "PassSvc" plugins, which automatically Fail and Pass a service, without actually doing any checking.