source: nscp/modules/NSCAAgent/NSCAAgent.h @ 40970de

0.4.00.4.10.4.2
Last change on this file since 40970de was 40970de, checked in by Michael Medin <michael@…>, 3 years ago

Preliminary NSCA support (much is hard coded right now so only a PoC not a finished concept)

  • 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
23#include <CheckMemory.h>
24
25NSC_WRAPPERS_MAIN();
26
27class NSCAAgent : public NSCModuleHelper::SimpleNotificationHandler {
28private:
29
30        std::string hostname_;
31        std::wstring nscahost_;
32        unsigned int nscaport_;
33        unsigned int payload_length_;
34        bool cacheNscaHost_;
35        std::string password_;
36        int encryption_method_;
37        unsigned int timeout_;
38        int time_delta_;
39
40public:
41        NSCAAgent();
42        virtual ~NSCAAgent();
43        // Module calls
44        bool loadModule(NSCAPI::moduleLoadMode mode);
45        bool unloadModule();
46        std::wstring getConfigurationMeta();
47
48        /**
49        * Return the module name.
50        * @return The module name
51        */
52        std::wstring getModuleName() {
53#ifdef HAVE_LIBCRYPTOPP
54                return _T("NSCAAgent (w/ encryption)");
55#else
56                return _T("NSCAAgent");
57#endif
58        }
59        /**
60        * Module version
61        * @return module version
62        */
63        NSCModuleWrapper::module_version getModuleVersion() {
64                NSCModuleWrapper::module_version version = {0, 3, 0 };
65                return version;
66        }
67        std::wstring getModuleDescription() {
68                return std::wstring(_T("Passive check support (needs NSCA on nagios server).\nAvalible crypto are: ")) + getCryptos();
69        }
70        bool hasNotificationHandler() { return true; }
71
72        std::wstring getCryptos();
73
74        NSCAPI::nagiosReturn handleSimpleNotification(const std::wstring channel, const std::wstring command, NSCAPI::nagiosReturn code, std::wstring msg, std::wstring perf);
75
76
77};
Note: See TracBrowser for help on using the repository browser.