source: nscp/modules/CheckNSCP/CheckNSCP.h @ c760fc9

0.4.00.4.10.4.2
Last change on this file since c760fc9 was c760fc9, checked in by Michael Medin <michael@…>, 2 years ago
  • Fixed so old settings mappings are read/stored in a text file
  • Changed so all polugin use the "simple-plugin interface
  • Created a settings helper for the "core" (and started to use it)
  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**************************************************************************
2*   Copyright (C) 2004-2007 by Michael Medin <michael@medin.name>         *
3*                                                                         *
4*   This code is part of NSClient++ - http://trac.nakednuns.org/nscp      *
5*                                                                         *
6*   This program is free software; you can redistribute it and/or modify  *
7*   it under the terms of the GNU General Public License as published by  *
8*   the Free Software Foundation; either version 2 of the License, or     *
9*   (at your option) any later version.                                   *
10*                                                                         *
11*   This program is distributed in the hope that it will be useful,       *
12*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14*   GNU General Public License for more details.                          *
15*                                                                         *
16*   You should have received a copy of the GNU General Public License     *
17*   along with this program; if not, write to the                         *
18*   Free Software Foundation, Inc.,                                       *
19*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20***************************************************************************/
21#pragma once
22
23NSC_WRAPPERS_MAIN();
24
25class CheckNSCP : public nscapi::impl::SimpleCommand, public nscapi::impl::simple_plugin, public nscapi::impl::simple_log_handler {
26private:
27        MutexHandler mutex_;
28        std::wstring crashFolder;
29        typedef std::list<std::string> error_list;
30        error_list errors_;
31public:
32        // Module calls
33        bool loadModule();
34        bool loadModuleEx(std::wstring alias, NSCAPI::moduleLoadMode mode);
35        bool unloadModule();
36        std::wstring getConfigurationMeta();
37
38
39        std::wstring getModuleName() {
40                return _T("Check NSCP");
41        }
42        nscapi::plugin_wrapper::module_version getModuleVersion() {
43                nscapi::plugin_wrapper::module_version version = {0, 0, 1 };
44                return version;
45        }
46        std::wstring getModuleDescription() {
47                return _T("Checkes the state of " SZAPPNAME);
48        }
49
50        bool hasCommandHandler();
51        bool hasMessageHandler();
52        void handleMessage(int msgType, const std::string file, int line, std::string message);
53        NSCAPI::nagiosReturn handleCommand(const strEx::wci_string command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf);
54        std::string render(int msgType, const std::string file, int line, std::string message);
55        NSCAPI::nagiosReturn check_nscp( std::list<std::wstring> arguments, std::wstring & msg, std::wstring & perf );
56        int get_crashes(std::wstring &last_crash);
57        int get_errors(std::wstring &last_error);
58};
Note: See TracBrowser for help on using the repository browser.