Policy Development

You can utilize the scripts below to customize policies.  There's quite a bit of confusion about how to use VBScripts in LogFile monitors, see the description of latest.vbs for syntax tips and tricks.

The Tools

Tool Name Description
ListEvents.zip Updated to version 1.1, allowing for extracts from multi-resource-dll event log sources.  Extracts all possible Windows Event Log entries for a given event log source, and formats the data in a policy stream that can be imported directly into OVOW using ImportPolicies.exe.  See the enclosed document for how to use.
TidyScript.zip Test your multi-source Measurement Threshold policies with this simulator.   This tool simulates the script hosting environment of the Operations Agent, and ensures that the scripts will run as expected.
HungProcess.zip Command Line tool to detect hung processes ("not responding" in Task Manager).  If a hung process is detected, an OpenView message (opcmsg) is generated.   Can be used in a scheduled task policy, or as a tool.   The tool requires the .net runtime 1.1.
ShareMapper.zip Command Line tool to probe remote windows shares and obtain performance information about the connection throughput and latency.   Generates an OpenView message (opcmsg) if a share isn't available, or if the performance metrics returned violate a configurable threshold.  Requires the .NET runtime 1.1 with Service Pack 1
SQLLogMonitor.zip Command Line tool to connect to Microsoft SQL Server instances and gather the SQL Log Entries.   This tool can connect to any SQL Instance, local or remote.   All messages are dumped to the OpCMsg Inteceptor for post-processing.  Your work:  Build the OpCMsg policy to categorize and filter the messages (it can be verbose!).
Syntax:  SqlLogMonitor.exe <servername[\instance]>

Example:  SQLLogMonitor.exe LUVIE\OVOPS will connect to the instance OVOPS on server LUVIE, and dump the current SQL Log.   

The tool remembers what position of it's last log read - and starts then the next time it runs.  The position is stored in the registry.  This tool is designed to run as a Scheduled Task, as a user that has read/write access to the local registry and sufficient rights to read the SQL error log.  The tool *ONLY* uses windows-integrated security - therefore the windows identity of your scheduled task needs to equate to a user with the correct SQL rights to read the SQL Server log.

The EXE Requires .NET runtime 1.1 with Service Pack 1.

ClusterMon.zip Command line tool that retrieves MSCS cluster status from local or remote MSCS clusters.  The tool stores the state in a serialized data file which is then used during the second sample to determine when cluster resources change state and location.  All state/location changes are sent to OV Messages.  See the readme.rtf for message catalogs, pattern matches that will work with the messages, and usage information.

Version 1.1 adds message to the catalog for resource group moves.

The EXE Requires .NET runtime 1.1 with Service Pack 1.

The Scripts

These scripts MUST be run with cscript.exe to display properly.   To make cscript.exe your default script engine, run cscript.exe /h:cscript.

Download the scripts here: poldevscripts.zip

FileCount.vbs Get the count of files in a folder.  This is handy for policies where you may want to retrieve the count of files in a folder and alert on it. (Script will need to be modified to work within a policy, this is really more of a sample of the FileSystemObject for your use.)
DiskMonU.vbs Standalone vbscript that monitors Logical Disk space utilization.  It uses OpCMSG to send alerts back to the management server - so it can be run within the context of OVOW and OVOU as a "scheduled task".
snmp.vbs Shows how to use the olesnmp provider to retrieve snmp objects from a host.  This sample is for a LinkSys Wap11 (V1) - which is really an atmel access point (also works with certain d-links).  This can be modified to get any SNMP V1 object.
FileList.vbs and FileListExt.vbs Get a list of files in a directory.   This can be used in a log file monitor to retrieve the list of  files dynamically.   To use in a log file monitor, specify the source as <`cscript.exe //nologo c:\filelist.vbs "c:\temp\logfiles\test directory"`>   
You must put the command in the ` character, not the ' character, and if any of the paths have spaces they need to be in "".  Also, make sure you use //nologo so the cscript interpreter does not print out the "copyright" information.

FileListExt does the same thing, but limits the output to files with a given extension (specified in the script as strExtension, default is .txt)

dyndate.vbs Builds a log file name based on dynamic date.  Change the last format string to put the numbers in the format provided.  In your logfile policy, specify the source as  <`cscript.exe //nologo c:\dyndate.vbs "c:\temp\"`>   Try it out on the command line to get it right, then use it in the logfile policy.
OvExchStores.vbs Gets a list of exchange stores and their status (mounted/unmounted) for use in external monitors.  Works with E2K and E2K3