- Timestamp:
-
09/20/09 16:20:32 (4 years ago)
- Author:
-
mickem
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v4
|
v5
|
|
| 63 | 63 | |
| 64 | 64 | |
| | 65 | === Using Query Alias === |
| | 66 | Adding 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()]] |
| 65 | 70 | |
| 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 === |
| | 72 | Overriding 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()]] |
| 70 | 76 | |
| | 77 | === Checking With filters === |
| | 78 | THis 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 === |
| 71 | 84 | To try a query use the following syntax: |
| 72 | 85 | {{{ |
| 73 | 86 | nsclient++ CheckWMI Select * from win32_Processor |
| 74 | 87 | }}} |
| 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.) |
|
|