Changeset e380ffe in nscp


Ignore:
Timestamp:
06/15/08 20:14:32 (5 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
157dea5
Parents:
782ac8e
Message:

2008-06-15 MickeM

  • Applied patches from Jeff Goldschrafe <goldschr AT cshl.edu> + CheckDriveSize now uses "all drives" when no drive is specified.
    • Fixed misspellt Container
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/checkHelpers.hpp

    rde8ef76 re380ffe  
    6666  typedef enum {showLong, showShort, showProblems, showUnknown} showType; 
    6767  template <class TContents> 
    68   struct CheckConatiner { 
    69     typedef CheckConatiner<TContents> TThisType; 
     68  struct CheckContainer { 
     69    typedef CheckContainer<TContents> TThisType; 
    7070    TContents warn; 
    7171    TContents crit; 
     
    7777 
    7878 
    79     CheckConatiner() : show(showUnknown), perfData(true) 
     79    CheckContainer() : show(showUnknown), perfData(true) 
    8080    {} 
    81     CheckConatiner(std::wstring data_, TContents warn_, TContents crit_)  
     81    CheckContainer(std::wstring data_, TContents warn_, TContents crit_)  
    8282      : data(data_), warn(warn_), crit(crit_), show(showUnknown)  
    8383    {} 
    84     CheckConatiner(std::wstring name_, std::wstring alias_, TContents warn_, TContents crit_)  
     84    CheckContainer(std::wstring name_, std::wstring alias_, TContents warn_, TContents crit_)  
    8585      : data(data_), alias(alias_), warn(warn_), crit(crit_), show(showUnknown)  
    8686    {} 
    87     CheckConatiner(const TThisType &other)  
     87    CheckContainer(const TThisType &other)  
    8888      : data(other.data), alias(other.alias), warn(other.warn), crit(other.crit), show(other.show)  
    8989    {} 
     
    752752} 
    753753 
     754 
  • modules/CheckDisk/CheckDisk.cpp

    r367bf20 re380ffe  
    129129  } 
    130130 
    131   DriveConatiner tmpObject; 
     131  DriveContainer tmpObject; 
    132132  bool bFilter = false; 
    133133  bool bFilterRemote = false; 
     
    139139  bool bNSClient = false; 
    140140  bool bPerfData = true; 
    141   std::list<DriveConatiner> drives; 
     141  std::list<DriveContainer> drives; 
    142142 
    143143  MAP_OPTIONS_BEGIN(args) 
     
    165165  bFilter = bFilterFixed || bFilterCDROM  || bFilterRemote || bFilterRemovable; 
    166166 
     167  if (drives.size() == 0) 
     168    bCheckAll = true; 
     169 
    167170  if (bCheckAll) { 
    168171    DWORD dwDrives = GetLogicalDrives(); 
     
    178181          ((bFilter)&&(bFilterRemote)&&(drvType==DRIVE_REMOTE)) || 
    179182          ((bFilter)&&(bFilterRemovable)&&(drvType==DRIVE_REMOVABLE)) ) 
    180           drives.push_back(DriveConatiner(drv, tmpObject.warn, tmpObject.crit)); 
     183          drives.push_back(DriveContainer(drv, tmpObject.warn, tmpObject.crit)); 
    181184      } 
    182185      idx++; 
     
    185188  } 
    186189  if (bCheckAllOthers) { 
    187     std::list<DriveConatiner> checkdrives; 
     190    std::list<DriveContainer> checkdrives; 
    188191    DWORD dwDrives = GetLogicalDrives(); 
    189192    int idx = 0; 
     
    200203        { 
    201204          bool bFound = false; 
    202           for (std::list<DriveConatiner>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 
    203             DriveConatiner drive = (*pit); 
     205          for (std::list<DriveContainer>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 
     206            DriveContainer drive = (*pit); 
    204207            if (drive.data == drv) 
    205208              bFound = true; 
    206209          } 
    207210          if (!bFound) 
    208             checkdrives.push_back(DriveConatiner(drv, tmpObject.warn, tmpObject.crit)); 
     211            checkdrives.push_back(DriveContainer(drv, tmpObject.warn, tmpObject.crit)); 
    209212        } 
    210213      } 
     
    216219 
    217220 
    218   for (std::list<DriveConatiner>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 
    219     DriveConatiner drive = (*pit); 
     221  for (std::list<DriveContainer>::const_iterator pit = drives.begin();pit!=drives.end();++pit) { 
     222    DriveContainer drive = (*pit); 
    220223    if (drive.data.length() == 1) 
    221224      drive.data += _T(":"); 
     
    288291    return NSCAPI::returnUNKNOWN; 
    289292  } 
    290   PathConatiner tmpObject; 
    291   std::list<PathConatiner> paths; 
     293  PathContainer tmpObject; 
     294  std::list<PathContainer> paths; 
    292295 
    293296  MAP_OPTIONS_BEGIN(args) 
     
    310313  MAP_OPTIONS_END() 
    311314 
    312   for (std::list<PathConatiner>::const_iterator pit = paths.begin(); pit != paths.end(); ++pit) { 
    313     PathConatiner path = (*pit); 
     315  for (std::list<PathContainer>::const_iterator pit = paths.begin(); pit != paths.end(); ++pit) { 
     316    PathContainer path = (*pit); 
    314317    std::wstring tstr; 
    315318    std::wstring sName = path.getAlias(); 
     
    475478  NSCAPI::nagiosReturn returnCode = NSCAPI::returnOK; 
    476479  std::list<std::wstring> stl_args = arrayBuffer::arrayBuffer2list(argLen, char_args); 
    477   typedef checkHolders::CheckConatiner<checkHolders::MaxMinBoundsUInteger> CheckFileConatiner; 
     480  typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsUInteger> CheckFileContainer; 
    478481  if (stl_args.empty()) { 
    479482    message = _T("Missing argument(s)."); 
     
    511514  NSCAPI::nagiosReturn returnCode = NSCAPI::returnOK; 
    512515  std::list<std::wstring> stl_args = arrayBuffer::arrayBuffer2list(argLen, char_args); 
    513   typedef checkHolders::CheckConatiner<checkHolders::MaxMinBoundsUInteger> CheckFileConatiner; 
     516  typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsUInteger> CheckFileContainer; 
    514517  if (stl_args.empty()) { 
    515518    message = _T("Missing argument(s)."); 
     
    517520  } 
    518521  file_filter_function finder; 
    519   PathConatiner tmpObject; 
     522  PathContainer tmpObject; 
    520523  std::list<std::wstring> paths; 
    521524  unsigned int truncate = 0; 
    522   CheckFileConatiner query; 
     525  CheckFileContainer query; 
    523526  std::wstring syntax = _T("%filename%"); 
    524527  bool bPerfData = true; 
  • modules/CheckDisk/CheckDisk.h

    r99e4d8f re380ffe  
    5858 
    5959private: 
    60   typedef checkHolders::CheckConatiner<checkHolders::MaxMinBoundsDiscSize> PathConatiner; 
    61   typedef checkHolders::CheckConatiner<checkHolders::MaxMinPercentageBoundsDiskSize> DriveConatiner; 
     60  typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsDiscSize> PathContainer; 
     61  typedef checkHolders::CheckContainer<checkHolders::MaxMinPercentageBoundsDiskSize> DriveContainer; 
    6262}; 
Note: See TracChangeset for help on using the changeset viewer.