Contents
Table of Contents
Download Scriptomatic and locate the desired metric(s)
Scriptomatic is a Microsoft utility that allows you to create scripts that access the WMI counters built into Windows. You can get Scriptomatic from the Microsoft Download Center.
...
Once you have a script that successfully retrieves the required values, some changes will be needed to enable it to work with upUptime Infrastructure Monitor.time.
Allow Remote WMI Requests
The initial script should work for the local system but it may not work when retrieving values for your remote servers. The script can be placed on all the remote systems but this complicates the installation and setup process and also presents scaling issues. Making the small modifications described below will allow the script to retrieve metrics from your remote servers with a properly authenticated method.
...
Code Block | ||
---|---|---|
| ||
strComputer = WshSysEnv("UPTIME_HOSTNAME") strUser = WshSysEnv("UPTIME_USERNAME") strPassword = WshSysEnv("UPTIME_PASSWORD") Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer, _ "rootCIMV2", _ strUser, _ strPassword, _ "MS_409") objSWbemServices.Security_.ImpersonationLevel = 3 Set colItems = objSWbemServices.ExecQuery("SELECT * FROM Win32_PerfRawData_PerfOS_Memory ", _ "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) |
Since Because one of the “for loops” was removed, the outer “Next” will also need to be removed at the bottom of the script. Confirm that the script works properly before continuing to the next step.
...
Code Block | ||
---|---|---|
| ||
... WScript.Echo "UserName: " & objItem.UserName WScript.Echo Next Next Function WMIDateStringToDate(dtmDate) WScript.Echo dtm: WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _ Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _ & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2)) End Function |
Output Format
The up.time Uptime Infrastructure Monitor monitoring station expects to see data in the following format:
...
Code Block | ||
---|---|---|
| ||
WScript.Echo "AvailableBytes " & objItem.AvailableBytes WScript.Echo "AvailableKBytes " & objItem.AvailableKBytes WScript.Echo "AvailableMBytes " & objItem.AvailableMBytes |
...
Create and import the monitor UI
The monitor interface can be generated with the uptime Plug-In Monitor XML Generator. Please refer to Creating the XML definition for your plug-in service monitor for further assistance.
The final monitor can be imported by placing the XML file in the up.time Uptime Infrastructure Monitor directory and running the following commands on the command line:
> cd <uptime_dir>
> scripts\erdcloader -x <xml_filename>
...
Additional Step for Windows Monitoring Stations
If the up.time Uptime Infrastructure Monitor monitoring station is running on a Windows platform, the following steps will need to be implemented to allow the VB script to run properly.
...