Random Project

Two more things

Good script seems to work!

However another couple of points:

1. The /nowarn option of w32tm.exe looks like it’s not supported in earlier versions of Windows including XP, but is supported in Vista,7, 2008 Server etc. So for these you need to remove this option from the following line, otherwise the script returns an error.

strCommand = “%SystemRoot%System32w32tm.exe /monitor /nowarn /computers:” & serverlist

2. Further to the points made abut the thresholds not working correctly, can I suggest you make the following change:

Change the statement

If result = “” Then
Err = 3
Status = “UNKNOWN”
ElseIf result > crit Then
Err = 2
status = “CRITICAL”
ElseIf result > warn Then
Err = 1
status = “WARNING”
Else
Err = 0
status = “OK”
End If

to the following:

If result = “” Then
Err = 3
Status = “UNKNOWN”
ElseIf abs(result) > abs(crit) Then
Err = 2
status = “CRITICAL”
ElseIf abs(result) > abs(warn) Then
Err = 1
status = “WARNING”
Else
Err = 0
status = “OK”
End If

Then it seems to work properly as far as I have tested it and you can supply the thresholds unsigned.

Regards
Phil