Changes between Version 4 and Version 5 of CheckWMI/CheckWMI


Ignore:
Timestamp:
09/20/09 16:20:32 (4 years ago)
Author:
mickem
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CheckWMI/CheckWMI

    v4 v5  
    6363 
    6464 
     65=== Using Query Alias === 
     66Adding query alias to the not very useful check above (Alias is '''cpu''') 
     67[[NSClientCommand(CheckWMI,MaxCrit=3 MinWarn=1 "Query:cpu=Select * from win32_Processor")]] 
     68[[NSClientResult(WARNING,WARNING:: cpu: 1 < warning,'cpu'=1;0;3;)]] 
     69[[NSClientConfig()]] 
    6570 
    66 Check to see that no CPU has less then 2.66GHz frequency 
    67 {{{ 
    68 CheckWMI MinCrit=1 MinWarn=1 "Query:load=Select CurrentClockSpeed from win32_Processor" +filter-numeric:CurrentClockSpeed=<2659 
    69 }}} 
     71=== Overriding Query Alias === 
     72Overriding the previous query alias with '''foobar''' 
     73[[NSClientCommand(CheckWMI,MaxCrit=3 MinWarn=1 "Query:cpu=Select * from win32_Processor" Alias=foobar)]] 
     74[[NSClientResult(WARNING,WARNING:: foobar: 1 < warning,'foobar'=1;0;3;)]] 
     75[[NSClientConfig()]] 
    7076 
     77=== Checking With filters === 
     78THis uses the UserAccount object to query if any enabled users have password expires set to false. 
     79[[NSClientCommand(CheckWMI,CheckWMI MaxCrit=3 MaxWarn=1 "Query:badUsers=Select Name, PasswordExpires, Disabled from Win32_UserAccount" "columnSyntax=%Name%" "columnSeparator= & " +filter-numeric:PasswordExpires==0 +filter-numeric:Disabled==0)]] 
     80[[NSClientResult(WARNING,WARNING:mickem & Xiqun Liao, badUsers: 2 > warning|'badUsers'=2;1;3;)]] 
     81[[NSClientConfig()]] 
     82 
     83=== Debbuging queries === 
    7184To try a query use the following syntax: 
    7285{{{ 
    7386nsclient++ CheckWMI Select * from win32_Processor 
    7487}}} 
    75  
    76 (I know these are not very usefull, but hopefully they will give you an idea how to do things, there a *a lot* of things to check via the WMI so you ought to be able to do most things you want.)