Ignore:
Timestamp:
11/18/06 14:14:22 (7 years ago)
Author:
Michael Medin <michael@…>
Children:
858709e
Parents:
edbbfbb
Message:

+ Added support for empty NRPE checking (i.e.. chec_nrpe without a -c argument)

  • Added error message when detected language is missing from counters.defs + Added Swedish locale to counters.defs (yes, I switched to Swedish XP on my computer :)
  • Fixed : (and possibly other problems) in counters when checking from check_nt (via NSCLient protocol) + Added CheckAllExcept? to CheckDrive? to check all except the specified drives.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/CheckDisk/CheckDisk.cpp

    r99bb030 r580392ac  
    100100  bool bFilterCDROM = false; 
    101101  bool bCheckAll = false; 
     102  bool bCheckAllOthers = false; 
    102103  bool bNSClient = false; 
    103104  std::list<DriveConatiner> drives; 
     
    113114    MAP_OPTIONS_BOOL_TRUE(NSCLIENT, bNSClient) 
    114115    MAP_OPTIONS_BOOL_TRUE(CHECK_ALL, bCheckAll) 
     116    MAP_OPTIONS_BOOL_TRUE(CHECK_ALL_OTHERS, bCheckAllOthers) 
    115117    MAP_OPTIONS_SECONDARY_BEGIN(":", p2) 
    116118      else if (p2.first == "Drive") { 
     
    143145      dwDrives >>= 1; 
    144146    } 
     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; 
    145177  } 
    146178 
Note: See TracChangeset for help on using the changeset viewer.