source: nscp/include/settings/macros.h @ 5e12ba6

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

Various minor changes (NOT BUILDING PROPERLY)

  • Property mode set to 100644
File size: 27.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 EXTSCRIPT_WRAPPINGS_SECTION "/settings/external scripts/wrappings"
82#define EXTSCRIPT_WRAPPED_SCRIPT "/settings/external scripts/wrapped scripts"
83#define CHECK_SYSTEM_SECTION "/settings/system"
84#define CHECK_SYSTEM_COUNTERS_SECTION "/settings/system/PDH counters"
85#define CHECK_SYSTEM_SERVICES_SECTION "/settings/system/services"
86#define NSCA_SECTION "/settings/NSCA"
87#define SCHEDULER_SECTION "/settings/scheduler"
88#define SCHEDULER_SECTION_SCH "/settings/scheduler/schedules"
89#define SCHEDULER_SECTION_FAKE "/settings/scheduler/schedules/<schedule name>"
90#define SCHEDULER_SECTION_DEF "/settings/scheduler/default"
91#define NSCA_SERVER_SECTION "/settings/NSCA/server"
92#define NSCA_CMD_SECTION "/settings/NSCA/server/commands"
93#define TASK_SCHED_SECTION "/settings/Task Scheduler"
94#define LUA_SECTION "/settings/Lua/script"
95#define LOG_SECTION "/settings/log"
96
97#define CHECK_DISK_SECTION "/settings/check/disk"
98
99        namespace settings_def {
100                DEFINE_SETTING_I(PAYLOAD_LEN, DEFAULT_SECTION, "payload length", 4096);
101                DESCRIBE_SETTING(PAYLOAD_LEN, "PAYLOAD LENGTH", "...");
102
103                DEFINE_SETTING_B(SHARED_SESSION, DEFAULT_SECTION, "shared session", true);
104                DESCRIBE_SETTING(SHARED_SESSION, "SHARED SESSION", "TODO");
105
106                DEFINE_SETTING_S(SYSTRAY_EXE, DEFAULT_SECTION, "systray_exe", "nstray.exe");
107                DESCRIBE_SETTING(SYSTRAY_EXE, "TODO", "TODO");
108        }
109
110        // NSClient Setting headlines
111        namespace nsclient {
112                DEFINE_PATH(SECTION, NSCLIENT_SECTION);
113                DESCRIBE_SETTING(SECTION, "NSCLIENT SECTION", "Section for NSClient (NSClientListsner.dll) (check_nt) protocol options.");
114
115                DEFINE_SETTING_S(ALLOWED_HOSTS, NSCLIENT_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");
116                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.");
117
118                DEFINE_SETTING_I(PORT, NSCLIENT_SECTION, "port", 12489);
119                DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");
120
121                DEFINE_SETTING_S(BINDADDR, NSCLIENT_SECTION, GENERIC_KEY_BIND_TO, "");
122                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.");
123
124                DEFINE_SETTING_I(READ_TIMEOUT, NSCLIENT_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
125                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.");
126
127                DEFINE_SETTING_I(LISTENQUE, NSCLIENT_SECTION, GENERIC_KEY_SOCK_LISTENQUE, 0);
128                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.");
129
130                DEFINE_SETTING_S(VERSION, NSCLIENT_SECTION, "version", "auto");
131                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++");
132
133                DEFINE_SETTING_B(CACHE_ALLOWED, NSCLIENT_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
134                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
135
136                DEFINE_SETTING_S(MASTER_KEY, NSCLIENT_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");
137                DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");
138
139                DEFINE_SETTING_S(PWD, NSCLIENT_SECTION, GENERIC_KEY_PWD, "");
140                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.");
141
142                DEFINE_SETTING_S(OBFUSCATED_PWD, NSCLIENT_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");
143                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.");
144
145        }
146
147        // NSClient Setting headlines
148        namespace nrpe {
149                DEFINE_PATH(SECTION, NRPE_SECTION_PROTOCOL);
150                //DESCRIBE_SETTING(SECTION, "NRPE SECTION", "Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.");
151
152               
153                DEFINE_PATH(CH_SECTION, NRPE_CLIENT_HANDLER_SECTION);
154                DESCRIBE_SETTING(CH_SECTION, "CLIENT HANDLER SECTION", "...");
155
156                DEFINE_SETTING_S(ALLOWED_HOSTS, NRPE_SECTION_PROTOCOL, GENERIC_KEY_ALLOWED_HOSTS, "");
157                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.");
158
159                DEFINE_SETTING_I(PORT, NRPE_SECTION_PROTOCOL, "port", 5666);
160                //DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");
161
162                DEFINE_SETTING_S(BINDADDR, NRPE_SECTION_PROTOCOL, GENERIC_KEY_BIND_TO, "");
163                //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.");
164
165                DEFINE_SETTING_I(READ_TIMEOUT, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
166                //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.");
167
168                DEFINE_SETTING_I(LISTENQUE, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_LISTENQUE, 0);
169                //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.");
170
171                DEFINE_SETTING_I(THREAD_POOL, NRPE_SECTION_PROTOCOL, "thread pool", 10);
172                //DESCRIBE_SETTING_ADVANCED(THREAD_POOL, "THREAD POOL", "");
173
174               
175
176                DEFINE_SETTING_B(CACHE_ALLOWED, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
177                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
178
179                DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true);
180                //DESCRIBE_SETTING(KEYUSE_SSL, "USE SSL SOCKET", "This option controls if SSL should be used on the socket.");
181
182                DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024);
183                //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.");
184
185                DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true);
186                //DESCRIBE_SETTING_ADVANCED(ALLOW_PERFDATA, "PERFORMANCE DATA", "Send performance data back to nagios (set this to 0 to remove all performance data).");
187
188                DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60);
189                //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.");
190
191                DEFINE_SETTING_B(ALLOW_ARGS, NRPE_SECTION, "allow arguments", false);
192                //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.");
193
194                DEFINE_SETTING_B(ALLOW_NASTY, NRPE_SECTION, "allow nasy characters", false);
195                //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.");
196
197        }
198
199        namespace protocol_def {
200                DEFINE_SETTING_S(ALLOWED_HOSTS, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");
201                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");
202
203                DEFINE_SETTING_B(CACHE_ALLOWED, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);
204                DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");
205
206                DEFINE_SETTING_S(MASTER_KEY, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");
207                DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");
208
209                DEFINE_SETTING_S(PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD, "");
210                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.");
211
212                DEFINE_SETTING_S(OBFUSCATED_PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");
213                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.");
214        }
215        namespace event_log {
216                DEFINE_PATH(SECTION, EVENT_LOG_SECTION);
217                //DESCRIBE_SETTING(SECTION, "EVENT LOG SECTION", "Section for the EventLog Checker (CHeckEventLog.dll).");
218
219                DEFINE_SETTING_B(DEBUG_KEY, EVENT_LOG_SECTION, "debug", false);
220                //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.");
221
222                DEFINE_SETTING_B(LOOKUP_NAMES, EVENT_LOG_SECTION, "lookup_names", false);
223                //DESCRIBE_SETTING_ADVANCED(LOOKUP_NAMES, "TODO", "TODO");
224
225                DEFINE_SETTING_S(SYNTAX, EVENT_LOG_SECTION, "syntax", "");
226                //DESCRIBE_SETTING(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one).");
227
228                DEFINE_SETTING_I(BUFFER_SIZE, EVENT_LOG_SECTION, "buffer_size", 65535);
229                //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.");
230        }
231
232        namespace external_scripts {
233                DEFINE_PATH(SECTION, EXTSCRIPT_SECTION);
234                //DESCRIBE_SETTING(SECTION, "EXTERNAL SCRIPT SECTION", "Section for external scripts (CheckExternalScripts.dll).");
235
236                DEFINE_SETTING_I(TIMEOUT, EXTSCRIPT_SECTION, "timeout", 60);
237                //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.");
238
239                DEFINE_SETTING_B(ALLOW_ARGS, EXTSCRIPT_SECTION, "allow arguments", false);
240                //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.");
241
242                DEFINE_SETTING_B(ALLOW_NASTY, EXTSCRIPT_SECTION, "allow nasy characters", false);
243                //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.");
244
245                DEFINE_SETTING_S(SCRIPT_PATH, EXTSCRIPT_SECTION, "script path", "");
246                //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 :)");
247
248                DEFINE_PATH(SCRIPT_SECTION, EXTSCRIPT_SCRIPT_SECTION);
249                //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:");
250
251                DEFINE_PATH(ALIAS_SECTION, EXTSCRIPT_ALIAS_SECTION);
252                //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)");
253
254                DEFINE_PATH(WRAPPINGS_SECTION, EXTSCRIPT_WRAPPINGS_SECTION);
255                //DESCRIBE_SETTING(WRAPPINGS_SECTION, "EXTERNAL SCRIPT WRAPPINGS SECTION", "");
256
257                DEFINE_PATH(WRAPPED_SCRIPT, EXTSCRIPT_WRAPPED_SCRIPT);
258                //DESCRIBE_SETTING(WRAPPED_SCRIPT, "EXTERNAL SCRIPT WRAPPINGS SECTION", "");
259
260        }
261
262        namespace check_system {
263
264                DEFINE_PATH(SECTION, CHECK_SYSTEM_SECTION);
265                DESCRIBE_SETTING(SECTION, "SYSTEM", "Section for system checks and system settings.");
266
267                DEFINE_SETTING_S(PROC_ENUM, CHECK_SYSTEM_SECTION, "process enumeration method", "auto");
268                DESCRIBE_SETTING_ADVANCED(PROC_ENUM, "COMMAND TIMEOUT", "Set the PROCESS enumeration method (auto, TOOLHELP or PSAPI)");
269                const std::wstring PROC_ENUM_PSAPI = _T("PSAPI");
270                const std::wstring PROC_ENUM_TH = _T("TOOLHELP");
271
272                DEFINE_SETTING_S(CPU_METHOD, CHECK_SYSTEM_SECTION, "method", "PDH_AUTO");
273                DESCRIBE_SETTING_ADVANCED(CPU_METHOD, "CPU METHOD", "Set this to false to disable auto detect (counters.defs) PDH language and OS version.");
274                const std::wstring CPU_METHOD_PDH_MANUAL = _T("PDH_MANUAL");
275                const std::wstring CPU_METHOD_PDH_AUTO = _T("PDH_AUTO");
276                const std::wstring CPU_METHOD_PDH_NO_INDEX = _T("PDH_NO_INDEX");
277
278                DEFINE_SETTING_S(BUFFER_SIZE, CHECK_SYSTEM_SECTION, "buffer size", "1h");
279                DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", "  The time to store CPU load data.");
280
281                DEFINE_SETTING_I(INTERVALL, CHECK_SYSTEM_SECTION, "interval", 10);
282                DESCRIBE_SETTING_ADVANCED(INTERVALL, "CHECK INTERVAL", "Time between checks in 1/10 of seconds.");
283
284                DEFINE_SETTING_S(FORCE_LANGUAGE, CHECK_SYSTEM_SECTION, "locale", "auto");
285                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.");
286               
287                DEFINE_PATH(COUNTERS_SECTION, CHECK_SYSTEM_COUNTERS_SECTION);
288                DESCRIBE_SETTING_ADVANCED(COUNTERS_SECTION, "PDH COUNTERS", "Section to define PDH counters to use");
289
290                DEFINE_SETTING_S(PDH_MEM_CMT_LIM, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit limit", "\\Memory\\Commit Limit");
291                DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_LIM, "PDH COUNTER", "Counter to use to check upper memory limit.");
292
293                DEFINE_SETTING_S(PDH_MEM_CMT_BYT, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit byte", "\\Memory\\Committed Bytes");
294                DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_BYT, "PDH COUNTER", "Counter to use to check current memory usage.");
295
296                DEFINE_SETTING_S(PDH_SYSUP, CHECK_SYSTEM_COUNTERS_SECTION, "system uptime", "\\System\\System Up Time");
297                DESCRIBE_SETTING_ADVANCED(PDH_SYSUP, "PDH COUNTER", "Counter to use to check the uptime of the system.");
298
299                DEFINE_SETTING_S(PDH_CPU, CHECK_SYSTEM_COUNTERS_SECTION, "processor time", "\\Processor(_total)\\% Processor Time");
300                DESCRIBE_SETTING_ADVANCED(PDH_CPU, "PDH COUNTER", "Counter to use for CPU load.");
301
302                //DEFINE_PATH(SERVICES_SECTION, CHECK_SYSTEM_SERVICES_SECTION);
303                //DESCRIBE_SETTING_ADVANCED(SERVICES_SECTION, "SERVICE CHECKS", "Section to define service checks to use");
304
305                //DEFINE_SETTING_S(SVC_BOOT_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_BOOT_START", "ignored");
306                //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");
307
308                //DEFINE_SETTING_S(SVC_SYSTEM_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_SYSTEM_START", "ignored");
309                //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");
310
311                //DEFINE_SETTING_S(SVC_AUTO_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_AUTO_START", "started");
312                //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");
313
314                //DEFINE_SETTING_S(SVC_DEMAND_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DEMAND_START", "ignored");
315                //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");
316
317                //DEFINE_SETTING_S(SVC_DISABLED, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DISABLED", "stopped");
318                //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");
319
320                DEFINE_SETTING_S(PDH_SUBSYSTEM, CHECK_SYSTEM_SECTION, "pdh_subsystem", "fast");
321                DESCRIBE_SETTING_ADVANCED(PDH_SUBSYSTEM, "PDH_SUBSYSTEM", "TODO");
322                const std::wstring PDH_SUBSYSTEM_FAST = _T("fast");
323                const std::wstring PDH_SUBSYSTEM_THREAD_SAFE = _T("thread-safe");
324
325        }
326
327        namespace nsca {
328                DEFINE_PATH(SECTION, NSCA_SECTION);
329                //DESCRIBE_SETTING(SECTION, "NSCA SECTION", "Section for NSCA passive check module.");
330
331                DEFINE_SETTING_I(INTERVAL, NSCA_SECTION, "interval", 60);
332                //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\")");
333
334                DEFINE_SETTING_S(HOSTNAME, NSCA_SECTION, "hostname", "");
335                //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.");
336
337                DEFINE_PATH(SERVER_SECTION, NSCA_SERVER_SECTION);
338                //DESCRIBE_SETTING(SERVER_SECTION, "NSCA SERVER SECTION", "Configure the NSCA server to report to");
339
340                DEFINE_SETTING_S(SERVER_HOST, NSCA_SERVER_SECTION, "host", "unknown-host");
341                //DESCRIBE_SETTING(SERVER_HOST, "NSCA SERVER", "The NSCA/Nagios(?) server to report results to.");
342
343                DEFINE_SETTING_I(SERVER_PORT, NSCA_SERVER_SECTION, "port", 5667);
344                //DESCRIBE_SETTING(SERVER_PORT, "NSCA PORT", "The NSCA server port");
345
346                DEFINE_SETTING_I(ENCRYPTION, NSCA_SERVER_SECTION, "encryption method", 1);
347                //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.");
348
349                DEFINE_SETTING_S(PASSWORD, NSCA_SERVER_SECTION, "password", "");
350                //DESCRIBE_SETTING(PASSWORD, "NSCA PASSWORD", "The password to use. Again has to be the same as the server or it wont work at all.");
351
352                DEFINE_SETTING_I(THREADS, NSCA_SECTION, "debug threads", 1);
353                //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)");
354
355                DEFINE_SETTING_B(CACHE_HOST, NSCA_SECTION, "cache hostname", false);
356                //DESCRIBE_SETTING_ADVANCED(CACHE_HOST, "CACHE HOSTNAME", "???");
357
358                DEFINE_PATH(CMD_SECTION, NSCA_CMD_SECTION);
359                //DESCRIBE_SETTING(CMD_SECTION, "NSCA COMMAND SECTION", "Commands to check and report to the NSCA server");
360
361                DEFINE_SETTING_S(REPORT_MODE, NSCA_SERVER_SECTION, "report", "all");
362                //DESCRIBE_SETTING(REPORT_MODE, "REPORT MODE", "What to report to the server (any of the following: all, critical, warning, unknown, ok)");
363
364                DEFINE_SETTING_S(TIME_DELTA_DEFAULT, NSCA_SECTION, "delay", "0");
365                //DESCRIBE_SETTING(TIME_DELTA_DEFAULT, "TODO", "TODO");
366
367                DEFINE_SETTING_I(PAYLOAD_LENGTH, NSCA_SECTION, "payload length", 512);
368                //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.");
369
370                DEFINE_SETTING_I(READ_TIMEOUT, NSCA_SERVER_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);
371                //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.");
372
373        }
374
375        namespace scheduler {
376                DEFINE_PATH(SECTION, SCHEDULER_SECTION);
377                DESCRIBE_SETTING(SECTION, "SCHEDULER SECTION", "Section for the Scheduler module.");
378
379                DEFINE_PATH(SCHEDULES_SECTION, SCHEDULER_SECTION_SCH);
380                DESCRIBE_SETTING(SCHEDULES_SECTION, "SCHEDULES SECTION", "Section for defining schedules for the Scheduler module.");
381
382                DEFINE_PATH(DEFAULT_SCHEDULE_SECTION, SCHEDULER_SECTION_DEF);
383                DESCRIBE_SETTING(DEFAULT_SCHEDULE_SECTION, "DEFAULT SCHEDULER SECTION", "Default settings for all scheduled commands");
384
385                DEFINE_SETTING_I(THREADS, SCHEDULER_SECTION, "debug threads", 1);
386                DESCRIBE_SETTING_ADVANCED(THREADS, "THREADS", "Number of threads to use int he thread pool (increase if you have many scheduled items)");
387
388                DEFINE_SETTING_S(INTERVAL, SCHEDULER_SECTION_FAKE, "interval", "5m");
389                DESCRIBE_SETTING(INTERVAL, "SCHEDULE INTERVAL", "Time in seconds between each check");
390
391                DEFINE_SETTING_S(COMMAND, SCHEDULER_SECTION_FAKE, "command", "check_ok");
392                DESCRIBE_SETTING(COMMAND, "SCHEDULE COMMAND", "Command to run");
393
394                DEFINE_SETTING_S(CHANNEL, SCHEDULER_SECTION_FAKE, "channel", "NSCA");
395                DESCRIBE_SETTING(CHANNEL, "SCHEDULE CHANNEL", "Channel to send results on");
396
397                DEFINE_SETTING_S(REPORT_MODE, SCHEDULER_SECTION_FAKE, "report", "all");
398                DESCRIBE_SETTING(REPORT_MODE, "REPORT MODE", "What to report to the server (any of the following: all, critical, warning, unknown, ok)");
399
400                DEFINE_SETTING_S(INTERVAL_D, SCHEDULER_SECTION_DEF, "interval", "5m");
401                DESCRIBE_SETTING(INTERVAL_D, "SCHEDULE INTERVAL", "Time in seconds between each check");
402
403                DEFINE_SETTING_S(COMMAND_D, SCHEDULER_SECTION_DEF, "command", "check_ok");
404                DESCRIBE_SETTING(COMMAND_D, "SCHEDULE COMMAND", "Command to run");
405
406                DEFINE_SETTING_S(CHANNEL_D, SCHEDULER_SECTION_DEF, "channel", "NSCA");
407                DESCRIBE_SETTING(CHANNEL_D, "SCHEDULE CHANNEL", "Channel to send results on");
408
409                DEFINE_SETTING_S(REPORT_MODE_D, SCHEDULER_SECTION_DEF, "report", "all");
410                DESCRIBE_SETTING(REPORT_MODE_D, "REPORT MODE", "What to report to the server (any of the following: all, critical, warning, unknown, ok)");
411
412        }
413
414        namespace task_scheduler {
415                DEFINE_PATH(SECTION, TASK_SCHED_SECTION);
416                DESCRIBE_SETTING_ADVANCED(SECTION, "TASK SCHEDULER", "???");
417
418                DEFINE_SETTING_S(SYNTAX, TASK_SCHED_SECTION, "syntax", "%title% last run: %most-recent-run-time% (%exit-code%)");
419                DESCRIBE_SETTING_ADVANCED(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one)");
420        }
421
422        namespace lua {
423                DEFINE_PATH(SECTION, LUA_SECTION);
424                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.");
425        }
426
427        namespace log {
428                DEFINE_PATH(SECTION, LOG_SECTION);
429                //DESCRIBE_SETTING_ADVANCED(SECTION, "LOG SECTION", "Configure loggning properties.");
430
431                DEFINE_SETTING_S(FILENAME, LOG_SECTION, "file", "nsclient.log");
432                //DESCRIBE_SETTING_ADVANCED(FILENAME, "SYNTAX", "The file to write log data to. If no directory is used this is relative to the NSClient++ binary.");
433
434                DEFINE_SETTING_S(ROOT, LOG_SECTION, "root", "auto");
435                //DESCRIBE_SETTING_ADVANCED(ROOT, "TODO", "TODO");
436
437                DEFINE_SETTING_S(DATEMASK, LOG_SECTION, "date format", "%Y-%m-%d %H:%M:%S");
438                //DESCRIBE_SETTING_ADVANCED(DATEMASK, "DATEMASK", "The date format used when logging to a file.");
439
440                DEFINE_SETTING_S(LOG_MASK, LOG_SECTION, "log mask", "normal");
441                //DESCRIBE_SETTING_ADVANCED(LOG_MASK, "LOG MASK", "The log mask information, error, warning, critical, debug");
442
443                DEFINE_SETTING_B(DEBUG_LOG, LOG_SECTION, "debug", false);
444                //DESCRIBE_SETTING_ADVANCED(DEBUG_LOG, "DEBUG LOGGING", "Enable debug logging can help track down errors and find problems but will impact overall perfoamnce negativly.");
445        }
446}
Note: See TracBrowser for help on using the repository browser.