When adding a service on the Nagios Web Interface, a serviec configuration file is created in
/usr/local/nagios/etc/services directory. A comment in this file warns "DO NOT EDIT THIS FILE BY HAND" and says that "Nagios CCM will overwrite all manual settings during the next update if you would like to edit files manually". My questions are:
1) when adding a service on the Nagios Web GUI, besides a service configuration file is created in
/usr/local/nagios/etc/services directory, is this service configuration information also stored in the mySQL database or PostgreSQL database?
2) Where does Nagios CCM get the "original" (service) configuration settings to overwrite all the manual setting changes?
3) What causes Nagios CCM to run and overwrite all the manual setting changes? When I click "Save Configuration" or by some kind of mechanism within Nagios CCM?
Thank you in advance.
Service configuration files
Re: Service configuration files
To clarify - when you make changes in the Web GUI, those changes are stored in a MySQL database. When you 'Apply Configuration', your changes are then written out into flat files in the /usr/local/nagios/etc/services directory (among other directories).1) when adding a service on the Nagios Web GUI, besides a service configuration file is created in
/usr/local/nagios/etc/services directory, is this service configuration information also stored in the mySQL database or PostgreSQL database?
From the mentioned MySQL database.2) Where does Nagios CCM get the "original" (service) configuration settings to overwrite all the manual setting changes?
When applying configuration, if Nagios notices a change between what is stored in the database and what is stored in a flat file, the flat file is erased and replaced by a newly generated flat file.3) What causes Nagios CCM to run and overwrite all the manual setting changes? When I click "Save Configuration" or by some kind of mechanism within Nagios CCM?
If you want to define configurations by hand, you may do so in the static directory. https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: Service configuration files
Thanks for the quick response and very helpful inforation/inside on how things work regarding adding/changing services.
You mentioned that "When you 'Apply Configuration', your changes are then written out into flat files in the /usr/local/nagios/etc/services directory (among other directories)." What other diretories are the changes to a service written to?
Where are those alarm thresholds saved and "checked" to trigger an alarm/event if the thresholds are exceeded and alarm condition is met when the Nagios XI receives the status data from a Nagios agent (say NRPE)? In the service configuration or in my SQL database?
Thanks for your time and help!
You mentioned that "When you 'Apply Configuration', your changes are then written out into flat files in the /usr/local/nagios/etc/services directory (among other directories)." What other diretories are the changes to a service written to?
Where are those alarm thresholds saved and "checked" to trigger an alarm/event if the thresholds are exceeded and alarm condition is met when the Nagios XI receives the status data from a Nagios agent (say NRPE)? In the service configuration or in my SQL database?
Thanks for your time and help!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Service configuration files
# OBJECTS EXPORTED FROM NAGIOSQLxlin125 wrote: You mentioned that "When you 'Apply Configuration', your changes are then written out into flat files in the /usr/local/nagios/etc/services directory (among other directories)." What other diretories are the changes to a service written to?
cfg_file=/usr/local/nagios/etc/contacttemplates.cfg
cfg_file=/usr/local/nagios/etc/contactgroups.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/commands.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/servicegroups.cfg
cfg_file=/usr/local/nagios/etc/hosttemplates.cfg
cfg_file=/usr/local/nagios/etc/servicetemplates.cfg
cfg_file=/usr/local/nagios/etc/servicedependencies.cfg
cfg_file=/usr/local/nagios/etc/serviceescalations.cfg
cfg_file=/usr/local/nagios/etc/hostdependencies.cfg
cfg_file=/usr/local/nagios/etc/hostescalations.cfg
cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg
cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/services
These are defined per service, it all depends on how the plugin works and what it's checking.xlin125 wrote:Where are those alarm thresholds saved and "checked" to trigger an alarm/event if the thresholds are exceeded and alarm condition is met when the Nagios XI receives the status data from a Nagios agent (say NRPE)? In the service configuration or in my SQL database?
A service that checks if a process is running might return a critical if it was not running, so there's no defining a threshold here.
Here's an example of the Nagios XI check for localhost disk space. Warn at 20% free and critical at 15% free. These values are in $ARG1$ and $ARG2$.
And here's that same config when it's written to a flat config file:
Code: Select all
define service {
host_name localhost
service_description Root Partition
use local-service
check_command check_local_disk!20%!10%!/
register 1
} It's not actually Nagios that checks the thesholds, it's the plugin that is run that determines what exit code it returns to Nagios and hence Nagios does something based on that exit code. Have a read of this:
https://nagios-plugins.org/doc/guidelines.html#AEN78
Does this help?
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Service configuration files
Yes, it really helped. Thank you!
Re: Service configuration files
Great to hear!
I'll be closing this thread now, but feel free to open another if you need anything in the future!
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee