Does anyone know if the Failure Iterations are reset if the hostmonitor service crashes? I am guessing they will but would really like it if they didnt

Thanks
Harro
This option located on Preferences page in the Options dialog.Save tests and stats at midnight.
With this option selected HostMonitor will save test settings (if test list was modified) and statistical information (Alive%, Dead%, Total time and other counters) every midnight. Of course you may save modifications and statistics manually using menu File -> Save
Code: Select all
;-----------------------------------------------------------------------------
;- HostMonitor`s export/import file -
;- Generated by HostMonitor at 29/06/2008 15:12:11 -
;- Source file: C:\Program Files\HostMonitor6\KSHostmonitorConfig.hml -
;- Generation mode: Selected_Tests -
;-----------------------------------------------------------------------------
; ------- Test #01 -------
Method = Script
;--- Common properties ---
DestFolder = Root\[REMOVED]\
Title = [REMOVED] - Current Bandwidth Throttle
Comment =
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 900
Alerts =
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= No
UseCommonLog= No
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Script = '''****************************************************************************************************************
'* Summary: This script retrieves the current IIS Bandwidth Throttle Threshold Setting from the IIS *
'* Metabase for the specified server and then returns the value. *
'****************************************************************************************************************
'* Execution: Active Script Test Method Calls Script. *
'****************************************************************************************************************
Const statusOk = "Ok:"
Const statusWarning = "Warning:"
FUNCTION PerformTest()
On Error Resume Next
'Declare Variables.
DIM objVDir,intThrottle,objShell,strComputer
'Specifies name or IP Address of computer to connect to.
strComputer = "[REMOVED]"
'Set objects to be used for retrieving data.
Set objShell = CreateObject("WScript.Shell")
Set objVDir = GetObject("IIS://" & strComputer & "/W3svc/128298489")
'Set variables to zero / blank.
intThrottle = 0
'Retrieve current throttle setting in bytes and divide by 1024 to convert to KB/s.
intThrottle = objVDir.MaxBandwidth / 1024
'Check whether the current throttle is set below 1200KB/s and return a warning status if true.
IF intThrottle < 1200 Then
PerformTest = statusWarning & intThrottle & " KB/s"
'wScript.Echo "Status: WARNING - " & intThrottle & " KB/s"
ELSE
PerformTest = statusOk & intThrottle & " KB/s"
'wScript.Echo "Status: OK - " & intThrottle & " KB/s"
END IF
'Clean up.
Set objShell = nothing
Set objVDir = nothing
END FUNCTION
Language = VBScript
Timeout = 10000
AllowUI = No
UseMacros = No
; ------- Test #02 -------
Method = Script
;--- Common properties ---
DestFolder = Root\[REMOVED]\
RMAgent = RMA_1
Title = [REMOVED] - Current Player Bandwidth
Comment =
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 60
Alerts =
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= No
UseCommonLog= No
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Script = '''****************************************************************************************************************
'* Summary: This Script checks the current bytes being sent on a patch server and current number of *
'* users connected then retrieves the current patch throttle setting and calculates results *
'* to provides a report for the average bandwidth currently being used per a player and *
'* average maximum bandwidth obtainable per a player. *
'****************************************************************************************************************
'* Execution: CScript Hostmonitor_[REMOVED].vbs *
'****************************************************************************************************************
Const statusDead = "No answer:"
Const statusOk = "Ok:"
Const statusBad = "Bad:"
Const statusWarning = "Warning:"
FUNCTION PerformTest()
On Error Resume Next
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= START OF SCRIPT ="
wScript.Echo "====================================="
wScript.Echo " "
'Declare variables.
Dim objShell,objMetabase,objWMIService,strComputer,intLoop1,intTotalBytes,intAvgBytes,intUsedBytes,objWMINetInt,objWMIWebSrv,intCurrentUsers,intTotalUsers,intAvgUsers,intAvailBytes,intThrottle
Set objShell = CreateObject("WScript.Shell")
'Set variables to zero / blank or specific value.
intLoop1 = 0 'variable to hold the loop count value.
intCurrentUsers = 0 'variable to hold the current number of users connected.
intTotalUsers = 0 'variable to hold the total number of users connected.
intAvgUsers = 0 'variable to hold the average number of users connected after being calculated.
intThrottle = 0 'variable to hold the current throttle setting within IIS.
intAvailBytes = 0 'variable to hold the number of bytes available per a player.
intTotalBytes = 0 'variable to hold the total number of bytes sent over the NIC.
intUsedBytes = 0 'variable to hold the average number of bytes currently being utilised by each player.
intAvgBytes = 0 'variable to hold the average number of bytes sent across the NIC.
intCurrBytes = 0 'variable to hold the current bytes being sent across the NIC.
strComputer = " " 'variable to hold the name of computer to be checked.
'Change target computer name or IP Address in variable below:
strComputer = "[REMOVED]"
'Sets the object for retrieving WMI data.
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Error checking.
IF Err.Number <> 0 Then
PerformTest = statusDead & Err.Description
'wScript.Echo "Status: DEAD - " & Err.Description
Err.Clear
wScript.Quit
END IF
'Sets object for the IIS Metabase for retrieving data.
set objMetabase = GetObject("IIS://" & strComputer & "/W3svc/128298489")
IF Err.Number <> 0 Then
PerformTest = statusDead & Err.Description
'wScript.Echo "Status: DEAD - " & Err.Description
Err.Clear
wScript.Quit
END IF
'Specifies which counters to poll data from.
Set objWMINetInt = objWMIService.Get("Win32_PerfFormattedData_Tcpip_NetworkInterface.Name='Broadcom NetXtreme Gigabit Ethernet - Packet Scheduler Miniport'")
Set objWMIWebSrv = objWMIService.Get("Win32_PerfRawData_W3SVC_WebService.Name='_TOTAL'")
'Perform an inital test for the Network Interface Bytes Sent Per Second.
objWMINetInt.Refresh_
intCurrBytes = objWMINetInt.BytesSentPerSec / 1024
objWMIWebSrv.Refresh_
intCurrentUsers = objWMIWebSrv.CurrentAnonymousUsers
'Set all variables to zero.
'Polls the relevant performance counters for data and loops ten times to create average reply values.
DO UNTIL intLoop1 = 10
objWMINetInt.Refresh_
objWMIWebSrv.Refresh_
intCurrBytes = objWMINetInt.BytesSentPerSec / 1024
intCurrentUsers = objWMIWebSrv.CurrentAnonymousUsers
intLoop1 = intLoop1 + 1
wScript.Echo "-------------------------------------"
wScript.Echo "| Loop Number: " & (INT(intLoop1)) & " |"
wScript.Echo "-------------------------------------"
'Calculates a running total for current users and bytes sent.
intTotalUsers = intTotalUsers + intCurrentUsers
intTotalBytes = intTotalBytes + intCurrBytes
wScript.Echo " "
wScript.Echo "Current Bytes Sent: " & (INT(intCurrBytes)) & " KB/s"
wScript.Echo "Total Bytes Sent: " & (INT(intTotalBytes)) & " KB/s"
wScript.Echo " "
wScript.Echo "Current Users: " & (INT(intCurrentUsers)) & " Players"
wScript.Echo "Total Users: " & (INT(intTotalUsers)) & " Players"
wScript.Echo " "
WScript.Sleep(1000)
LOOP
IF intTotalUsers > 0 then
'Retreives the current throttle limit from the IIS Metabase.
intThrottle = objMetabase.MaxBandwidth / 1024
'Calculates the average bytes being sent over the NIC.
intAvgBytes = intTotalBytes / 10
'Checks for potential divide by zero errors and corrects results.
IF intTotalUsers < 10 then
intTotalUsers = 10
End If
'Calculates the average number of users connected to the server.
intAvgUsers = intTotalUsers / 10
'Calculates the average number of bytes currently in use.
intUsedBytes = intAvgBytes / intAvgUsers
'Calculates the average available bytes that each player can acheive.
intAvailBytes = intThrottle / intAvgUsers
wScript.Echo "====================================="
wScript.Echo "= REPORT ="
wScript.Echo "====================================="
wScript.Echo " "
wScript.Echo "Current Throttle: " & (INT(intThrottle)) & " KB/s"
wScript.Echo "-------------------------------------"
wScript.Echo "Total Bytes Sent: " & (INT(intTotalBytes)) & " KB/s"
wScript.Echo "Average Bytes Sent: " & (INT(intAvgBytes)) & " KB/s"
wScript.Echo "Used Bytes: " & (INT(intUsedBytes)) & " KB/s"
wScript.Echo "Available Bytes: " & (INT(intAvailBytes)) & " KB/s"
wScript.Echo "-------------------------------------"
wScript.Echo "Total Users: " & (INT(intTotalUsers)) & " Players"
wScript.Echo "Average Users: " & (INT(intAvgUsers)) & " Players"
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= RESULTS ="
wScript.Echo "====================================="
wScript.Echo " "
IF intUsedBytes > intAvailBytes then
intUsedBytes = intAvailBytes
END IF
IF intUsedBytes = intAvailBytes and intAvailBytes > 50 then
'Current bandwidth sent per a user is more than the allocated bandwidth per a user thus sets
'the test to a 'WARNING' state in KSHM and returns a reply value.
PerformTest = statusWarning & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: WARNING - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
ELSE IF intAvailBytes =< 50 then
'Current allocated bandwidth per a user is less than 30KB/s thus sets the test to a 'BAD' state
'in KSHM and returns a reply value.
PerformTest = statusBad & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: BAD - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
ELSE
'Current bandwidth sent per a user is less than the allocated bandwidth per a user thus sets
'the test to a 'OK' state in KSHM and returns a reply value.
PerformTest = statusOk & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: OK - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
END IF
END IF
ELSE
'There are no users currently connected or patching from the server thus sets the test to an 'OK' state
'and returns the reply value 'No Users'.
PerformTest = statusOk & "No Users"
'wScript.Echo "Status: OK - " & "No Users"
END IF
'Clean up.
Set objShell = nothing
Set objWMIService = nothing
Set objWMINetInt = nothing
Set objWMIWebSrv = nothing
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= END OF SCRIPT ="
wScript.Echo "====================================="
wScript.Echo " "
END FUNCTION
Language = VBScript
Timeout = 10000
AllowUI = No
UseMacros = No
;-----------------------------------------------------------------------------
; Exported 2 items
Code: Select all
; ------- Test #02 -------
Method = Script
;--- Common properties ---
DestFolder = Root\[REMOVED]\
RMAgent = RMA_1
Title = [REMOVED] - Current Player Bandwidth
Comment =
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 60
Alerts =
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= No
UseCommonLog= No
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Script = '''****************************************************************************************************************
'* Summary: This Script checks the current bytes being sent on a patch server and current number of *
'* users connected then retrieves the current patch throttle setting and calculates results *
'* to provides a report for the average bandwidth currently being used per a player and *
'* average maximum bandwidth obtainable per a player. *
'****************************************************************************************************************
'* Execution: CScript Hostmonitor_[REMOVED].vbs *
'****************************************************************************************************************
Const statusDead = "No answer:"
Const statusOk = "Ok:"
Const statusBad = "Bad:"
Const statusWarning = "Warning:"
FUNCTION PerformTest()
On Error Resume Next
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= START OF SCRIPT ="
wScript.Echo "====================================="
wScript.Echo " "
'Declare variables.
Dim objShell,objMetabase,objWMIService,strComputer,intLoop1,intTotalBytes,intAvgBytes,intUsedBytes,objWMINetInt,objWMIWebSrv,intCurrentUsers,intTotalUsers,intAvgUsers,intAvailBytes,intThrottle
Set objShell = CreateObject("WScript.Shell")
'Set variables to zero / blank or specific value.
intLoop1 = 0 'variable to hold the loop count value.
intCurrentUsers = 0 'variable to hold the current number of users connected.
intTotalUsers = 0 'variable to hold the total number of users connected.
intAvgUsers = 0 'variable to hold the average number of users connected after being calculated.
intThrottle = 0 'variable to hold the current throttle setting within IIS.
intAvailBytes = 0 'variable to hold the number of bytes available per a player.
intTotalBytes = 0 'variable to hold the total number of bytes sent over the NIC.
intUsedBytes = 0 'variable to hold the average number of bytes currently being utilised by each player.
intAvgBytes = 0 'variable to hold the average number of bytes sent across the NIC.
intCurrBytes = 0 'variable to hold the current bytes being sent across the NIC.
strComputer = " " 'variable to hold the name of computer to be checked.
'Change target computer name or IP Address in variable below:
strComputer = "[REMOVED]"
'Sets the object for retrieving WMI data.
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Error checking.
IF Err.Number <> 0 Then
PerformTest = statusDead & Err.Description
'wScript.Echo "Status: DEAD - " & Err.Description
Err.Clear
wScript.Quit
END IF
'Sets object for the IIS Metabase for retrieving data.
set objMetabase = GetObject("IIS://" & strComputer & "/W3svc/128298489")
IF Err.Number <> 0 Then
PerformTest = statusDead & Err.Description
'wScript.Echo "Status: DEAD - " & Err.Description
Err.Clear
wScript.Quit
END IF
'Specifies which counters to poll data from.
Set objWMINetInt = objWMIService.Get("Win32_PerfFormattedData_Tcpip_NetworkInterface.Name='Broadcom NetXtreme Gigabit Ethernet - Packet Scheduler Miniport'")
Set objWMIWebSrv = objWMIService.Get("Win32_PerfRawData_W3SVC_WebService.Name='_TOTAL'")
'Perform an inital test for the Network Interface Bytes Sent Per Second.
objWMINetInt.Refresh_
intCurrBytes = objWMINetInt.BytesSentPerSec / 1024
objWMIWebSrv.Refresh_
intCurrentUsers = objWMIWebSrv.CurrentAnonymousUsers
'Set all variables to zero.
'Polls the relevant performance counters for data and loops ten times to create average reply values.
DO UNTIL intLoop1 = 10
objWMINetInt.Refresh_
objWMIWebSrv.Refresh_
intCurrBytes = objWMINetInt.BytesSentPerSec / 1024
intCurrentUsers = objWMIWebSrv.CurrentAnonymousUsers
intLoop1 = intLoop1 + 1
wScript.Echo "-------------------------------------"
wScript.Echo "| Loop Number: " & (INT(intLoop1)) & " |"
wScript.Echo "-------------------------------------"
'Calculates a running total for current users and bytes sent.
intTotalUsers = intTotalUsers + intCurrentUsers
intTotalBytes = intTotalBytes + intCurrBytes
wScript.Echo " "
wScript.Echo "Current Bytes Sent: " & (INT(intCurrBytes)) & " KB/s"
wScript.Echo "Total Bytes Sent: " & (INT(intTotalBytes)) & " KB/s"
wScript.Echo " "
wScript.Echo "Current Users: " & (INT(intCurrentUsers)) & " Players"
wScript.Echo "Total Users: " & (INT(intTotalUsers)) & " Players"
wScript.Echo " "
WScript.Sleep(1000)
LOOP
IF intTotalUsers > 0 then
'Retreives the current throttle limit from the IIS Metabase.
intThrottle = objMetabase.MaxBandwidth / 1024
'Calculates the average bytes being sent over the NIC.
intAvgBytes = intTotalBytes / 10
'Checks for potential divide by zero errors and corrects results.
IF intTotalUsers < 10 then
intTotalUsers = 10
End If
'Calculates the average number of users connected to the server.
intAvgUsers = intTotalUsers / 10
'Calculates the average number of bytes currently in use.
intUsedBytes = intAvgBytes / intAvgUsers
'Calculates the average available bytes that each player can acheive.
intAvailBytes = intThrottle / intAvgUsers
wScript.Echo "====================================="
wScript.Echo "= REPORT ="
wScript.Echo "====================================="
wScript.Echo " "
wScript.Echo "Current Throttle: " & (INT(intThrottle)) & " KB/s"
wScript.Echo "-------------------------------------"
wScript.Echo "Total Bytes Sent: " & (INT(intTotalBytes)) & " KB/s"
wScript.Echo "Average Bytes Sent: " & (INT(intAvgBytes)) & " KB/s"
wScript.Echo "Used Bytes: " & (INT(intUsedBytes)) & " KB/s"
wScript.Echo "Available Bytes: " & (INT(intAvailBytes)) & " KB/s"
wScript.Echo "-------------------------------------"
wScript.Echo "Total Users: " & (INT(intTotalUsers)) & " Players"
wScript.Echo "Average Users: " & (INT(intAvgUsers)) & " Players"
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= RESULTS ="
wScript.Echo "====================================="
wScript.Echo " "
IF intUsedBytes > intAvailBytes then
intUsedBytes = intAvailBytes
END IF
IF intUsedBytes = intAvailBytes and intAvailBytes > 50 then
'Current bandwidth sent per a user is more than the allocated bandwidth per a user thus sets
'the test to a 'WARNING' state in KSHM and returns a reply value.
PerformTest = statusWarning & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: WARNING - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
ELSE IF intAvailBytes =< 50 then
'Current allocated bandwidth per a user is less than 30KB/s thus sets the test to a 'BAD' state
'in KSHM and returns a reply value.
PerformTest = statusBad & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: BAD - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
ELSE
'Current bandwidth sent per a user is less than the allocated bandwidth per a user thus sets
'the test to a 'OK' state in KSHM and returns a reply value.
PerformTest = statusOk & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
'wScript.Echo "Status: OK - " & (INT(intUsedBytes)) & "KB/s" & " of " & (INT(intAvailBytes)) & "KB/s"
END IF
END IF
ELSE
'There are no users currently connected or patching from the server thus sets the test to an 'OK' state
'and returns the reply value 'No Users'.
PerformTest = statusOk & "No Users"
'wScript.Echo "Status: OK - " & "No Users"
END IF
'Clean up.
Set objShell = nothing
Set objWMIService = nothing
Set objWMINetInt = nothing
Set objWMIWebSrv = nothing
wScript.Echo " "
wScript.Echo "====================================="
wScript.Echo "= END OF SCRIPT ="
wScript.Echo "====================================="
wScript.Echo " "
END FUNCTION
Language = VBScript
Timeout = 10000
AllowUI = No
UseMacros = No
;-----------------------------------------------------------------------------
; Exported 2 items