Changeset e93e741 in nscp for trunk/modules/CheckSystem


Ignore:
Timestamp:
05/29/05 20:58:08 (8 years ago)
Author:
Michael Medin <michael@…>
Children:
24f7192
Parents:
7da80b5
Message:
  • Fixed PROCSTATE and SERVICESTATE return state. + Added support for individual size in CheckDriveSize and CheckFileSize (size has to be specified before a drive/path)
  • Fixed performance data for drives (and possibly other places)
Location:
trunk/modules/CheckSystem
Files:
3 edited

Legend:

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

    r7da80b5 re93e741  
    593593    try { 
    594594      PDH::PDHQuery pdh; 
    595       PDHCollectors::StaticPDHCounterListenerInt counter; 
     595      PDHCollectors::StaticPDHCounterListener<double, PDH_FMT_DOUBLE> counter; 
    596596      std::string name = (*it).first; 
    597597      if (name.empty()) 
     
    601601      pdh.collect(); 
    602602      if (bNSCLientCompatible) { 
    603 //        std::cout << counter.getValue() << std::endl; 
    604603        msg += strEx::itos(counter.getValue()); 
    605604      } else { 
     
    632631  if (msg.empty()) 
    633632    msg = "OK all counters within bounds."; 
    634   else 
     633  else if (!bNSCLientCompatible) 
    635634    msg = NSCHelper::translateReturn(returnCode) + ": " + msg; 
    636635  return returnCode; 
  • trunk/modules/CheckSystem/PDHCollector.cpp

    r7da80b5 re93e741  
    5050*/ 
    5151DWORD PDHCollector::threadProc(LPVOID lpParameter) { 
     52  hStopEvent_ = CreateEvent(NULL, TRUE, FALSE, NULL); 
     53  if (!hStopEvent_) { 
     54    NSC_LOG_ERROR_STD("Create StopEvent failed: " + strEx::itos(GetLastError())); 
     55    return 0; 
     56  } 
    5257  PDH::PDHQuery pdh; 
    5358  pdh.addCounter(NSCModuleHelper::getSettingsString(C_SYSTEM_SECTION_TITLE, C_SYSTEM_MEM_PAGE_LIMIT, C_SYSTEM_MEM_PAGE_LIMIT_DEFAULT), &memCmtLim); 
     
    6368  } 
    6469 
    65   hStopEvent_ = CreateEvent(NULL, TRUE, FALSE, NULL); 
    66   if (!hStopEvent_) { 
    67     NSC_LOG_ERROR_STD("Create StopEvent failed: " + strEx::itos(GetLastError())); 
    68     return 0; 
    69   } 
    7070 
    7171  do { 
  • trunk/modules/CheckSystem/PDHCollector.h

    r7da80b5 re93e741  
    3030  int checkIntervall_; 
    3131 
    32   PDHCollectors::StaticPDHCounterListenerInt memCmtLim; 
    33   PDHCollectors::StaticPDHCounterListenerInt memCmt; 
    34   PDHCollectors::StaticPDHCounterListenerInt upTime; 
    35   PDHCollectors::RoundINTPDHBufferListener cpu; 
     32  PDHCollectors::StaticPDHCounterListener<__int64, PDH_FMT_LARGE> memCmtLim; 
     33  PDHCollectors::StaticPDHCounterListener<__int64, PDH_FMT_LARGE> memCmt; 
     34  PDHCollectors::StaticPDHCounterListener<__int64, PDH_FMT_LARGE> upTime; 
     35  PDHCollectors::RoundINTPDHBufferListener<__int64, PDH_FMT_LARGE> cpu; 
    3636 
    3737public: 
Note: See TracChangeset for help on using the changeset viewer.