locked
MOM to Ops Manager Upgrade - Scripting Question RRS feed

  • Question

  • Hi,
    Were migrating from MOM 2005 to Ops Mgr 2007. We have a VB script running in response to a security log event. The script runs taking information from the event using "scriptcontext.event" (no parameters are passed to the script), e.g:-

    Set objEventIN = ScriptContext.Event
    userIDName = objEventIN.EventParameter(1)
    adminName = objEventIN.EventParameter(4)
    pwdResetDate = objEventIN.localtime

    The script performs various actions and then stores information in the OnePoint database e.g:-

     

    ‘Create the event

    Set objAgentEvent = ScriptContext.CreateEvent()

    'Set the message

    objAgentEvent.Message = strMessage

    objAgentEvent.EventSource = strSource

    objAgentEvent.EventNumber = intEventNumber

    objAgentEvent.EventType = intEventType

    'Submit the event

    Call ScriptContext.Submit(objAgentEvent)

    Set objAgentEvent = Nothing      

     

    I understand that ScriptContext is no longer available in Ops Mgr, does anyone know what the updated objects are to replace it.

     

    I’m not sure if I should be using “MOMDiscoverData” or “MOMPropertyBag” or something completely different.

     

    Just to be clear…to convert this script I need to find the replacement for ScriptContext.Event (and the ability to query the eventparamaters), and the replacement for ScriptContext.CreateEvent() so the items can be stored in the OperationsManager database.

     

    Thanks

     

    Darren

    Wednesday, November 11, 2009 4:28 PM

Answers

  • You cannot do this the way you used to do it.  What you can do is have the script collect the event (fire in response to the event) and output event data type.  This then would be re-composed as a data source, producing event data and fed back into an event collection rule.

    There is no longer any onepoint database as well.

    So, yes.  It can be done.  It is tricky, expert level MP composition and scripting.  This is why I suggest you hire someone to help in your migration who can also impart the know-how so you can take this on yourself.

    You may want to look at authormps.com as well to start to get an idea of what development for an operations manager management pack entails.  You can do nearly anything you can think of from an operations manager pack - but sometimes it takes professional software development skills to do so.
    Microsoft Corporation
    Saturday, November 14, 2009 1:46 AM

All replies

  • The best path to moving from MOM 2005 to SCOM 2007 R2 is to look at what you are monitoring, and then for custom applications, learn to create the right management pack.

    For your scenario, it is pretty straightfoward to make a script run in response to an event in SCOM.  In your example, your script finishes off by logging another event.  If what you want your script to do is _alter_ the event that was being responded to and then store that, you can do that but this will take a compound workflow (event triggers script.  Script does stuff.  Script outputs property bag. Property bag gets mapped to event data by an event data mapper.  This becomes the data source for a collection rule.  Boom.  Done.

    The XML knowlege involved is a little deep - you may want to hire someone who has done this kind of design work before and have them teach you the ropes as they help with your conversion.

    Microsoft Corporation
    Friday, November 13, 2009 3:54 PM
  •  

    Thanks for the feedback. The script we run in response to an event evaluates a number of things before generating emails and updating the one point database.


    I don't need to create another event, just act on the one already raised and store the info in the DB, works fine in MOM.

    Currently we use ScriptContext, but this is no longer available in Ops Mgr 2007....is there a replacement for it that provides the same functionality?

    Friday, November 13, 2009 4:34 PM
  • You cannot do this the way you used to do it.  What you can do is have the script collect the event (fire in response to the event) and output event data type.  This then would be re-composed as a data source, producing event data and fed back into an event collection rule.

    There is no longer any onepoint database as well.

    So, yes.  It can be done.  It is tricky, expert level MP composition and scripting.  This is why I suggest you hire someone to help in your migration who can also impart the know-how so you can take this on yourself.

    You may want to look at authormps.com as well to start to get an idea of what development for an operations manager management pack entails.  You can do nearly anything you can think of from an operations manager pack - but sometimes it takes professional software development skills to do so.
    Microsoft Corporation
    Saturday, November 14, 2009 1:46 AM
  • No activity for 30 days, will close this thread, feel free to open it again.
    Anders Bengtsson | Microsoft MVP - Operations Manager | http://www.contoso.se
    Thursday, December 17, 2009 9:51 PM