- Timestamp:
- 11/18/06 14:14:22 (7 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- d48c31a
- Parents:
- 1a22e52
- Location:
- modules
- Files:
-
- 6 edited
-
CheckDisk/CheckDisk.cpp (modified) (3 diffs)
-
CheckSystem/CheckSystem.cpp (modified) (3 diffs)
-
CheckSystem/PDHCollector.cpp (modified) (3 diffs)
-
NRPEListener/NRPEListener.cpp (modified) (1 diff)
-
NSClientListener/NSClientListener.cpp (modified) (1 diff)
-
SysTray/SysTray.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckDisk/CheckDisk.cpp
rf42280d r0687108 100 100 bool bFilterCDROM = false; 101 101 bool bCheckAll = false; 102 bool bCheckAllOthers = false; 102 103 bool bNSClient = false; 103 104 std::list<DriveConatiner> drives; … … 113 114 MAP_OPTIONS_BOOL_TRUE(NSCLIENT, bNSClient) 114 115 MAP_OPTIONS_BOOL_TRUE(CHECK_ALL, bCheckAll) 116 MAP_OPTIONS_BOOL_TRUE(CHECK_ALL_OTHERS, bCheckAllOthers) 115 117 MAP_OPTIONS_SECONDARY_BEGIN(":", p2) 116 118 else if (p2.first == "Drive") { … … 143 145 dwDrives >>= 1; 144 146 } 147 } 148 if (bCheckAllOthers) { 149 std::list<DriveConatiner> checkdrives; 150 DWORD dwDrives = GetLogicalDrives(); 151 int idx = 0; 152 while (dwDrives != 0) { 153 if (dwDrives & 0x1) { 154 std::string drv; 155 drv += static_cast<char>('A' + idx); drv += ":\\"; 156 UINT drvType = GetDriveType(drv.c_str()); 157 if ( ((!bFilter)&&(drvType == DRIVE_FIXED)) || 158 ((bFilter)&&(bFilterFixed)&&(drvType==DRIVE_FIXED)) || 159 ((bFilter)&&(bFilterCDROM)&&(drvType==DRIVE_CDROM)) || 160 ((bFilter)&&(bFilterRemote)&&(drvType==DRIVE_REMOTE)) || 161 ((bFilter)&&(bFilterRemovable)&&(drvType==DRIVE_REMOVABLE)) ) 162 { 163 bool bFound = false; 164 for (std::list<DriveConatiner>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 165 DriveConatiner drive = (*pit); 166 if (drive.data == drv) 167 bFound = true; 168 } 169 if (!bFound) 170 checkdrives.push_back(DriveConatiner(drv, tmpObject.warn, tmpObject.crit)); 171 } 172 } 173 idx++; 174 dwDrives >>= 1; 175 } 176 drives = checkdrives; 145 177 } 146 178 -
modules/CheckSystem/CheckSystem.cpp
r76aafc4 r0687108 31 31 * @return 32 32 */ 33 CheckSystem::CheckSystem() : processMethod_(0) {}33 CheckSystem::CheckSystem() : processMethod_(0), pdhThread("pdhThread") {} 34 34 /** 35 35 * Default d-tor … … 796 796 if (!PDH::Enumerations::validate(counter.data, tstr)) { 797 797 msg = tstr; 798 msg += " (" + counter.getAlias() + "|" + counter.data + ")"; 798 799 return NSCAPI::returnUNKNOWN; 799 800 } … … 817 818 } 818 819 } catch (const PDH::PDHException e) { 819 NSC_LOG_ERROR_STD("ERROR: " + e.getError() + " (" + counter.getAlias() + " )");820 msg = static_cast<std::string>("ERROR: ") + e.getError() ;820 NSC_LOG_ERROR_STD("ERROR: " + e.getError() + " (" + counter.getAlias() + "|" + counter.data + ")"); 821 msg = static_cast<std::string>("ERROR: ") + e.getError()+ " (" + counter.getAlias() + "|" + counter.data + ")"; 821 822 return NSCAPI::returnUNKNOWN; 822 823 } -
modules/CheckSystem/PDHCollector.cpp
r76aafc4 r0687108 67 67 settings.setFile(NSCModuleHelper::getBasePath() + "\\counters.defs", true); 68 68 69 NSC_LOG_ERROR_STD("Getting counter info..."); 69 70 70 71 try { … … 93 94 section = "0000" + strEx::ihextos(langId); 94 95 section = "0x" + section.substr(section.length()-4); 96 if (settings.getString(section, "Description", "_NOT_FOUND") == "_NOT_FOUND") { 97 NSC_LOG_ERROR_STD("Detected language: " + section + " but it could not be found in: counters.defs"); 98 NSC_LOG_ERROR_STD("You need to manually configure performance counters!"); 99 return 0; 100 } 95 101 NSC_DEBUG_MSG_STD("Detected language: " + settings.getString(section, "Description", "Not found") + " (" + section + ")"); 96 102 } catch (systemInfo::SystemInfoException e) { … … 111 117 } 112 118 119 NSC_LOG_ERROR_STD("Attempting to open counter..."); 113 120 try { 114 121 pdh.open(); 122 NSC_LOG_ERROR_STD("Counters opend..."); 115 123 } catch (const PDH::PDHException &e) { 116 124 NSC_LOG_ERROR_STD("Failed to open performance counters: " + e.getError()); -
modules/NRPEListener/NRPEListener.cpp
r9ce8b01 r0687108 325 325 } 326 326 strEx::token cmd = strEx::getToken(p.getPayload(), '!'); 327 if (cmd.first == "_NRPE_CHECK") { 328 return NRPEPacket(NRPEPacket::responsePacket, NRPEPacket::version2, NSCAPI::returnOK, "I ("SZVERSION") seem to be doing fine..."); 329 } 327 330 std::string msg, perf; 328 331 -
modules/NSClientListener/NSClientListener.cpp
r9ce8b01 r0687108 160 160 case REQ_COUNTER: 161 161 cmd.first = "checkCounter"; 162 cmd.second +="&nsclient";162 cmd.second = "Counter=" + cmd.second + "&nsclient"; 163 163 break; 164 164 case REQ_FILEAGE: -
modules/SysTray/SysTray.cpp
rf42280d r0687108 16 16 } 17 17 18 SysTray::SysTray() {}18 SysTray::SysTray() : icon("SysTray") {} 19 19 SysTray::~SysTray() {} 20 20 bool SysTray::loadModule() {
Note: See TracChangeset
for help on using the changeset viewer.








