You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.5 KiB

#ifndef __ARGUS_SERVER_LIFE_MONOTORING__
#define __ARGUS_SERVER_LIFE_MONOTORING__
#include "../../components/base/basicValidatable.h"
#include "../../components/base/basicLogCollection.h"
#include "../../components/base/basicThread.h"
#include "../common/serverMySQL_dataBinder.h"
#define LM_SKEEP_MONITORING_SECONDS 180 // 3 Minutes Seep time from beginning
typedef struct S_HEALTH_MONITORING_ZONE{
bool module_monitored[4];
uint64_t module_id[4];
uint8_t module_status[4];
uint64_t platform_id;
uint8_t lvl;
}HEALTH_MONITORING_ZONE;
typedef std::vector<HEALTH_MONITORING_ZONE *> V_HEALTH_MONITORING_ZONES;
class servaLifeMonitoring : public basicValidatable, basicThread {
private:
static servaLifeMonitoring * _Instance;
basicLogCollection * m_pLog;
servaMySQLDBC * m_pDBC;
basicMutex m_mMonitoringZonesProtector;
V_HEALTH_MONITORING_ZONES m_vMonitoringZones;
uint32_t m_nStartupTS; // to skip initial startup time
bool validateZone( HEALTH_MONITORING_ZONE *ptr );
uint8_t validateModule( uint64_t module_id );
servaLifeMonitoring();
protected:
virtual void m_fThreadProc( void );
public:
static servaLifeMonitoring * getInstance();
~servaLifeMonitoring();
virtual bool validate();
};
#endif