Advanced Windows Monitoring WMI, Powershell and VBscript        Yancy Ribbens        yribbens@nagios.org
Overview  Tips and techniques for writing plugins       Return Codes       VBScript       Powershell  Deploying and runnin...
Return Codes      http://nagiosplug.sourceforge.net/developer-guidelines.html                                     2012    ...
System Exit Codes                           Powershell                           $lastexitcode                            ...
Dissection of VB Script   CheckDC        VBScript for monitoring Domain Controller   Controlling Exit Code         wscript...
Running checkDCSuccess example :)    Fail example :(                      2012   6
Dissection of Powershell   check_windows_app_installs.ps1                    Write-Host "Program Files Counted: " -nonewli...
Details table                                                  Write-Host "Program Files Counted: " -nonewline            ...
Running plugins   NSClient++       Install clip   NRDS_Win       Install Clip                      2012   9
2012   10
[Section Break Title]
2012   12
Upcoming SlideShare
Loading in …5
×

Nagios Conference 2012 - Yancy Ribbens - Windows Advanced Monitoring with WMI and Scripting

1,173 views

Published on

Yancy Ribbens' presentation on using Nagios with WMI
The presentation was given during the Nagios World Conference North America held Sept 25-28th, 2012 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,173
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Nagios Conference 2012 - Yancy Ribbens - Windows Advanced Monitoring with WMI and Scripting

  1. 1. Advanced Windows Monitoring WMI, Powershell and VBscript Yancy Ribbens yribbens@nagios.org
  2. 2. Overview Tips and techniques for writing plugins Return Codes VBScript Powershell Deploying and running custom scripts NSClient++ NRDS_Win WMI system Configuring WMI Example queries 2012 2
  3. 3. Return Codes http://nagiosplug.sourceforge.net/developer-guidelines.html 2012 3
  4. 4. System Exit Codes Powershell $lastexitcode Command Shell (DOS) %errorlevel% 2012 4
  5. 5. Dissection of VB Script CheckDC VBScript for monitoring Domain Controller Controlling Exit Code wscript.quit( ExitCode ) if instr(msg,"CRITICAL") then msg1 = "CRITICAL - " wscript.echo msg1 & msg wscript.quit(intCritical) else msg1 = "OK - " wscript.echo msg1 & msg wscript.quit(intOK) end if 2012 5
  6. 6. Running checkDCSuccess example :) Fail example :( 2012 6
  7. 7. Dissection of Powershell check_windows_app_installs.ps1 Write-Host "Program Files Counted: " -nonewline $Total = $BaseLine.Length - 5 Write-Host $Total Write-Host "n" WriteList $Current ($Current.length - 2) exit 0 2012 7
  8. 8. Details table Write-Host "Program Files Counted: " -nonewline $Total = $BaseLine.Length - 5 Write-Host $TotalLong output split on “newline” character Write-Host "n"Appears in details WriteList $Current ($Current.length - 2) exit 0 2012 8
  9. 9. Running plugins NSClient++ Install clip NRDS_Win Install Clip 2012 9
  10. 10. 2012 10
  11. 11. [Section Break Title]
  12. 12. 2012 12

×