2

I want put my own configuration in the Nagios Core 4.3.4.

I have the following setting in Nagios:

  • /usr/local/nagios/etc/nagios.cfg

    cfg_file=/usr/local/nagios/etc/objects/newhost.cfg
    cfg_dir=/usr/local/nagios/etc/servers
    
  • /usr/local/nagios/etc/servers/ubuntu_host.cfg

    define host {
        use                          linux-server
        host_name                    ubuntu_host
        alias                        Ubuntu Host
        address                      192.168.1.10
        register                     1
    }
    
  • /usr/local/nagios/etc/objects/newhost.cfg

    # Define a host for the local machine
    define host{
        use                     linux-server
        host_name               google.com
        alias                   google.com
        address                 www.google.com
    }
    
    # Define a service to "ping" the local machine
    define service{
        use                     generic-service
        host_name               google.com
        service_description     PING
        check_command           check_ping!100.0,20%!500.0,60%
    }
    
    define service{
        use                     generic-service
        host_name               google.com
        service_description     HTTP
        check_command           check_http
        notifications_enabled   0
    }
    

The configuration validation is OK and it display 3 hosts:

Running pre-flight check on configuration data...
Checking objects...
    Checked 7 services.
    Checked 3 hosts.
    Checked 0 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
Checking for circular paths...
    Checked 3 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors:   0

I restarted nrpe service, nargios service and httpd service.

But Nargios Web Interface display the same information. List of hosts in Nagios Web Interface

List of services in Nagios Web Interface

Frodogus
  • 67
  • 1
  • 6
  • I have stopped all services. I have only started httpd service and nagios web interface display "Daemon running with PID 2097" but this PID not exist in the machine. – Frodogus Jan 16 '18 at 16:21

1 Answers1

0

I know this is late but I just encountered this today. but it seems after doing a few git push and git pull my chmod for /usr/local/nagios/var/objects.cache was changed to root instead of nagios.

I used ls -al /usr/local/nagios/var to check the timestamps and noticed this.

The solution for me was:

cd /usr/local/nagios/var/

chown nagios:nagios objects.cache

systemctl restart nagios

systemctl restart httpd

I got reference from https://support.nagios.com/forum/viewtopic.php?f=7&t=52727&p=276428&hilit=objects.cache+and+retention.dat#p276428

Fuyu KuKie
  • 108
  • 11