| 1 | #pragma once |
|---|
| 2 | #include "PDHCollector.h" |
|---|
| 3 | |
|---|
| 4 | NSC_WRAPPERS_MAIN(); |
|---|
| 5 | |
|---|
| 6 | class CheckSystem { |
|---|
| 7 | private: |
|---|
| 8 | PDHCollectorThread pdhThread; |
|---|
| 9 | |
|---|
| 10 | public: |
|---|
| 11 | typedef enum { started, stopped } states; |
|---|
| 12 | typedef struct rB { |
|---|
| 13 | NSCAPI::nagiosReturn code_; |
|---|
| 14 | std::string msg_; |
|---|
| 15 | std::string perf_; |
|---|
| 16 | rB(NSCAPI::nagiosReturn code, std::string msg) : code_(code), msg_(msg) {} |
|---|
| 17 | rB() : code_(NSCAPI::returnUNKNOWN) {} |
|---|
| 18 | } returnBundle; |
|---|
| 19 | |
|---|
| 20 | public: |
|---|
| 21 | CheckSystem(); |
|---|
| 22 | virtual ~CheckSystem(); |
|---|
| 23 | // Module calls |
|---|
| 24 | bool loadModule(); |
|---|
| 25 | bool unloadModule(); |
|---|
| 26 | std::string getModuleName(); |
|---|
| 27 | NSCModuleWrapper::module_version getModuleVersion(); |
|---|
| 28 | bool hasCommandHandler(); |
|---|
| 29 | bool hasMessageHandler(); |
|---|
| 30 | NSCAPI::nagiosReturn handleCommand(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | NSCAPI::nagiosReturn checkCPU(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 34 | NSCAPI::nagiosReturn checkUpTime(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 35 | NSCAPI::nagiosReturn checkServiceState(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 36 | NSCAPI::nagiosReturn checkMem(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 37 | NSCAPI::nagiosReturn checkProcState(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 38 | NSCAPI::nagiosReturn checkCounter(const std::string command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | }; |
|---|