Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

Code Block
languagevb
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
languagevb
...
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:

...

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:

...

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.

...