source: nscp/modules/CheckSystem/CheckSystem.h @ f42280d

0.4.00.4.10.4.2stable
Last change on this file since f42280d was f42280d, checked in by Michael Medin <michael@…>, 7 years ago

* empty log message *

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#pragma once
2#include "PDHCollector.h"
3#include <CheckMemory.h>
4
5NSC_WRAPPERS_MAIN();
6NSC_WRAPPERS_CLI();
7
8class CheckSystem {
9private:
10        CheckMemory memoryChecker;
11        int processMethod_;
12        PDHCollectorThread pdhThread;
13
14public:
15        typedef enum { started, stopped } states;
16        typedef struct rB {
17                NSCAPI::nagiosReturn code_;
18                std::string msg_;
19                std::string perf_;
20                rB(NSCAPI::nagiosReturn code, std::string msg) : code_(code), msg_(msg) {}
21                rB() : code_(NSCAPI::returnUNKNOWN) {}
22        } returnBundle;
23
24public:
25        CheckSystem();
26        virtual ~CheckSystem();
27        // Module calls
28        bool loadModule();
29        bool unloadModule();
30        std::string getConfigurationMeta();
31
32        /**
33        * Return the module name.
34        * @return The module name
35        */
36        std::string getModuleName() {
37                return "CheckSystem";
38        }
39        /**
40        * Module version
41        * @return module version
42        */
43        NSCModuleWrapper::module_version getModuleVersion() {
44                NSCModuleWrapper::module_version version = {0, 3, 0 };
45                return version;
46        }
47        std::string getModuleDescription() {
48                return "Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.";
49        }
50
51        bool hasCommandHandler();
52        bool hasMessageHandler();
53        NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
54        int commandLineExec(const char* command,const unsigned int argLen,char** args);
55
56        NSCAPI::nagiosReturn checkCPU(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
57        NSCAPI::nagiosReturn checkUpTime(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
58        NSCAPI::nagiosReturn checkServiceState(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
59        NSCAPI::nagiosReturn checkMem(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
60        NSCAPI::nagiosReturn checkProcState(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
61        NSCAPI::nagiosReturn checkCounter(const unsigned int argLen, char **char_args, std::string &msg, std::string &perf);
62
63};
Note: See TracBrowser for help on using the repository browser.