Cameron's profileCameron Fuller’s T2R2PhotosBlogLists Tools Help

Blog


    October 26

    Monitoring a process with OpsMgr

    Monitoring a process with OpsMgr

     

    We had a multiple environments where we needed to know if a process (not a service) was running on a system. If you want to be alerted when a service is unavailable, this can be done by using the Windows Service Management Pack Template (Authoring -> Management Pack Templates -> Windows Service). Or it can be done through creating a custom monitor for the service. (For details on that you can read the upcoming Microsoft Systems Center Operations Manager 2007 Unleashed book – yes, that was a shameless self-serving book plug, but it is really covered well there J ).

     

    This is common for functions like batch processes which often run logged in to a console as a specific user and launched via a shortcut on the desktop. I created a custom management pack which provides alerts when a process is not running an acceptable number of process name you specify. The Process Monitor provides alerting if a process specified is not running within an acceptable range. IE: Is MyBigCustomerApp.exe is not running at least once on this server create a critical alert. If MyBigCustomerApp.exe is running too many times send a warning alert.

     

    The management pack is available for download at: http://systemcenterforum.org/wp-content/uploads/ProcessMonitor.zip

     

    PLEASE NOTE: This monitor disabled by default and is designed to be disabled. If you enable the monitor with the default configuration it will alert on every server because either too many or too few svchost.exe’s are running on the system so don’t enable the monitor.

    The functionality in this monitor is activated on a per-server basis through overrides, and the acceptable number of processes and the name are specified on the parameters for the monitor.

    To activate this on a server, create the override for the System Center Managed Computer (Any OS) version of the ProcessMonitor. This override needs to enable the server and needs to specify the parameters for the process to monitor. As an example:

     

    Enable the override – set the Enabled parameter to True

    Specify the parameters - the name of the exe and then a space and the lower acceptable value and upper acceptable value.

     

    Example: For Server1 we enable the override parameter to True, and specify the parameters to svcmon.exe 1 2.

     

    This says for the Server1 system to activate this rule, and alert if there is less than 1 svcmon.exe running on the system or if there are greater than 2 svcmon.exe running on the system.

     

    Finally, within the script which is run as part of this monitor there are a variety of lines which are commented. These are used to create events in the event log to assist with script debugging. So if you activate this with an override for a server and want to see what steps are occurring with the script you can make this occur through uncommenting the lines such as:

     

    '     Set objShell = Wscript.CreateObject("Wscript.Shell")

    '     objShell.LogEvent EVENT_TYPE_SUCCESS, _

    '     "ProcessMonitor run with " & strProcess & " " & GoodLowerCount & " " & GoodUpperCount & " as arguments."

     

    within the script. This monitor can also be enhanced by creating a diagnostic and/or a recovery. This could be used as an example to restart a process which is not running or to stop a process which is running too many times on a system.

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    Cameron Fuller has turned off comments on this page.

    Trackbacks (1)

    The trackback URL for this entry is:
    http://cameronfuller.spaces.live.com/blog/cns!A231E4EB0417CB76!1039.trak
    Weblogs that reference this entry