source: nscp/modules/NSCAAgent/NSCAAgent.h @ d82ebd6

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

Added some missing files and fixed a NSCA Channel *nix issue.

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