Nagios config file syntax

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
SandraLewisFrin
Posts: 15
Joined: Fri Feb 18, 2022 4:44 am

Nagios config file syntax

Post by SandraLewisFrin »

Hi

I need to know the name of Nagios config files syntax, and how to parsing.

An example of Nagios host define.

define host {
host_name bogus-router
alias Bogus Router #1
address 192.168.1.254
parents server-backbone
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups router-admins
notification_interval 30
notification_period 24x7
notification omegle shagle voojio_options d,u,r
}
Thanks.
Last edited by SandraLewisFrin on Fri Jun 17, 2022 6:57 am, edited 1 time in total.
PaulRajeshMEzra45
Posts: 11
Joined: Wed Feb 16, 2022 2:47 am

Re: Nagios config file syntax

Post by PaulRajeshMEzra45 »

That's not an example of the Nagios configuration file. The Nagios configuration file (nagios.cfg) has an INI file syntax, i.e. name=value (but no sections).

The example you give is a Nagios object configuration file (referred to via cfg_file in the above config file), but I'm not sure what you're asking. The "name" of the syntax? I'm pretty sure it's not a standard syntax but simply "the" Nagios object syntax. In its simplest form, it's

define [object type] {
attribute value
}
New lines separate attributes. The attribute never contains spaces, but the value may, depending on the attribute. Some attributes also take multiple values (like notification_options).
Locked