Author: MikeD Business_Intelligence@hotmail.com
Author notes: XiServiceMonitor_Guide.txt General guide for setting up and running the script.
Thread: Service Monitoring
Platform: Windows 2003 Should be backward & forward compatible as no specific 2003 inclusions were used.
Version: 0.1 Updates will be available on request or per any onsite modifications.
Code: XiServiceMonitor.pl Perl Script with embedded comments.
This Perl script will read a list of services to be monitored, and then attempt a restart on any stopped service(s).
If the failed service won’t restart - all services in the list will be stopped.
Note: The script should be able to handle any windows service monitoring by simply changing the list of services that is read in from the text file i.e. my requirement was to develop something for XI so the input file contains a list of all the BOE XI and EPM services.
I have included a command in the guide as to how to print out all the services running on your machine.
One cannot use the Description name that you see in the Services monitor.
By running the command mentioned, you can select which service name(s) to place in the list.
i.e. I have not tested this on any previous BO versions, but I did some offsite testing on a few DB2 and laptop services, which worked just fine, so it is proved to be flexible re any services.
The zip includes:
[list]
XiServiceMonitor_Guide.txt General guide for setting up and running the script.
XiServiceList.txt List of services to be monitored.
XiServiceMonitor.pl Perl Script with embedded comments.
XiServiceMonitor.log Example of logged actions.
Komodo_screenshot.rtf Screenshot for testing/running the script with Komodo - this IDE handles perl syntax and has smart prompts for errors etc.
[/list]
If you have the environment variables set as per the guide, you will be able to start the script by double clicking it - or running it via a DOS command window once you have set the directory path to the perl.exe i.e. c:\Perl\bin.
The loop is set via a sleep(300) cycle (5 minutes) - as per the embedded script comments - this can obviously be changed to a cycle of your own choosing.
At this point in time, I have yet to be able to get this script to run as a service
I have listed all the methods that I tried by including the relevant site links in the guide.
i.e. According to all my forum hopping, it apparently is possible, so hopefully if anyone here decides to use this and manages to get that right - please contact me
XiServiceMonitor.zip (170.0 KB)
MikeD (BOB member since 2002-06-18)