source: nscp/modules/NRPEClient/NRPEClient.cpp @ 6672c56

0.4.00.4.10.4.2
Last change on this file since 6672c56 was 7f9c823, checked in by Michael Medin <michael@…>, 4 years ago

First attempt at serious boostification.
NOTICE! This is NOT a complete edition, it build and runs but many features are disabled and/or broken.
But we have working, sockets and mutexes and conversion functions from boost inside now and more to come...
Also started to build with CMake since it works better then boost.build

  • Property mode set to 100644
File size: 20.6 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#include "stdafx.h"
22#include "NRPEClient.h"
23#include <strEx.h>
24#include <time.h>
25#include <config.h>
26#include <msvc_wrappers.h>
27#include <execute_process.hpp>
28#ifdef USE_BOOST
29#include <program_options_ex.hpp>
30#endif
31#include <strEx.h>
32
33NRPEClient gNRPEClient;
34
35BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
36{
37        NSCModuleWrapper::wrapDllMain(hModule, ul_reason_for_call);
38        return TRUE;
39}
40
41NRPEClient::NRPEClient() : buffer_length_(0), bInitSSL(false) {
42}
43
44NRPEClient::~NRPEClient() {
45}
46
47bool NRPEClient::loadModule(NSCAPI::moduleLoadMode mode) {
48        std::list<std::wstring> commands;
49        buffer_length_ = SETTINGS_GET_INT(nrpe::PAYLOAD_LENGTH);
50        try {
51                SETTINGS_REG_PATH(nrpe::CH_SECTION);
52                commands = NSCModuleHelper::getSettingsSection(setting_keys::nrpe::CH_SECTION_PATH);
53        } catch (NSCModuleHelper::NSCMHExcpetion &e) {
54                NSC_LOG_ERROR_STD(_T("Failed to register command: ") + e.msg_);
55        } catch (...) {
56                NSC_LOG_ERROR_STD(_T("Failed to register command."));
57        }
58        for (std::list<std::wstring>::const_iterator it = commands.begin(); it != commands.end(); ++it) {
59                NSC_DEBUG_MSG_STD(*it);
60                std::wstring s = NSCModuleHelper::getSettingsString(setting_keys::nrpe::CH_SECTION_PATH, (*it), _T(""));
61                if (s.empty()) {
62                        NSC_LOG_ERROR_STD(_T("Invalid NRPE-client entry: ") + (*it));
63                } else {
64                        addCommand((*it).c_str(), s);
65                }
66        }
67        return true;
68}
69void NRPEClient::initSSL() {
70        if (bInitSSL)
71                return;
72#ifdef USE_SSL
73        simpleSSL::SSL_init();
74#endif
75        bInitSSL = true;
76}
77
78void NRPEClient::addCommand(strEx::blindstr key, std::wstring args) {
79#ifndef USE_BOOST
80        NSC_LOG_ERROR_STD(_T("Could not parse: ") + key.c_str() + _T(" boost not avalible!"));
81#else
82        try {
83                boost::program_options::options_description desc = get_optionDesc();
84                boost::program_options::positional_options_description p = get_optionsPositional();
85
86                boost::program_options::variables_map vm;
87                boost::program_options::store(
88                        basic_command_line_parser_ex<TCHAR>(args).options(desc).positional(p).run()
89                        , vm);
90                boost::program_options::notify(vm);
91                nrpe_connection_data cd = get_ConectionData(vm);
92                NSC_DEBUG_MSG_STD(_T("Added NRPE Client: ") + key.c_str() + _T(" = ") + cd.toString());
93                commands[key] = cd;
94        } catch (boost::program_options::validation_error &e) {
95                NSC_LOG_ERROR_STD(_T("Could not parse: ") + key.c_str() + strEx::string_to_wstring(e.what()));
96        } catch (...) {
97                NSC_LOG_ERROR_STD(_T("Could not parse: ") + key.c_str());
98        }
99#endif
100}
101
102bool NRPEClient::unloadModule() {
103        return true;
104}
105
106bool NRPEClient::hasCommandHandler() {
107        return true;
108}
109bool NRPEClient::hasMessageHandler() {
110        return false;
111}
112NSCAPI::nagiosReturn NRPEClient::handleCommand(const strEx::blindstr command, const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf)
113{
114        command_list::const_iterator cit = commands.find(command);
115        if (cit == commands.end())
116                return NSCAPI::returnIgnored;
117
118        std::wstring args = (*cit).second.arguments;
119        if (SETTINGS_GET_BOOL(nrpe::ALLOW_ARGS) == 1) {
120                arrayBuffer::arrayList arr = arrayBuffer::arrayBuffer2list(argLen, char_args);
121                arrayBuffer::arrayList::const_iterator cit2 = arr.begin();
122                int i=1;
123
124                for (;cit2!=arr.end();cit2++,i++) {
125                        if (SETTINGS_GET_INT(nrpe::ALLOW_NASTY) == 0) {
126                                if ((*cit2).find_first_of(NASTY_METACHARS) != std::wstring::npos) {
127                                        NSC_LOG_ERROR(_T("Request string contained illegal metachars!"));
128                                        return NSCAPI::returnIgnored;
129                                }
130                        }
131                        strEx::replace(args, _T("$ARG") + strEx::itos(i) + _T("$"), (*cit2));
132                }
133        }
134
135        NSC_DEBUG_MSG_STD(_T("Rewrote command arguments: ") + args);
136        nrpe_result_data r = execute_nrpe_command((*cit).second, args);
137        message = r.text;
138        return r.result;
139}
140
141#ifdef USE_BOOST
142boost::program_options::options_description NRPEClient::get_optionDesc() {
143        boost::program_options::options_description desc("Allowed options");
144        buffer_length_ = SETTINGS_GET_INT(nrpe::PAYLOAD_LENGTH);
145        desc.add_options()
146                ("help,h", "Show this help message.")
147                ("host,H", boost::program_options::wvalue<std::wstring>(), "The address of the host running the NRPE daemon")
148                ("port,p", boost::program_options::value<int>(), "The port on which the daemon is running (default=5666)")
149                ("command,c", boost::program_options::wvalue<std::wstring>(), "The name of the command that the remote daemon should run")
150                ("timeout,t", boost::program_options::value<int>(), "Number of seconds before connection times out (default=10)")
151                ("buffer-length,l", boost::program_options::value<int>(), std::string("Length of payload (has to be same as on the server (default=" + strEx::s::itos(buffer_length_) + ")").c_str())
152                ("no-ssl,n", "Do not initial an ssl handshake with the server, talk in plaintext.")
153                ("arguments,a", boost::program_options::wvalue<std::vector<std::wstring>>(), "list of arguments")
154                ;
155        return desc;
156}
157boost::program_options::positional_options_description NRPEClient::get_optionsPositional() {
158        boost::program_options::positional_options_description p;
159        p.add("arguments", -1);
160        return p;
161}
162NRPEClient::nrpe_connection_data NRPEClient::get_ConectionData(boost::program_options::variables_map &vm) {
163        nrpe_connection_data ret(buffer_length_);
164        if (vm.count("host"))
165                ret.host = vm["host"].as<std::wstring>();
166        if (vm.count("port"))
167                ret.port = vm["port"].as<int>();
168        if (vm.count("timeout"))
169                ret.timeout = vm["timeout"].as<int>();
170        if (vm.count("buffer-length"))
171                ret.buffer_length = vm["buffer-length"].as<int>();
172        if (vm.count("command"))
173                ret.command = vm["command"].as<std::wstring>();
174        if (vm.count("arguments")) {
175                std::vector<std::wstring> v = vm["arguments"].as<std::vector<std::wstring>>();
176                for (std::vector<std::wstring>::const_iterator cit = v.begin(); cit != v.end(); ++cit) {
177                        if (!ret.arguments.empty())
178                                ret.arguments += _T("!");
179                        ret.arguments += *cit;
180                }
181        }
182        if (vm.count("no-ssl"))
183                ret.ssl = false;
184        return ret;
185}
186#endif
187
188
189int NRPEClient::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** args) {
190#ifndef USE_BOOST
191        NSC_LOG_ERROR_STD(_T("Could not execute ") + std::wstring(command) + _T(" boost not avalible!"));
192        return NSCAPI::returnUNKNOWN;
193#else
194        try {
195                boost::program_options::options_description desc = get_optionDesc();
196                boost::program_options::positional_options_description p = get_optionsPositional();
197               
198                boost::program_options::variables_map vm;
199                boost::program_options::store(
200                        basic_command_line_parser_ex<TCHAR>(command, argLen, args).options(desc).positional(p).run()
201                        , vm);
202                boost::program_options::notify(vm);   
203
204                if (vm.count("help")) {
205                        std::cout << desc << "\n";
206                        return 1;
207                }
208
209                NRPEClient::nrpe_connection_data command = get_ConectionData(vm);
210                nrpe_result_data result = execute_nrpe_command(command, command.arguments);
211                std::wcout << result.text << std::endl;
212                return result.result;
213        } catch (boost::program_options::validation_error &e) {
214                std::cout << e.what() << std::endl;
215        } catch (...) {
216                std::cout << "Unknown exception parsing command line" << std::endl;
217        }
218        return NSCAPI::returnUNKNOWN;
219#endif
220}
221NRPEClient::nrpe_result_data NRPEClient::execute_nrpe_command(nrpe_connection_data con, std::wstring arguments) {
222        try {
223                NRPEPacket packet;
224                if (con.ssl) {
225#ifdef USE_SSL
226                        packet = send_ssl(con.host, con.port, con.timeout, NRPEPacket::make_request(con.get_cli(arguments), con.buffer_length));
227#else
228                        return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("SSL support not available (compiled without USE_SSL)!"));
229#endif
230                } else
231                        packet = send_nossl(con.host, con.port, con.timeout, NRPEPacket::make_request(con.get_cli(arguments), con.buffer_length));
232                return nrpe_result_data(packet.getResult(), packet.getPayload());
233        } catch (NRPEPacket::NRPEPacketException &e) {
234                return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("NRPE Packet errro: ") + e.getMessage());
235        } catch (simpleSocket::SocketException &e) {
236                return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("Socket error: ") + e.getMessage());
237        } catch (std::runtime_error &e) {
238                return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("Socket error: ") + boost::lexical_cast<std::wstring>(e.what()));
239#ifdef USE_SSL
240        } catch (simpleSSL::SSLException &e) {
241                return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("SSL Socket error: ") + e.getMessage());
242#endif
243        } catch (...) {
244                return nrpe_result_data(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!"));
245        }
246}
247/*
248NRPEPacket NRPEClient::send_ssl(std::wstring host, int port, int timeout, NRPEPacket packet)
249{
250#ifndef USE_SSL
251        return send_nossl(host, port, timeout, packet);
252#else
253       
254        initSSL();
255        simpleSSL::Socket socket(true);
256        socket.connect(host, port);
257        NSC_DEBUG_MSG_STD(_T(">>>length: ") + strEx::itos(packet.getBufferLength()));
258        socket.sendAll(packet.getBuffer(), packet.getBufferLength());
259        simpleSocket::DataBuffer buffer;
260        socket.readAll(buffer, packet.getBufferLength());
261        NSC_DEBUG_MSG_STD(_T("<<<length: ") + strEx::itos(buffer.getLength()));
262        packet.readFrom(buffer.getBuffer(), buffer.getLength());
263        return packet;
264       
265
266        boost::asio::ssl::context ctx(io_service, boost::asio::ssl::context::sslv23);
267        ctx.use_tmp_dh_file("d:\\nrpe_512.pem");
268        ctx.set_verify_mode(boost::asio::ssl::context::verify_peer);
269        nrpe_ssl_socket socket(io_service, ctx, host, port);
270        //socket.
271
272#endif
273}
274*/
275using boost::asio::ip::tcp;
276
277void set_result(boost::optional<boost::system::error_code>* a, boost::system::error_code b)
278{
279        a->reset(b);
280}
281template <typename AsyncReadStream, typename RawSocket, typename MutableBufferSequence>
282void read_with_timeout(AsyncReadStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration)
283{
284        boost::optional<boost::system::error_code> timer_result;
285        boost::asio::deadline_timer timer(sock.io_service());
286        timer.expires_from_now(duration);
287        timer.async_wait(boost::bind(set_result, &timer_result, _1));
288
289        boost::optional<boost::system::error_code> read_result;
290        async_read(sock, buffers, boost::bind(set_result, &read_result, _1));
291
292        sock.io_service().reset();
293        while (sock.io_service().run_one())
294        {
295                if (read_result)
296                        timer.cancel();
297                else if (timer_result)
298                        rawSocket.close();
299        }
300
301        if (*read_result)
302                throw boost::system::system_error(*read_result);
303}
304
305template <typename AsyncWriteStream, typename RawSocket, typename MutableBufferSequence>
306void write_with_timeout(AsyncWriteStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration)
307{
308        boost::optional<boost::system::error_code> timer_result;
309        boost::asio::deadline_timer timer(sock.io_service());
310        timer.expires_from_now(duration);
311        timer.async_wait(boost::bind(set_result, &timer_result, _1));
312
313        boost::optional<boost::system::error_code> read_result;
314        async_write(sock, buffers, boost::bind(set_result, &read_result, _1));
315
316        sock.io_service().reset();
317        while (sock.io_service().run_one())
318        {
319                if (read_result)
320                        timer.cancel();
321                else if (timer_result)
322                        rawSocket.close();
323        }
324
325        if (*read_result)
326                throw boost::system::system_error(*read_result);
327}
328
329class nrpe_socket : public boost::noncopyable {
330public:
331        tcp::socket socket_;
332
333public:
334        nrpe_socket(boost::asio::io_service &io_service, std::wstring host, int port) : socket_(io_service) {
335                NSC_LOG_CRITICAL(_T("Looking up..."));
336                tcp::resolver resolver(io_service);
337                tcp::resolver::query query(to_string(host), to_string(port));
338                //tcp::resolver::query query("www.medin.name", "80");
339                //tcp::resolver::query query("test_server", "80");
340
341                tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
342                tcp::resolver::iterator end;
343
344                NSC_LOG_CRITICAL(_T("connecting..."));
345                boost::system::error_code error = boost::asio::error::host_not_found;
346                while (error && endpoint_iterator != end)
347                {
348                        tcp::resolver::endpoint_type ep = *endpoint_iterator;
349                        NSC_DEBUG_MSG_STD(_T("Attempting to connect to: ") + to_wstring(ep.address().to_string()) + _T(":") + to_wstring(ep.port()));
350                        socket_.close();
351                        socket_.connect(*endpoint_iterator++, error);
352                }
353                NSC_LOG_CRITICAL(_T("Connected..."));
354                if (error)
355                        throw boost::system::system_error(error);
356        }
357        ~nrpe_socket() {
358                socket_.close();
359        }
360
361        void send(NRPEPacket &packet, boost::posix_time::seconds timeout) {
362                std::vector<char> buf(packet.getBufferLength());
363                write_with_timeout(socket_, socket_, boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), timeout);
364        }
365        NRPEPacket recv(const NRPEPacket &packet, boost::posix_time::seconds timeout) {
366                std::vector<char> buf(packet.getBufferLength());
367                read_with_timeout(socket_, socket_, boost::asio::buffer(buf), timeout);
368                return NRPEPacket(&buf[0], buf.size(), packet.getInternalBufferLength());
369        }
370};
371
372class nrpe_ssl_socket {
373
374private:
375        boost::asio::ssl::stream<boost::asio::ip::tcp::socket> socket_;
376public:
377        nrpe_ssl_socket(boost::asio::io_service &io_service, boost::asio::ssl::context &ctx, std::wstring host, int port) : socket_(io_service, ctx) {
378                NSC_LOG_CRITICAL(_T("Looking up..."));
379                tcp::resolver resolver(io_service);
380                //tcp::resolver::query query(to_string(host), to_string(port));
381                tcp::resolver::query query("www.medin.name", "80");
382                //tcp::resolver::query query("test_server", "80");
383
384                tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
385                tcp::resolver::iterator end;
386
387                boost::system::error_code error = boost::asio::error::host_not_found;
388                NSC_LOG_CRITICAL(_T("Connecting..."));
389                while (error && endpoint_iterator != end)
390                {
391                        tcp::resolver::endpoint_type ep = *endpoint_iterator;
392                        NSC_DEBUG_MSG_STD(_T("Attempting to connect to: ") + to_wstring(ep.address().to_string()) + _T(":") + to_wstring(ep.port()));
393                        socket_.lowest_layer().close();
394                        socket_.lowest_layer().connect(*endpoint_iterator++, error);
395                }
396                if (error)
397                        throw boost::system::system_error(error);
398                NSC_LOG_CRITICAL(_T("Connected..."));
399
400                NSC_LOG_CRITICAL(_T("Handshaking..."));
401                //socket_.handshake(boost::asio::ssl::stream_base::client);
402                socket_.handshake(boost::asio::ssl::stream_base::client);
403                NSC_LOG_CRITICAL(_T("Handshook...") + strEx::itos(error.value()));
404
405        }
406
407        void send(NRPEPacket &packet, boost::posix_time::seconds timeout) {
408                NSC_LOG_CRITICAL(_T("Writing..."));
409                std::vector<char> buf(packet.getBufferLength());
410                write_with_timeout(socket_, socket_.lowest_layer(), boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), timeout);
411                NSC_LOG_CRITICAL(_T("Written..."));
412        }
413        NRPEPacket recv(const NRPEPacket &packet, boost::posix_time::seconds timeout) {
414                NSC_LOG_CRITICAL(_T("Reading..."));
415                std::vector<char> buf(packet.getBufferLength());
416                read_with_timeout(socket_, socket_.lowest_layer(), boost::asio::buffer(buf), timeout);
417                return NRPEPacket(&buf[0], buf.size(), packet.getInternalBufferLength());
418                NSC_LOG_CRITICAL(_T("Read..."));
419        }
420};
421
422NRPEPacket NRPEClient::send_nossl(std::wstring host, int port, int timeout, NRPEPacket packet)
423{
424        boost::asio::io_service io_service;
425        nrpe_socket socket(io_service, host, port);
426        socket.send(packet, boost::posix_time::seconds(timeout));
427        return socket.recv(packet, boost::posix_time::seconds(timeout));
428}
429
430NRPEPacket NRPEClient::send_ssl(std::wstring host, int port, int timeout, NRPEPacket packet)
431{
432        boost::asio::io_service io_service;
433        boost::asio::ssl::context ctx(io_service, boost::asio::ssl::context::sslv23);
434        SSL_CTX_set_cipher_list(ctx.impl(), "ADH");
435        ctx.use_tmp_dh_file("d:\\nrpe_512.pem");
436        ctx.set_verify_mode(boost::asio::ssl::context::verify_none);
437        nrpe_ssl_socket socket(io_service, ctx, host, port);
438        socket.send(packet, boost::posix_time::seconds(timeout));
439        return socket.recv(packet, boost::posix_time::seconds(timeout));
440}
441/*
442NRPEPacket NRPEClient::send_nossl(std::wstring host, int port, int timeout, NRPEPacket packet)
443{
444        unsigned char dh512_p[] = {
445                0xCF, 0xFF, 0x65, 0xC2, 0xC8, 0xB4, 0xD2, 0x68, 0x8C, 0xC1, 0x80, 0xB1,
446                0x7B, 0xD6, 0xE8, 0xB3, 0x62, 0x59, 0x62, 0xED, 0xA7, 0x45, 0x6A, 0xF8,
447                0xE9, 0xD8, 0xBE, 0x3F, 0x38, 0x42, 0x5F, 0xB2, 0xA5, 0x36, 0x03, 0xD3,
448                0x06, 0x27, 0x81, 0xC8, 0x9B, 0x88, 0x50, 0x3B, 0x82, 0x3D, 0x31, 0x45,
449                0x2C, 0xB4, 0xC5, 0xA5, 0xBE, 0x6A, 0xE3, 0x2E, 0xA6, 0x86, 0xFD, 0x6A,
450                0x7E, 0x1E, 0x6A, 0x73,
451        };
452        unsigned char dh512_g[] = { 0x02, };
453
454        DH *dh_2 = DH_new();
455        dh_2->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
456        dh_2->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
457
458        FILE *outfile = fopen("d:\\nrpe_512.pem", "w");
459        PEM_write_DHparams(outfile, dh_2);
460        PEM_write_DHparams(stdout, dh_2);
461        fclose(outfile);
462
463        nrpe_socket socket(host, port);
464        socket.send(packet, boost::posix_time::seconds(timeout));
465        return socket.recv(packet, boost::posix_time::seconds(timeout));
466}
467*/
468
469
470
471
472
473NSC_WRAPPERS_MAIN_DEF(gNRPEClient);
474NSC_WRAPPERS_IGNORE_MSG_DEF();
475NSC_WRAPPERS_HANDLE_CMD_DEF(gNRPEClient);
476NSC_WRAPPERS_HANDLE_CONFIGURATION(gNRPEClient);
477NSC_WRAPPERS_CLI_DEF(gNRPEClient);
478
479
480MODULE_SETTINGS_START(NRPEClient, _T("NRPE Listener configuration"), _T("..."))
481
482PAGE(_T("NRPE Listsner configuration"))
483
484ITEM_EDIT_TEXT(_T("port"), _T("This is the port the NRPEClient.dll will listen to."))
485ITEM_MAP_TO(_T("basic_ini_text_mapper"))
486OPTION(_T("section"), _T("NRPE"))
487OPTION(_T("key"), _T("port"))
488OPTION(_T("default"), _T("5666"))
489ITEM_END()
490
491ITEM_CHECK_BOOL(_T("allow_arguments"), _T("This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed."))
492ITEM_MAP_TO(_T("basic_ini_bool_mapper"))
493OPTION(_T("section"), _T("NRPE"))
494OPTION(_T("key"), _T("allow_arguments"))
495OPTION(_T("default"), _T("false"))
496OPTION(_T("true_value"), _T("1"))
497OPTION(_T("false_value"), _T("0"))
498ITEM_END()
499
500ITEM_CHECK_BOOL(_T("allow_nasty_meta_chars"), _T("This might have security implications (depending on what you do with the options)"))
501ITEM_MAP_TO(_T("basic_ini_bool_mapper"))
502OPTION(_T("section"), _T("NRPE"))
503OPTION(_T("key"), _T("allow_nasty_meta_chars"))
504OPTION(_T("default"), _T("false"))
505OPTION(_T("true_value"), _T("1"))
506OPTION(_T("false_value"), _T("0"))
507ITEM_END()
508
509ITEM_CHECK_BOOL(_T("use_ssl"), _T("This option will enable SSL encryption on the NRPE data socket (this increases security somwhat."))
510ITEM_MAP_TO(_T("basic_ini_bool_mapper"))
511OPTION(_T("section"), _T("NRPE"))
512OPTION(_T("key"), _T("use_ssl"))
513OPTION(_T("default"), _T("true"))
514OPTION(_T("true_value"), _T("1"))
515OPTION(_T("false_value"), _T("0"))
516ITEM_END()
517
518PAGE_END()
519ADVANCED_PAGE(_T("Access configuration"))
520
521ITEM_EDIT_OPTIONAL_LIST(_T("Allow connection from:"), _T("This is the hosts that will be allowed to poll performance data from the NRPE server."))
522OPTION(_T("disabledCaption"), _T("Use global settings (defined previously)"))
523OPTION(_T("enabledCaption"), _T("Specify hosts for NRPE server"))
524OPTION(_T("listCaption"), _T("Add all IP addresses (not hosts) which should be able to connect:"))
525OPTION(_T("separator"), _T(","))
526OPTION(_T("disabled"), _T(""))
527ITEM_MAP_TO(_T("basic_ini_text_mapper"))
528OPTION(_T("section"), _T("NRPE"))
529OPTION(_T("key"), _T("allowed_hosts"))
530OPTION(_T("default"), _T(""))
531ITEM_END()
532
533PAGE_END()
534MODULE_SETTINGS_END()
Note: See TracBrowser for help on using the repository browser.