Changeset c09c225 in nscp for modules/CheckSystem


Ignore:
Timestamp:
09/25/08 19:58:20 (5 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
7531979
Parents:
bb8b6d1
Message:

2008-09-24 MickeM - 0.3.5

  • Fixed issue with CheckServiceState and CheckAll? (it now works) + Added new check: CheckFile2 which has the same syntax as the event log filtering.

Usage: CheckFile2 file=c:\test\*.txt filter=in filter+creation=<24h "syntax=%filename% was created %creation%" MinWarn=0 MinCrit=0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/CheckSystem/CheckSystem.cpp

    rbb8b6d1 rc09c225  
    575575      } 
    576576    }  
     577    tmpObject.crit.state = _T("ignored"); 
    577578  } 
    578579  for (std::list<StateContainer>::iterator it = list.begin(); it != list.end(); ++it) { 
     
    622623      else if (info.m_dwCurrentState == MY_SERVICE_NOT_FOUND) 
    623624        value = checkHolders::state_not_found; 
    624       else 
     625      else { 
     626        NSC_LOG_MESSAGE(_T("Service had no (valid) state: ") + (*it).data + _T(" (") + strEx::itos(info.m_dwCurrentState) + _T(")")); 
    625627        value = checkHolders::state_none; 
     628      } 
     629      unsigned int x = returnCode; 
    626630      (*it).perfData = bPerfData; 
    627631      (*it).setDefault(tmpObject); 
    628632      (*it).runCheck(value, returnCode, msg, perf); 
    629     } 
    630  
    631   } 
    632   if (msg.empty()) 
     633//      NSC_LOG_MESSAGE(_T("Service: ") + (*it).data + _T(" (") + strEx::itos(info.m_dwCurrentState) + _T(":") + strEx::itos((*it).warn.state.value_) + _T(":") + strEx::itos((*it).crit.state.value_) + _T(") -- (") + strEx::itos(returnCode) + _T(":") + strEx::itos(x) + _T(")")); 
     634    } 
     635  } 
     636  if (msg.empty() && returnCode == NSCAPI::returnOK) 
    633637    msg = _T("OK: All services are in their apropriate state."); 
     638  else if (msg.empty()) 
     639    msg = NSCHelper::translateReturn(returnCode) + _T(": Whooha this is odd."); 
    634640  else if (!bNSClient) 
    635641    msg = NSCHelper::translateReturn(returnCode) + _T(": ") + msg; 
Note: See TracChangeset for help on using the changeset viewer.