How to use scripts in SCOM
Hello together, I am currently changing my current monitoring environment towards SCOM. Be that as it may I have some old scripts which I'll still need as they work in conjunction with some legacy applications I can't get rid of. I am using Batch files to read and pipe some information of this applications in a text file. If a value is written and/or read I am publishing an alert/warning using a console tool in my old monitoring system. On to my question: I would like to use these batch files as long as I haven't found the time to get rid of them. I want to run the scripts based on a 5 minute schedule and in case it is necessary I want to publish alerts/warnings in SCOM. Is there a console tool which I can use to create such "messages" or how you would do it? Regards, M.
November 14th, 2010 12:08pm

The most direct way would be to write a data source module (Management pack authoring in XML) that does what your batch commands used to do. Then you would use this data source module in a rule or monitor (depending on desired suppression behavior) and raise alerts. This is pretty deep stuff - so be warned there is a steep learning curve (think a few months) Another approach is to write a rule that does log file parsing. Your output from your batch file would have to be predictable, with one record per line. If there are multiple line types, that path won't work. Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
November 14th, 2010 2:08pm

Hello Dan, my idea was to write a VBS script that schedules the start of the batch files and "somehow" utilizes already existing funtions in SCOM. Would this be a way to go or am I to simple? M.
November 15th, 2010 10:31am

Hello Maik Is it possible to do this from VBScript directly? That way, within 1 VBScript we can instantion the MOMScriptAPI, do the "Test", pull back the return value and then raise an alert (if necessary) from the VBScript. It would be much neater than having VBScript fire off a batch file that pipes output to another file that the VBScript has to wait to be updated ... not very robust and likely to lead to missed events. Cheers GrahamView OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 10:51am

Hello Graham, so I can utilize / call SCOM internal APIs to pipe messages in the SCOM console? In case I decide this way, would it be necessary to copy the script locally to all servers or is SCOM "distributing" it? I may need to monitor about 20 system this way at the end and a manually process, especially in case of new versions, would be to painful... Regads, M.
November 15th, 2010 4:01pm

hi Ideally you would: - make whatever calls the batch file is doing within VBScript - create a group of servers that need the script - plug the VBScript into SCOM as a timed cooleciton rule or monitor, disabled the rule or monitor but then set an override to enable it for the group that contains the target servers The VBScript can contain the MOM calls that create alerts or collect data: http://blogs.technet.com/kevinholman/archive/2008/07/02/collecting-and-monitoring-information-from-wmi-as-performance-data.aspx http://blogs.technet.com/stefan_stranger/archive/2010/01/21/opsmgr-sql-full-or-differential-backup-check.aspx http://msdn.microsoft.com/en-us/library/bb437523.aspx It depends how comfortable you are with VBScript and scripting in general as to how complex this is plus of course, it depends how complex the batch file is. Cheers GrahamView OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
November 16th, 2010 6:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics