Nagios Exchange
  • Home
  • Directory
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now

Plugins4379Themes and Skins11Addons732Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Installation Remotely deploy NRPE on Linux clients
RSS Feed
Newest Listings Updated Listings
Top Contributors
Julien DESMAREST (4)Davide Lemma (4)deskwork_itunes142 (4)Joerg Hoerter (3)TcoUpLoad (1)
See More
Newest Contributors
Community Member (51)Davide Lemma (4)Alarig Le Lay (1)Penn Rabb (1)Sean Falzon (1)
See More
Home > Mathieu St-Amour
MS

Mathieu St-Amour

@nagmon7

User Stats

Favorites0

Views

Projects0

No Projects Found
Active Directory (AD) Check

FsmoCheck bugfix found

When running the VB script, dcdiag /test:fsmocheck on long domain name, the vbscript get the result "passed test FsmoCheck" on multiple lines, and the script is getting a false error. For example: Running enterprise tests on : verylong.sub.topdomaine.com ------------------------------------ Starting test: FsmoCheck ......................... verylong.sub.topdomaine.com passed test FsmoCheck ------------------------------------ The FsmoCheck appears on the line after "passed test". The fix when a line end with "passed test", then add the next line at the end if this line. The code fix is available at: https://github.com/mst-amour/nagios/blob/main/check_ad.vbs Here is the updated function to update: -------------------------------- 'call dcdiag and parse the output sub exec(strCmd) 'Declare variables dim objShell : Set objShell = WScript.CreateObject("WScript.Shell") dim objExecObject, lineout, tmpline, tmpline_no_cr_lf, end_passed_str, tmpline_next lineout = "" 'Command line options we're using ' pt strCmd Set objExecObject = objShell.Exec(strCmd) 'Loop until end of output from dcdiag do While not objExecObject.StdOut.AtEndOfStream tmpline = lcase(objExecObject.StdOut.ReadLine()) tmpline_no_cr_lf = Replace(tmpline,chr(10),"") ' Newline tmpline_no_cr_lf = Replace(tmpline,chr(13),"") ' CR call parselang(tmpline_no_cr_lf) lineout = lineout + tmpline if (instr(tmpline_no_cr_lf, ".....")) then 'testresults start with a couple of dots, so lets reset the lineout buffer lineout= tmpline if (len(tmpline_no_cr_lf) > 13) then end_passed_str = Mid(tmpline_no_cr_lf, Len(tmpline_no_cr_lf) - 10, 11) if(StrComp(end_passed_str, "passed test") = 0) then tmpline_next = lcase(objExecObject.StdOut.ReadLine()) tmpline_next = Replace(tmpline_next,chr(10),"") ' Newline tmpline_next = Replace(tmpline_next,chr(13),"") ' CR tmpline_no_cr_lf = tmpline_no_cr_lf + tmpline_next end if end if end if if instr(tmpline_no_cr_lf, lcase(strOK)) then 'we have a strOK String which means we have reached the end of a result output (maybe on newline) call parse(tmpline_no_cr_lf) lineout = "" end if loop ' Catch the very last test (may be in the lineout buffer but not yet processed) if instr(lineout, lcase(strOK) & " test") OR instr(lineout, lcase(strNotOK) & " test") then 'we have a strOK String which means we have reached the end of a result output (maybe on newline) call parse(lineout) end if end sub

Reviewed 2 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks