How to get rid of old configuration?


I am running Nagios 3.2.0 on Ubuntu 10.04. My problem is that Nagios keeps using outdated configuration information in several cases:

  • I created a host and a service. Since I called the service HTTP, I got a warning but Nagios started up fine. Because of the warning I renamed the service, and now it always shows the old and the new service in the Service Detail page.
  • I configured the commands notify-host-by-email and notify-service-by-email to send email to an external SMTP server. I restarted Nagios and got it to work. Then I updated the commands to format the email text more nicely. Now it looks like Nagios is still using the previous version of the command, i.e. emails are sent but not in the new format.

So I ran the following to clean up any old data:

service nagios3 stop
mv /var/log/nagios3/nagios.log /tmp
rm /var/log/nagios3/archives/*
mv /var/cache/nagios3/objects.cache /tmp
mv /var/lib/nagios3/retention.dat /tmp
service nagios3 start

Now the host and service history seem to be gone, but the 2 above issues still exist. What can I do?


NEVER use restart.
use reload or stop and start.
stop nagios check for surviving processes (ps -ef | grep nagios) kill if any, start.


I stopped the nagios3 service and checked for nagios processes; there were none. Then I deleted the above files and started the nagios3 service again. I still have the same problem. Are there any other files where nagios stores such information?


you don’t need to do anything on those files, the configuration is read at each start.
As it looks like you did an RPM install so you need to check exactly where your cfg files are located as that is package dependant and mostly not standard. You are probably modifying the wrong files.


This is the first time I use Nagios, so anything is possible. But I went over the configuration many times and I cannot find any flaw in what I did:

  1. For Ubuntu 10.04 all configuration files seem to be under /etc/nagios3 and /etc/nagios-plugins
  2. I added the line ‘cfg_dir=/etc/nagios3/objects’ to /etc/nagios3/nagios.cfg
  3. I created the directory /etc/nagios3/objects and added 2 files into it. Each file has a host and a service definition.
  4. I restarted Nagios and the hosts and services showed up.
  5. I changed the service_description of both services since the validation complained about duplicate names.
  6. I restarted Nagios and now I always see the old and new service definitions.

If I was editing the wrong files, why would my hosts and services show up in the first place?

On the other hand, maybe something is wrong with my service configuration:
define service {
use generic-service ; Inherit default values from a template
check_command check_http
cause 2 service to appear: HTTP and


Given the description i’d say you are on the right files :slight_smile: had to ask.

The service you “quoted” is

try a grep for “HTTP” and see how many results you get in the Objects directory, and start from there.


But that’s the thing, I created the ‘objects’ directory myself and there is nothing else in there. I reduced it to a single configuration file with these contents:

define host {
	use		generic-host		; Inherit default values from a template
	host_name		; The name we're giving to this host
	alias		; A longer name associated with the host
	hostgroups	http-servers		; Host groups this host is associated with

define service {
	use		generic-service		; Inherit default values from a template
	check_command	check_http

When the service_description is I get 2 services, HTTP and When I change the service_description to HTTP I only get a single HTTP service.


are you sure thee are no other active cfg_dir or cfg_file directives in nagios.cfg?


There are other configurations active that came with Nagios, but how would they know about my host?

Anyway, it seems they do know my host because even if I remove the above service configuration the HTTP service still shows up for that host. Is this behavior standard for Nagios? I don’t see anything related to HTTP in the generic-host template.


remove your conifg files, check out what happnes and trace the file defining the HTTP service :slight_smile:

at least as a start :slight_smile:


If you want to know: HTTP was defined for the hostgroup (http-servers).


so you got it fixed? :slight_smile: