Your SlideShare is downloading. ×
Nagios Conference 2012 - Yancy Ribbens - Windows Advanced Monitoring with WMI and Scripting
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

779

Published on

Yancy Ribbens' presentation on using Nagios with WMI …

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
779
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Advanced Windows Monitoring WMI, Powershell and VBscript Yancy Ribbens yribbens@nagios.org
  • 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. Return Codes http://nagiosplug.sourceforge.net/developer-guidelines.html 2012 3
  • 4. System Exit Codes Powershell $lastexitcode Command Shell (DOS) %errorlevel% 2012 4
  • 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. Running checkDCSuccess example :) Fail example :( 2012 6
  • 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. 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. Running plugins NSClient++ Install clip NRDS_Win Install Clip 2012 9
  • 10. 2012 10
  • 11. [Section Break Title]
  • 12. 2012 12

×