source: nscp/include/settings/macros.h @ 7f9c823

0.4.00.4.10.4.2
Last change on this file since 7f9c823 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: 24.4 KB
Line 
1#pragma once
2
3#include <unicode_char.hpp>
4
5#define DEFINE_SETTING_S(name, path, key, value) \
6        const std::wstring name ## _PATH = _T(path); \
7        const std::wstring name = _T(key); \
8        const std::wstring name ## _DEFAULT = _T(value);
9#define NSCLIENT_SETTINGS_SYSTRAY_EXE _T("systray_exe")
10#define NSCLIENT_SETTINGS_SYSTRAY_EXE_DEFAULT _T("nstray.exe")
11
12#define DEFINE_PATH(name, path) \
13        const std::wstring name ## _PATH = _T(path);
14
15#define DEFINE_SETTING_I(name, path, key, value) \
16        const std::wstring name ## _PATH = _T(path); \
17        const std::wstring name = _T(key); \
18        const long long name ## _DEFAULT = value;
19
20#define DEFINE_SETTING_B(name, path, key, value) \
21        const std::wstring name ## _PATH = _T(path); \
22        const std::wstring name = _T(key); \
23        const bool name ## _DEFAULT = value;
24
25#define DESCRIBE_SETTING(name, title, description) \
26        const std::wstring name ## _TITLE = _T(title); \
27        const std::wstring name ## _DESC = _T(description); \
28        const bool name ## _ADVANCED = false;
29
30#define DESCRIBE_SETTING_ADVANCED(name, title, description) \
31        const std::wstring name ## _TITLE = _T(title); \
32        const std::wstring name ## _DESC = _T(description); \
33        const bool name ## _ADVANCED = true;
34
35#define SETTINGS_KEY(key) \
36        setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT
37
38#define SETTINGS_REG_KEY_S_GEN(key, type) \
39        setting_keys::key ## _PATH, setting_keys::key, type, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _DEFAULT, setting_keys::key ## _ADVANCED
40#define SETTINGS_REG_KEY_I_GEN(key, type) \
41        setting_keys::key ## _PATH, setting_keys::key, type, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, boost::lexical_cast<std::wstring>(setting_keys::key ## _DEFAULT), setting_keys::key ## _ADVANCED
42#define SETTINGS_REG_KEY_B_GEN(key, type) \
43        setting_keys::key ## _PATH, setting_keys::key, type, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _DEFAULT==1?_T("1"):_T("0"), setting_keys::key ## _ADVANCED
44#define SETTINGS_REG_PATH_GEN(key) \
45        setting_keys::key ## _PATH, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _ADVANCED
46
47
48
49
50#define GENERIC_KEY_ALLOWED_HOSTS "allowed hosts"
51#define GENERIC_KEY_BIND_TO "bind to"
52#define GENERIC_KEY_SOCK_READ_TIMEOUT "socket read timeout"
53#define GENERIC_KEY_SOCK_LISTENQUE "socket queue size"
54#define GENERIC_KEY_SOCK_CACHE_ALLOWED "allowed hosts caching"
55#define GENERIC_KEY_PWD_MASTER_KEY "master key"
56#define GENERIC_KEY_PWD "password"
57#define GENERIC_KEY_OBFUSCATED_PWD "obfuscated password"
58#define GENERIC_KEY_USE_SSL "use ssl"
59
60
61// Main Registry ROOT
62#define NS_HKEY_ROOT HKEY_LOCAL_MACHINE
63#define NS_REG_ROOT _T("SOFTWARE\\NSClient++")
64
65
66
67namespace setting_keys {
68
69#define DEFAULT_PROTOCOL_SECTION "/protocols/default"
70#define NSCLIENT_SECTION "/protocols/NSClient"
71#define NRPE_SECTION_PROTOCOL "/protocols/NRPE"
72#define DEFAULT_SECTION "/settings"
73#define NRPE_SECTION "/settings/NRPE"
74#define NRPE_CLIENT_HANDLER_SECTION "/settings/NRPE/client/handlers"
75#define NRPE_SECTION_HANDLERS "/settings/NRPE/Handlers"
76#define MAIN_MODULES_SECTION _T("/modules")
77#define EVENT_LOG_SECTION "/settings/eventlog"
78#define EXTSCRIPT_SECTION "/settings/external scripts"
79#define EXTSCRIPT_SCRIPT_SECTION "/settings/external scripts/scripts"
80#define EXTSCRIPT_ALIAS_SECTION "/settings/external scripts/alias"
81#define CHECK_SYSTEM_SECTION "/settings/system"
82#define CHECK_SYSTEM_COUNTERS_SECTION "/settings/system/PDH counters"
83#define CHECK_SYSTEM_SERVICES_SECTION "/settings/system/services"
84#define NSCA_SECTION "/settings/NSCA"
85#define NSCA_SERVER_SECTION "/settings/NSCA/server"
86#define NSCA_CMD_SECTION "/settings/NSCA/server/commands"
87#define TASK_SCHED_SECTION "/settings/Task Scheduler"
88#define LUA_SECTION "/settings/Lua/script"
89#define LOG_SECTION "/settings/log"
90
91
92        namespace settings_def {
93                DEFINE_SETTING_I(PAYLOAD_LEN, DEFAULT_SECTION, "payload length", 4096);
94                DESCRIBE_SETTING(PAYLOAD_LEN, "PAYLOAD LENGTH", "...");
95
96                DEFINE_SETTING_B(SHARED_SESSION, DEFAULT_SECTION, "shared session", true);
97                DESCRIBE_SETTING(SHARED_SESSION, "SHARED SESSION", "TODO");
98
99                DEFINE_SETTING_S(SYSTRAY_EXE, DEFAULT_SECTION, "systray_exe", "nstray.exe");
100                DESCRIBE_SETTING(SYSTRAY_EXE, "TODO", "TODO");
101
102
103        }
104
105        // NSClient Setting headlines
106        namespace nsclient {
107                DEFINE_PATH(SECTION, NSCLIENT_SECTION);
108                DESCRIBE_SETTING(SECTION, "NSCLIENT SECTION", "Section for NSClient (NSClientListsner.dll) (check_nt) protocol options.");
109
110                DEFINE_SETTING_S(ALLOWED_HOSTS, NSCLIENT_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");
111                DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead.");
112
113                DEFINE_SETTING_I(PORT, NSCLIENT_SECTION, "port", 12489);
114                DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");
115
116                DEFINE_SETTING_S(BINDADDR, NSCLIENT_SECTION, GENERIC_KEY_BIND_TO, "");
117                DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses.");
118
119                DEFINE_SETTING_I(READ_TIMEOUT, NSCLIENT_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
120                DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");
121
122                DEFINE_SETTING_I(LISTENQUE, NSCLIENT_SECTION, GENERIC_KEY_SOCK_LISTENQUE, 0);
123                DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts.");
124
125                DEFINE_SETTING_S(VERSION, NSCLIENT_SECTION, "version", "auto");
126                DESCRIBE_SETTING(VERSION, "VERSION", "The version number to return for the CLIENTVERSION check (useful to \"simulate\" an old/different version of the client, auto will be generated from the compiled version string inside NSClient++");
127
128                DEFINE_SETTING_B(CACHE_ALLOWED, NSCLIENT_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
129                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
130
131                DEFINE_SETTING_S(MASTER_KEY, NSCLIENT_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");
132                DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");
133
134                DEFINE_SETTING_S(PWD, NSCLIENT_SECTION, GENERIC_KEY_PWD, "");
135                DESCRIBE_SETTING(PWD, "PASSWORD", "This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.");
136
137                DEFINE_SETTING_S(OBFUSCATED_PWD, NSCLIENT_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");
138                DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance.");
139
140        }
141
142        // NSClient Setting headlines
143        namespace nrpe {
144                DEFINE_PATH(SECTION, NRPE_SECTION_PROTOCOL);
145                DESCRIBE_SETTING(SECTION, "NRPE SECTION", "Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.");
146
147               
148                DEFINE_PATH(CH_SECTION, NRPE_CLIENT_HANDLER_SECTION);
149                DESCRIBE_SETTING(CH_SECTION, "CLIENT HANDLER SECTION", "...");
150
151                DEFINE_SETTING_S(ALLOWED_HOSTS, NRPE_SECTION_PROTOCOL, GENERIC_KEY_ALLOWED_HOSTS, "");
152                DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead.");
153
154                DEFINE_SETTING_I(PORT, NRPE_SECTION_PROTOCOL, "port", 5666);
155                DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");
156
157                DEFINE_SETTING_S(BINDADDR, NRPE_SECTION_PROTOCOL, GENERIC_KEY_BIND_TO, "");
158                DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses.");
159
160                DEFINE_SETTING_I(READ_TIMEOUT, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
161                DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");
162
163                DEFINE_SETTING_I(LISTENQUE, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_LISTENQUE, 0);
164                DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts.");
165
166                DEFINE_SETTING_B(CACHE_ALLOWED, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
167                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
168
169                DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true);
170                DESCRIBE_SETTING(KEYUSE_SSL, "USE SSL SOCKET", "This option controls if SSL should be used on the socket.");
171
172                DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024);
173                DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NRPE agent. This is a hard specific value so you have to \"configure\" (read recompile) your NRPE agent to use the same value for it to work.");
174
175                DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true);
176                DESCRIBE_SETTING_ADVANCED(ALLOW_PERFDATA, "PERFORMANCE DATA", "Send performance data back to nagios (set this to 0 to remove all performance data).");
177
178                DEFINE_SETTING_S(SCRIPT_PATH, NRPE_SECTION, "script path", "");
179                DESCRIBE_SETTING_ADVANCED(SCRIPT_PATH, "SCRIPT DIRECTORY", "Load all scripts in a directory and use them as commands. Probably dangerous but usefull if you have loads of scripts :)");
180
181                DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60);
182                DESCRIBE_SETTING(CMD_TIMEOUT, "COMMAND TIMEOUT", "This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.");
183
184                DEFINE_SETTING_B(ALLOW_ARGS, NRPE_SECTION, "allow arguments", false);
185                DESCRIBE_SETTING(ALLOW_ARGS, "COMMAND ARGUMENT PROCESSING", "This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.");
186
187                DEFINE_SETTING_B(ALLOW_NASTY, NRPE_SECTION, "allow nasy characters", false);
188                DESCRIBE_SETTING(ALLOW_NASTY, "COMMAND ALLOW NASTY META CHARS", "This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'\"\\[]{}) characters in arguments.");
189
190                DEFINE_PATH(SECTION_HANDLERS, NRPE_SECTION_HANDLERS);
191                DESCRIBE_SETTING(SECTION_HANDLERS, "NRPE COMMAND DEFINITIONS -- DEPRECATED", "Command definitions that this daemon will run (it will also run all internal commands such as those from ther ExternalScriptModule).");
192
193        }
194
195        namespace protocol_def {
196                DEFINE_SETTING_S(ALLOWED_HOSTS, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");
197                DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons. If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password). The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access");
198
199                DEFINE_SETTING_B(CACHE_ALLOWED, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
200                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
201
202                DEFINE_SETTING_S(MASTER_KEY, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");
203                DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");
204
205                DEFINE_SETTING_S(PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD, "");
206                DESCRIBE_SETTING(PWD, "PASSWORD", "This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.");
207
208                DEFINE_SETTING_S(OBFUSCATED_PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");
209                DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance.");
210        }
211        namespace event_log {
212                DEFINE_PATH(SECTION, EVENT_LOG_SECTION);
213                DESCRIBE_SETTING(SECTION, "EVENT LOG SECTION", "Section for the EventLog Checker (CHeckEventLog.dll).");
214
215                DEFINE_SETTING_B(DEBUG_KEY, EVENT_LOG_SECTION, "debug", false);
216                DESCRIBE_SETTING_ADVANCED(DEBUG_KEY, "DEBUG", "Log all \"hits\" and \"misses\" on the eventlog filter chain, useful for debugging eventlog checks but very very very noisy so you don't want to accidentally set this on a real machine.");
217
218                DEFINE_SETTING_B(LOOKUP_NAMES, EVENT_LOG_SECTION, "lookup_names", false);
219                DESCRIBE_SETTING_ADVANCED(LOOKUP_NAMES, "TODO", "TODO");
220
221                DEFINE_SETTING_S(SYNTAX, EVENT_LOG_SECTION, "syntax", "");
222                DESCRIBE_SETTING(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one).");
223
224                DEFINE_SETTING_I(BUFFER_SIZE, EVENT_LOG_SECTION, "buffer_size", 65535);
225                DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", "The size of the bugfer to use when getting messages this affects the speed and maximum size of messages you can recieve.");
226        }
227
228        namespace external_scripts {
229                DEFINE_PATH(SECTION, EXTSCRIPT_SECTION);
230                DESCRIBE_SETTING(SECTION, "EXTERNAL SCRIPT SECTION", "Section for external scripts (CheckExternalScripts.dll).");
231
232                DEFINE_SETTING_I(TIMEOUT, EXTSCRIPT_SECTION, "timeout", 60);
233                DESCRIBE_SETTING(TIMEOUT, "COMMAND TIMEOUT", "The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.");
234
235                DEFINE_SETTING_B(ALLOW_ARGS, EXTSCRIPT_SECTION, "allow arguments", false);
236                DESCRIBE_SETTING(ALLOW_ARGS, "COMMAND ARGUMENT PROCESSING", "This option determines whether or not the we will allow clients to specify arguments to commands that are executed.");
237
238                DEFINE_SETTING_B(ALLOW_NASTY, EXTSCRIPT_SECTION, "allow nasy characters", false);
239                DESCRIBE_SETTING(ALLOW_NASTY, "COMMAND ALLOW NASTY META CHARS", "This option determines whether or not the we will allow clients to specify nasty (as in |`&><'\"\\[]{}) characters in arguments.");
240
241                DEFINE_SETTING_S(SCRIPT_PATH, EXTSCRIPT_SECTION, "script path", "");
242                DESCRIBE_SETTING_ADVANCED(SCRIPT_PATH, "SCRIPT DIRECTORY", "Load all scripts in a directory and use them as commands. Probably dangerous but usefull if you have loads of scripts :)");
243
244                DEFINE_PATH(SCRIPT_SECTION, EXTSCRIPT_SCRIPT_SECTION);
245                DESCRIBE_SETTING(SCRIPT_SECTION, "EXTERNAL SCRIPT SCRIPTS SECTION", "A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments> for instance:");
246
247                DEFINE_PATH(ALIAS_SECTION, EXTSCRIPT_ALIAS_SECTION);
248                DESCRIBE_SETTING(ALIAS_SECTION, "EXTERNAL SCRIPT ALIAS SECTION", "Works like the \"inject\" concept of NRPE scripts module. But in short a list of aliases available. An alias is an internal command that has been \"wrapped\" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)");
249        }
250
251        namespace check_system {
252
253                DEFINE_PATH(SECTION, CHECK_SYSTEM_SECTION);
254                DESCRIBE_SETTING(SECTION, "SYSTEM", "Section for system checks and system settings.");
255
256                DEFINE_SETTING_S(PROC_ENUM, CHECK_SYSTEM_SECTION, "process enumeration method", "auto");
257                DESCRIBE_SETTING_ADVANCED(PROC_ENUM, "COMMAND TIMEOUT", "Set the PROCESS enumeration method (auto, TOOLHELP or PSAPI)");
258                const std::wstring PROC_ENUM_PSAPI = _T("PSAPI");
259                const std::wstring PROC_ENUM_TH = _T("TOOLHELP");
260
261                DEFINE_SETTING_S(CPU_METHOD, CHECK_SYSTEM_SECTION, "method", "PDH_AUTO");
262                DESCRIBE_SETTING_ADVANCED(CPU_METHOD, "CPU METHOD", "Set this to false to disable auto detect (counters.defs) PDH language and OS version.");
263                const std::wstring CPU_METHOD_PDH_MANUAL = _T("PDH_MANUAL");
264                const std::wstring CPU_METHOD_PDH_AUTO = _T("PDH_AUTO");
265                const std::wstring CPU_METHOD_PDH_NO_INDEX = _T("PDH_NO_INDEX");
266
267                DEFINE_SETTING_S(BUFFER_SIZE, CHECK_SYSTEM_SECTION, "buffer size", "1h");
268                DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", "  The time to store CPU load data.");
269
270                DEFINE_SETTING_I(INTERVALL, CHECK_SYSTEM_SECTION, "interval", 10);
271                DESCRIBE_SETTING_ADVANCED(INTERVALL, "CHECK INTERVAL", "Time between checks in 1/10 of seconds.");
272
273                DEFINE_SETTING_S(FORCE_LANGUAGE, CHECK_SYSTEM_SECTION, "locale", "auto");
274                DESCRIBE_SETTING_ADVANCED(FORCE_LANGUAGE, "FORCE LOCALE", "Set this to a locale ID if you want to force auto-detection of counters from that locale.");
275               
276                DEFINE_PATH(COUNTERS_SECTION, CHECK_SYSTEM_COUNTERS_SECTION);
277                DESCRIBE_SETTING_ADVANCED(COUNTERS_SECTION, "PDH COUNTERS", "Section to define PDH counters to use");
278
279                DEFINE_SETTING_S(PDH_MEM_CMT_LIM, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit limit", "\\Memory\\Commit Limit");
280                DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_LIM, "PDH COUNTER", "Counter to use to check upper memory limit.");
281
282                DEFINE_SETTING_S(PDH_MEM_CMT_BYT, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit byte", "\\Memory\\Committed Bytes");
283                DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_BYT, "PDH COUNTER", "Counter to use to check current memory usage.");
284
285                DEFINE_SETTING_S(PDH_SYSUP, CHECK_SYSTEM_COUNTERS_SECTION, "system uptime", "\\System\\System Up Time");
286                DESCRIBE_SETTING_ADVANCED(PDH_SYSUP, "PDH COUNTER", "Counter to use to check the uptime of the system.");
287
288                DEFINE_SETTING_S(PDH_CPU, CHECK_SYSTEM_COUNTERS_SECTION, "processor time", "\\Processor(_total)\\% Processor Time");
289                DESCRIBE_SETTING_ADVANCED(PDH_CPU, "PDH COUNTER", "Counter to use for CPU load.");
290
291                DEFINE_PATH(SERVICES_SECTION, CHECK_SYSTEM_SERVICES_SECTION);
292                DESCRIBE_SETTING_ADVANCED(SERVICES_SECTION, "SERVICE CHECKS", "Section to define service checks to use");
293
294                DEFINE_SETTING_S(SVC_BOOT_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_BOOT_START", "ignored");
295                DESCRIBE_SETTING_ADVANCED(SVC_BOOT_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");
296
297                DEFINE_SETTING_S(SVC_SYSTEM_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_SYSTEM_START", "ignored");
298                DESCRIBE_SETTING_ADVANCED(SVC_SYSTEM_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");
299
300                DEFINE_SETTING_S(SVC_AUTO_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_AUTO_START", "started");
301                DESCRIBE_SETTING_ADVANCED(SVC_AUTO_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");
302
303                DEFINE_SETTING_S(SVC_DEMAND_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DEMAND_START", "ignored");
304                DESCRIBE_SETTING_ADVANCED(SVC_DEMAND_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");
305
306                DEFINE_SETTING_S(SVC_DISABLED, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DISABLED", "stopped");
307                DESCRIBE_SETTING_ADVANCED(SVC_DISABLED, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");
308
309
310        }
311
312        namespace nsca {
313                DEFINE_PATH(SECTION, NSCA_SECTION);
314                DESCRIBE_SETTING(SECTION, "NSCA SECTION", "Section for NSCA passive check module.");
315
316                DEFINE_SETTING_I(INTERVAL, NSCA_SECTION, "interval", 60);
317                DESCRIBE_SETTING(INTERVAL, "COMMAND TIMEOUT", "Time in seconds between each report back to the server (cant as of yet be set individually so this is for all \"checks\")");
318
319                DEFINE_SETTING_S(HOSTNAME, NSCA_SECTION, "hostname", "");
320                DESCRIBE_SETTING_ADVANCED(HOSTNAME, "LOCAL HOSTNAME", "The host name of this host if set to blank (default) the windows name of the computer will be used.");
321
322                DEFINE_PATH(SERVER_SECTION, NSCA_SERVER_SECTION);
323                DESCRIBE_SETTING(SERVER_SECTION, "NSCA SERVER SECTION", "Configure the NSCA server to report to");
324
325                DEFINE_SETTING_S(SERVER_HOST, NSCA_SERVER_SECTION, "host", "unknown-host");
326                DESCRIBE_SETTING(SERVER_HOST, "NSCA SERVER", "The NSCA/Nagios(?) server to report results to.");
327
328                DEFINE_SETTING_I(SERVER_PORT, NSCA_SERVER_SECTION, "port", 5667);
329                DESCRIBE_SETTING(SERVER_PORT, "NSCA PORT", "The NSCA server port");
330
331                DEFINE_SETTING_I(ENCRYPTION, NSCA_SERVER_SECTION, "encryption method", 1);
332                DESCRIBE_SETTING(ENCRYPTION, "NSCA ENCRYPTION", "Number corresponding to the various encryption algorithms (see the wiki). Has to be the same as the server or it wont work at all.");
333
334                DEFINE_SETTING_S(PASSWORD, NSCA_SERVER_SECTION, "password", "");
335                DESCRIBE_SETTING(PASSWORD, "NSCA PASSWORD", "The password to use. Again has to be the same as the server or it wont work at all.");
336
337                DEFINE_SETTING_I(THREADS, NSCA_SECTION, "debug threads", 1);
338                DESCRIBE_SETTING_ADVANCED(THREADS, "DEBUG OPTION (THREADS)", "Number of threads to run, no reason to change this really (unless you want to stress test something)");
339
340                DEFINE_SETTING_B(CACHE_HOST, NSCA_SECTION, "cache hostname", false);
341                DESCRIBE_SETTING_ADVANCED(CACHE_HOST, "CACHE HOSTNAME", "???");
342
343                DEFINE_PATH(CMD_SECTION, NSCA_CMD_SECTION);
344                DESCRIBE_SETTING(CMD_SECTION, "NSCA COMMAND SECTION", "Commands to check and report to the NSCA server");
345
346                DEFINE_SETTING_S(REPORT_MODE, NSCA_SERVER_SECTION, "report", "all");
347                DESCRIBE_SETTING(REPORT_MODE, "REPORT MODE", "What to report to the server (any of the following: all, critical, warning, unknown, ok)");
348
349                DEFINE_SETTING_S(TIME_DELTA_DEFAULT, NSCA_SECTION, "delay", "0");
350                DESCRIBE_SETTING(TIME_DELTA_DEFAULT, "TODO", "TODO");
351               
352                DEFINE_SETTING_I(PAYLOAD_LENGTH, NSCA_SECTION, "payload length", 512);
353                DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NSCA agent. This is a hard specific value so you have to \"configure\" (read recompile) your NSCA server to use the same value for it to work.");
354
355                DEFINE_SETTING_I(READ_TIMEOUT, NSCA_SERVER_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
356                DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");
357
358        }
359
360        namespace task_scheduler {
361                DEFINE_PATH(SECTION, TASK_SCHED_SECTION);
362                DESCRIBE_SETTING_ADVANCED(SECTION, "TASK SCHEDULER", "???");
363
364                DEFINE_SETTING_S(SYNTAX, TASK_SCHED_SECTION, "syntax", "%title% last run: %most-recent-run-time% (%exit-code%)");
365                DESCRIBE_SETTING_ADVANCED(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one)");
366        }
367
368        namespace lua {
369                DEFINE_PATH(SECTION, LUA_SECTION);
370                DESCRIBE_SETTING_ADVANCED(SECTION, "LUA SECTION", "A list of LUA script to load at startup. In difference to \"external checks\" all LUA scripts are loaded at startup. Names have no meaning since the script (on boot) submit which commands are available and tie that to various functions.");
371        }
372
373        namespace log {
374                DEFINE_PATH(SECTION, LOG_SECTION);
375                DESCRIBE_SETTING_ADVANCED(SECTION, "LOG SECTION", "Configure loggning properties.");
376
377                DEFINE_SETTING_S(FILENAME, LOG_SECTION, "file", "nsclient.log");
378                DESCRIBE_SETTING_ADVANCED(FILENAME, "SYNTAX", "The file to write log data to. If no directory is used this is relative to the NSClient++ binary.");
379
380                DEFINE_SETTING_S(ROOT, LOG_SECTION, "root", "auto");
381                DESCRIBE_SETTING_ADVANCED(ROOT, "TODO", "TODO");
382
383                DEFINE_SETTING_S(DATEMASK, LOG_SECTION, "date format", "%Y-%m-%d %H:%M:%S");
384                DESCRIBE_SETTING_ADVANCED(DATEMASK, "DATEMASK", "The date format used when logging to a file.");
385
386                DEFINE_SETTING_B(DEBUG_LOG, LOG_SECTION, "debug", false);
387                DESCRIBE_SETTING_ADVANCED(DEBUG_LOG, "DEBUG LOGGING", "Enable debug logging can help track down errors and find problems but will impact overall perfoamnce negativly.");
388        }
389}
Note: See TracBrowser for help on using the repository browser.