Changeset e380ffe in nscp
- Timestamp:
- 06/15/08 20:14:32 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 157dea5
- Parents:
- 782ac8e
- Files:
-
- 3 edited
-
include/checkHelpers.hpp (modified) (3 diffs)
-
modules/CheckDisk/CheckDisk.cpp (modified) (12 diffs)
-
modules/CheckDisk/CheckDisk.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
include/checkHelpers.hpp
rde8ef76 re380ffe 66 66 typedef enum {showLong, showShort, showProblems, showUnknown} showType; 67 67 template <class TContents> 68 struct CheckCon atiner {69 typedef CheckCon atiner<TContents> TThisType;68 struct CheckContainer { 69 typedef CheckContainer<TContents> TThisType; 70 70 TContents warn; 71 71 TContents crit; … … 77 77 78 78 79 CheckCon atiner() : show(showUnknown), perfData(true)79 CheckContainer() : show(showUnknown), perfData(true) 80 80 {} 81 CheckCon atiner(std::wstring data_, TContents warn_, TContents crit_)81 CheckContainer(std::wstring data_, TContents warn_, TContents crit_) 82 82 : data(data_), warn(warn_), crit(crit_), show(showUnknown) 83 83 {} 84 CheckCon atiner(std::wstring name_, std::wstring alias_, TContents warn_, TContents crit_)84 CheckContainer(std::wstring name_, std::wstring alias_, TContents warn_, TContents crit_) 85 85 : data(data_), alias(alias_), warn(warn_), crit(crit_), show(showUnknown) 86 86 {} 87 CheckCon atiner(const TThisType &other)87 CheckContainer(const TThisType &other) 88 88 : data(other.data), alias(other.alias), warn(other.warn), crit(other.crit), show(other.show) 89 89 {} … … 752 752 } 753 753 754 -
modules/CheckDisk/CheckDisk.cpp
r367bf20 re380ffe 129 129 } 130 130 131 DriveCon atiner tmpObject;131 DriveContainer tmpObject; 132 132 bool bFilter = false; 133 133 bool bFilterRemote = false; … … 139 139 bool bNSClient = false; 140 140 bool bPerfData = true; 141 std::list<DriveCon atiner> drives;141 std::list<DriveContainer> drives; 142 142 143 143 MAP_OPTIONS_BEGIN(args) … … 165 165 bFilter = bFilterFixed || bFilterCDROM || bFilterRemote || bFilterRemovable; 166 166 167 if (drives.size() == 0) 168 bCheckAll = true; 169 167 170 if (bCheckAll) { 168 171 DWORD dwDrives = GetLogicalDrives(); … … 178 181 ((bFilter)&&(bFilterRemote)&&(drvType==DRIVE_REMOTE)) || 179 182 ((bFilter)&&(bFilterRemovable)&&(drvType==DRIVE_REMOVABLE)) ) 180 drives.push_back(DriveCon atiner(drv, tmpObject.warn, tmpObject.crit));183 drives.push_back(DriveContainer(drv, tmpObject.warn, tmpObject.crit)); 181 184 } 182 185 idx++; … … 185 188 } 186 189 if (bCheckAllOthers) { 187 std::list<DriveCon atiner> checkdrives;190 std::list<DriveContainer> checkdrives; 188 191 DWORD dwDrives = GetLogicalDrives(); 189 192 int idx = 0; … … 200 203 { 201 204 bool bFound = false; 202 for (std::list<DriveCon atiner>::const_iterator pit = drives.begin();pit!=drives.end();++pit) {203 DriveCon atiner drive = (*pit);205 for (std::list<DriveContainer>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 206 DriveContainer drive = (*pit); 204 207 if (drive.data == drv) 205 208 bFound = true; 206 209 } 207 210 if (!bFound) 208 checkdrives.push_back(DriveCon atiner(drv, tmpObject.warn, tmpObject.crit));211 checkdrives.push_back(DriveContainer(drv, tmpObject.warn, tmpObject.crit)); 209 212 } 210 213 } … … 216 219 217 220 218 for (std::list<DriveCon atiner>::const_iterator pit = drives.begin();pit!=drives.end();++pit) {219 DriveCon atiner drive = (*pit);221 for (std::list<DriveContainer>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 222 DriveContainer drive = (*pit); 220 223 if (drive.data.length() == 1) 221 224 drive.data += _T(":"); … … 288 291 return NSCAPI::returnUNKNOWN; 289 292 } 290 PathCon atiner tmpObject;291 std::list<PathCon atiner> paths;293 PathContainer tmpObject; 294 std::list<PathContainer> paths; 292 295 293 296 MAP_OPTIONS_BEGIN(args) … … 310 313 MAP_OPTIONS_END() 311 314 312 for (std::list<PathCon atiner>::const_iterator pit = paths.begin(); pit != paths.end(); ++pit) {313 PathCon atiner path = (*pit);315 for (std::list<PathContainer>::const_iterator pit = paths.begin(); pit != paths.end(); ++pit) { 316 PathContainer path = (*pit); 314 317 std::wstring tstr; 315 318 std::wstring sName = path.getAlias(); … … 475 478 NSCAPI::nagiosReturn returnCode = NSCAPI::returnOK; 476 479 std::list<std::wstring> stl_args = arrayBuffer::arrayBuffer2list(argLen, char_args); 477 typedef checkHolders::CheckCon atiner<checkHolders::MaxMinBoundsUInteger> CheckFileConatiner;480 typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsUInteger> CheckFileContainer; 478 481 if (stl_args.empty()) { 479 482 message = _T("Missing argument(s)."); … … 511 514 NSCAPI::nagiosReturn returnCode = NSCAPI::returnOK; 512 515 std::list<std::wstring> stl_args = arrayBuffer::arrayBuffer2list(argLen, char_args); 513 typedef checkHolders::CheckCon atiner<checkHolders::MaxMinBoundsUInteger> CheckFileConatiner;516 typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsUInteger> CheckFileContainer; 514 517 if (stl_args.empty()) { 515 518 message = _T("Missing argument(s)."); … … 517 520 } 518 521 file_filter_function finder; 519 PathCon atiner tmpObject;522 PathContainer tmpObject; 520 523 std::list<std::wstring> paths; 521 524 unsigned int truncate = 0; 522 CheckFileCon atiner query;525 CheckFileContainer query; 523 526 std::wstring syntax = _T("%filename%"); 524 527 bool bPerfData = true; -
modules/CheckDisk/CheckDisk.h
r99e4d8f re380ffe 58 58 59 59 private: 60 typedef checkHolders::CheckCon atiner<checkHolders::MaxMinBoundsDiscSize> PathConatiner;61 typedef checkHolders::CheckCon atiner<checkHolders::MaxMinPercentageBoundsDiskSize> DriveConatiner;60 typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsDiscSize> PathContainer; 61 typedef checkHolders::CheckContainer<checkHolders::MaxMinPercentageBoundsDiskSize> DriveContainer; 62 62 };
Note: See TracChangeset
for help on using the changeset viewer.








