no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | monitors:win_2003_dc_diags [2009/11/23 06:12] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== BBDcDiags ====== | ||
+ | |||
+ | ^ Author | [[ graeme@shea.com.au | Graeme Shea ]] | | ||
+ | ^ Compatibility | Xymon 4.2 | | ||
+ | ^ Requirements | dcdiags and netdiags from the windows support tools and a Xymon client| | ||
+ | ^ Download | None | | ||
+ | ^ Last Update | 2008-08-26 | | ||
+ | |||
+ | ===== Description ===== | ||
+ | Runs the support tools dcdiags.exe and netdiags.exe and reports the results to Big Brother or Xymon. These two tests are the basic tests to confirm the correct operation of Active Directory. | ||
+ | ===== Installation ===== | ||
+ | === Client side === | ||
+ | Save the script, dcdiags.exe and netdiags.exe into the same folder. Add a sceduled task to run the script as required at your site (once a day?). | ||
+ | |||
+ | Several errors have been hardcoded to be ignored. You may need to comment these out. | ||
+ | === Server side === | ||
+ | none | ||
+ | ===== Source ===== | ||
+ | ==== Monitor Code ==== | ||
+ | <hidden onHidden=" | ||
+ | < | ||
+ | Option Explicit | ||
+ | ' | ||
+ | ' Run DcDiag and NetDiag. Report result of tests to Big Brother. | ||
+ | ' save copy of output to current folder to help diagnose any errors. | ||
+ | ' 17/08/06 Graeme Shea | ||
+ | ' Added ignor of dc link test. 05/09/06 Graeme Shea | ||
+ | ' Fixed capialisation problem with ignore of dc link test. 07/09/06 Graeme Shea | ||
+ | ' V1.3 Added ignore of concerrent error msg with error of dc link test. 14/09/06 Graeme Shea | ||
+ | ' V1.4 Added ignore of WAN test. 1/10/06 Graeme Shea | ||
+ | ' V1.4.1 Added ignore of FRS events from previous 24hrs. 3/12/06 Graeme Shea | ||
+ | ' V1.4.2 Added ignore of a syslog event from previous 24hrs. 20/02 Graeme Shea | ||
+ | ' V1.5.0 BBWin compatable. 01/05/08 Graeme Shea | ||
+ | ' | ||
+ | |||
+ | Dim oShell, | ||
+ | Const Version = " | ||
+ | |||
+ | Set FSO= CreateObject(" | ||
+ | Set oShell = WScript.CreateObject(" | ||
+ | |||
+ | szDelay = " | ||
+ | |||
+ | szOutput = "" | ||
+ | |||
+ | ' Retrieve path to big brother log files | ||
+ | ExtPath = GetBigBrotherPath | ||
+ | on Error GoTo 0 | ||
+ | |||
+ | szResult = runoutput(" | ||
+ | szResult = lCase(szResult) | ||
+ | |||
+ | if instr(szResult, | ||
+ | 'If the FRS is not working now will still raise error. I'm not very concerned | ||
+ | ' if there was an error of some sort in the last 24hrs. | ||
+ | szResult = Replace (szResult, " | ||
+ | szResult = Replace (szResult, " | ||
+ | szOutPut = szOutPut & vbcrlf & "& | ||
+ | ' | ||
+ | |||
+ | end If | ||
+ | |||
+ | if instr(szResult, | ||
+ | 'If there are errors in the system log you have allready been advised | ||
+ | ' no need to have a red dot for the whole day. | ||
+ | szResult = Replace (szResult, " | ||
+ | szOutPut = szOutPut & vbcrlf & "& | ||
+ | ' | ||
+ | if instr(szResult, | ||
+ | ' | ||
+ | | ||
+ | szOutPut = szOutPut & vbcrlf & "& | ||
+ | end If | ||
+ | if instr(szResult, | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | szOutPut = szOutPut & vbcrlf & "& | ||
+ | end If | ||
+ | |||
+ | end If | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ' msgbox " | ||
+ | if instr(szResult, | ||
+ | | ||
+ | else szOutPut = szOutPut | ||
+ | end If | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | szResult = runoutput(" | ||
+ | szResult = lCase(szResult) | ||
+ | |||
+ | if instr(szResult, | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | | ||
+ | end If | ||
+ | |||
+ | if instr(szResult, | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | end If | ||
+ | |||
+ | if instr(szResult, | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | |||
+ | end If | ||
+ | |||
+ | if instr(szResult, | ||
+ | | ||
+ | | ||
+ | |||
+ | end If | ||
+ | |||
+ | if instr(szResult, | ||
+ | | ||
+ | else szOutPut = szOutPut & "& | ||
+ | end If | ||
+ | |||
+ | if instr(szOutPut, | ||
+ | | ||
+ | else szOutPut = " | ||
+ | end if | ||
+ | |||
+ | Set oFile = FSO.OpenTextFile(ExtPath &" | ||
+ | oFile.write(szOutput) | ||
+ | oFile.WriteBlankLines(2) | ||
+ | oFile.WriteLine " | ||
+ | oFile.close | ||
+ | |||
+ | |||
+ | Function RunOutput( cProgram, nWindowType, | ||
+ | ' Run a program and save results to szTempFileName | ||
+ | ' Got this routing of the net somewhere. Apologies to the orginal author | ||
+ | Dim oFS | ||
+ | Set oFS = CreateObject(" | ||
+ | Dim oShell | ||
+ | Set oShell = CreateObject( " | ||
+ | | ||
+ | Dim oFile | ||
+ | Set oFile = oFS.OpenTextFile(szTempFileName, | ||
+ | | ||
+ | | ||
+ | Set oShell = Nothing | ||
+ | End Function | ||
+ | |||
+ | function Convert2Text(sTemp) | ||
+ | ' Converts non printable characters to " " , so that Textfile is working | ||
+ | dim loopcount, tempwert, inttest | ||
+ | tempwert="" | ||
+ | for loopcount = 1 to len(sTemp) | ||
+ | inttest = ascw(mid(sTemp, | ||
+ | 'if ((inttest> | ||
+ | if ((inttest> | ||
+ | tempwert = tempwert & chr(inttest) | ||
+ | else | ||
+ | tempwert = tempwert & " " | ||
+ | end if | ||
+ | ' | ||
+ | next | ||
+ | Convert2Text = tempwert | ||
+ | end function | ||
+ | |||
+ | |||
+ | ' Get path to external log files (for BB 1.08d) | ||
+ | Function GetBigBrotherPath() | ||
+ | Dim ExtPath | ||
+ | On Error Resume Next | ||
+ | |||
+ | ExtPath = oShell.RegRead(" | ||
+ | If IsEmpty(ExtPath) Then | ||
+ | ExtPath = oShell.RegRead(" | ||
+ | End If | ||
+ | If Not IsEmpty (ExtPath) Then 'If not empty then we have 32bit machine | ||
+ | b64Bit = False | ||
+ | End If | ||
+ | If IsEmpty(ExtPath) Then | ||
+ | ExtPath = oShell.RegRead(" | ||
+ | End If | ||
+ | If IsEmpty(ExtPath) Then | ||
+ | ExtPath = oShell.RegRead(" | ||
+ | End If | ||
+ | |||
+ | If Not IsEmpty(ExtPath) And isEmpty(b64Bit) Then | ||
+ | b64Bit = True | ||
+ | err.clear | ||
+ | End If | ||
+ | |||
+ | If IsEmpty(ExtPath) Then | ||
+ | 'Put exit stuff here | ||
+ | End If | ||
+ | on Error GoTo 0 | ||
+ | GetBigBrotherPath = ExtPath | ||
+ | End Function | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Known Bugs and Issues ===== | ||
+ | |||
+ | ===== To Do ===== | ||
+ | |||
+ | ===== Credits ===== | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | * **2008-08-26** | ||
+ | * Initial release | ||