- Timestamp:
-
09/20/09 18:07:02 (4 years ago)
- Author:
-
mickem
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v6
|
v7
|
|
| 67 | 67 | === A sample query === |
| 68 | 68 | A not very useful check which serves to illustrate how to use the command. Check to see if there is 2 CPUs present (or cores) |
| | 69 | |
| 69 | 70 | [[NSClientCommand(CheckWMI,MaxCrit=3 MinWarn=1 "Query=Select * from win32_Processor")]] |
| 70 | 71 | [[NSClientResult(WARNING,WARNING:: 1 < warning,''=1;0;3;)]] |
| 71 | 72 | [[NSClientConfig()]] |
| 72 | 73 | |
| 73 | | |
| 74 | 74 | === Using Query Alias === |
| 75 | 75 | Adding query alias to the not very useful check above (Alias is '''cpu''') |
| | 76 | |
| 76 | 77 | [[NSClientCommand(CheckWMI,MaxCrit=3 MinWarn=1 "Query:cpu=Select * from win32_Processor")]] |
| 77 | 78 | [[NSClientResult(WARNING,WARNING:: cpu: 1 < warning,'cpu'=1;0;3;)]] |
| … |
… |
|
| 80 | 81 | === Overriding Query Alias === |
| 81 | 82 | Overriding the previous query alias with '''foobar''' |
| | 83 | |
| 82 | 84 | [[NSClientCommand(CheckWMI,MaxCrit=3 MinWarn=1 "Query:cpu=Select * from win32_Processor" Alias=foobar)]] |
| 83 | 85 | [[NSClientResult(WARNING,WARNING:: foobar: 1 < warning,'foobar'=1;0;3;)]] |
| … |
… |
|
| 85 | 87 | |
| 86 | 88 | === Checking With filters === |
| 87 | | THis uses the UserAccount object to query if any enabled users have password expires set to false. |
| | 89 | This uses the UserAccount object to query if any enabled users have password expires set to false. |
| | 90 | |
| 88 | 91 | [[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)]] |
| 89 | 92 | [[NSClientResult(WARNING,WARNING:mickem & Xiqun Liao, badUsers: 2 > warning|'badUsers'=2;1;3;)]] |
|
|