|
NAMEnsca-ng.cfg - NSCA-ng server configuration fileSYNOPSIS/usr/local/etc/nsca-ng.cfgDESCRIPTIONThe nsca-ng(8) process reads configuration data from the file specified with -c on the command line or from /usr/local/etc/nsca-ng.cfg.File FormatZero or more global settings and one or more authorizations must be defined in the configuration file (see the Global Settings subsection and the Authorizations subsection, respectively). They may appear in arbitrary order. An authorization is specified using the authorize keyword followed by a (possibly quoted) client identity string and a brace-enclosed block of corresponding authorization settings. However, an authorization setting may also be specified as a global setting outside of these authorize sections. In this case, it serves as a global fallback for authorization sections that don't define the setting in question.Global settings and authorization settings are defined by specifying a variable name followed by an equals sign (“=”) and a value (or possibly a list of values). Values can be strings, integers, or floating-point numbers. Strings have to be enclosed in single or double quotes if they contain whitespace characters, hash mark characters, or literal quotation marks. Otherwise, quoting is optional. To specify a literal single or double quote in a string, either escape it by preceding it with a backslash (“\”) or quote the string using the other quote character. A literal backslash must be preceded with a second backslash if the string is enclosed in double quotes. A variable can be set to the value of an environment variable by specifying ${FOO}, where FOO is the name of the environment variable. The same can be done by specifying ${FOO:-bar}, except that in this case, the value bar will be assigned when the environment variable FOO is not set. Any whitespace surrounding tokens is ignored. Empty lines and comments are also ignored. Comments are introduced with a hash mark character (“#”) and span to the end of the line. If the last character of a line is a backslash (“\”), the subsequent line is treated as a continuation of the current line (and the backslash is otherwise ignored). The special directive include("file") tells nsca-ng(8) to treat the contents of the specified file as if those contents had appeared at the point where this directive appears. If a directory is specified instead of a file, all files with a .cfg or .conf extension in this directory and all subdirectories will be included. Symbolic links are followed. In the following subsections, the type of each value is denoted after an equals sign in angle brackets. Global SettingsThe nsca-ng(8) server recognizes the following global variables.
AuthorizationsAs mentioned above, an authorization section is introduced with the authorize keyword and a client identity field followed by a brace-delimited block of one or more authorization settings. A client provides its identity during the connection handshake. The server uses the provided identity string for looking up the authorize section applicable to the client. The corresponding section, if any, defines the authentication and authorization settings for the client in question. If no section explicitly defined for this client identity is found, but a section for the special client identity "*" (including the quotes) is defined, this section is used as a fallback. Note that no other wildcard characters are available, and that the “*” character has no special meaning in the client identity field except when specified exactly as described.Within the brace-delimited block of an authorization section, values may be assigned to the variables listed below. The pattern strings assigned to the commands, hosts, and services variables are POSIX “extended” regular expressions, but with an implicit “^” at the beginning and “$” at the end of the patterns. Multiple patterns can be specified as a brace-enclosed, comma-separated list; check results and commands will then be accepted if they match any of the specified patterns. Commands and check results will be rejected unless these settings authorize the client to submit them.
EXAMPLESThe /usr/local/etc/nsca-ng.cfg file might look similar to the following example.user = "nagios" chroot = "/var/nagios" # Other paths are relative to this one! command_file = "/rw/nagios.cmd" pid_file = "/run/nsca-ng.pid" temp_directory = "/dev/shm" listen = "monitoring.example.com:5668" tls_ciphers = "PSK-AES256-CBC-SHA" log_level = 3 max_command_size = 65536 max_queue_size = 128 timeout = 15.0 # # Authenticated "root" clients may submit arbitrary check # results and any other monitoring commands (see: # <http://nagios.org/developerinfo/externalcommands/>). # authorize "root" { password = "g3m25sMCUAO4NecZGld1H4xcJ9uDWvhH" commands = ".*" } # # Authenticated "checker" clients may submit arbitrary check # results, but no other commands. # authorize "checker" { password = "ilzNanlE9XjMLdjrMkXnk09XBCTFQrj5" hosts = ".*" services = ".*" } # # Authenticated "web-checker" clients may submit check results # for arbitrary services on hosts whose names begin with "www". # authorize "web-checker" { password = "m2uaIWwiq3AIqN55m3QdjwptkU1Q4Oov" services = ".+@www.*" } # # Authenticated "nsca-checker" clients may talk to the NSCA-ng # server, but may not submit anything to Nagios. # authorize "nsca-checker" { password = "ceOKwxpz14lKXroC4yUjJZbov6VAyKuT" } # # Other authenticated clients may submit check results for the # "disk", "swap", and "load" services on arbitrary hosts. # authorize "*" { password = "awHW5vxr3DcA9EvcUC9T3a90QfEexsWd" services = { "disk", "swap", "load" } } CAVEATSPlease set the permissions appropriately to make sure that only authorized users can access the /usr/local/etc/nsca-ng.cfg file.SEE ALSOnsca-ng(8), send_nsca(8), send_nsca.cfg(5), regex(7)http://www.nagios.org/developerinfo/externalcommands/ AUTHORHolger Weiss <holger@weiss.in-berlin.de>
Visit the GSP FreeBSD Man Page Interface. |