Changeset df0ab60 in nscp for modules/CheckWMI/CheckWMI.cpp
- Timestamp:
- 11/21/07 21:53:18 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 58a724d
- Parents:
- 5044c09
- File:
-
- 1 edited
-
modules/CheckWMI/CheckWMI.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckWMI/CheckWMI.cpp
receb8c7 rdf0ab60 155 155 unsigned int truncate = 0; 156 156 std::string query; 157 std::string aliasCol; 157 158 158 159 // Query=Select ... MaxWarn=5 MaxCrit=12 Check=Col1 --(later)-- Match==test Check=Col2 … … 163 164 MAP_OPTIONS_NUMERIC_ALL(tmpObject, "") 164 165 MAP_OPTIONS_STR("Alias", tmpObject.data) 166 MAP_OPTIONS_STR("AliasCol", aliasCol) 165 167 MAP_OPTIONS_STR("Query", query) 166 168 MAP_OPTIONS_BOOL_FALSE(IGNORE_PERFDATA, bPerfData) … … 199 201 } 200 202 } 201 } else { 202 for (WMIQuery::result_type::const_iterator citRow = rows.begin(); citRow != rows.end(); ++citRow) { 203 bool found = false; 204 for (WMIQuery::wmi_row::list_type::const_iterator citCol = (*citRow).results.begin(); citCol != (*citRow).results.end(); ++citCol) { 205 if ((*citCol).first == itm.data) { 206 found = true; 207 long long value = (*citCol).second.numeric; 208 itm.runCheck(value, returnCode, message, perf); 209 } 210 } 211 if (!found) { 212 NSC_LOG_ERROR_STD("Column: " + itm.data + " was not found!"); 203 } 204 } 205 for (WMIQuery::result_type::const_iterator citRow = rows.begin(); citRow != rows.end(); ++citRow) { 206 bool found = false; 207 std::string alias; 208 if (!aliasCol.empty()) { 209 alias = (*citRow).get(aliasCol).string; 210 } 211 for (WMIQuery::wmi_row::list_type::const_iterator citCol = (*citRow).results.begin(); citCol != (*citRow).results.end(); ++citCol) { 212 for (std::list<WMIConatiner>::const_iterator it = list.begin(); it != list.end(); ++it) { 213 WMIConatiner itm = (*it); 214 if (itm.data == "*") { 215 found = true; 216 } else if ((*citCol).first == itm.data) { 217 std::string oldAlias = itm.alias; 218 if (!alias.empty()) 219 itm.alias = alias + " " + itm.getAlias(); 220 found = true; 221 long long value = (*citCol).second.numeric; 222 itm.runCheck(value, returnCode, message, perf); 223 itm.alias = oldAlias; 213 224 } 214 225 } 226 } 227 if (!found) { 228 NSC_LOG_ERROR_STD("A column was not found!"); 215 229 } 216 230 }
Note: See TracChangeset
for help on using the changeset viewer.








