Page 1 of 3

localhost and switch status Down

Posted: Wed Sep 25, 2013 5:17 am
by csandy1703
Deal All

I have installed NagiOS 4.0.0. with no errors.

However after opening nagios interface, localhost status is DOWN always.

Also I added one switch in /usr/local/nagios/etc/objects/switch.cfg, but it also showing DOWN.

Pl help

Re: localhost and switch status Down

Posted: Wed Sep 25, 2013 9:47 am
by volpeadmin
I'm also having this same problem...I've found threads elsewhere outside the official support forum that suggest the service.cfg and hosts.cfg should be checked for syntax errors, etc, however after a clean install on my part, I don't find those files anywhere...

Re: localhost and switch status Down

Posted: Wed Sep 25, 2013 12:21 pm
by abrist
In a clean install, localhost.cfg should hold these config objects. What is the listing of the directory:

Code: Select all

ls -la /usr/local/nagios/etc
ls -la /usr/local/nagios/etc/objects

Re: localhost and switch status Down

Posted: Wed Sep 25, 2013 12:33 pm
by volpeadmin
# ls -la /usr/local/nagios/etc
total 76
drwxrwxr-x. 3 nagios nagios 4096 Sep 24 15:35 .
drwxr-xr-x. 8 root root 4096 Sep 18 14:46 ..
-rw-rw-r--. 1 nagios nagios 11669 Sep 18 14:46 cgi.cfg
-rw-r--r--. 1 nagios nagios 26 Sep 18 16:35 htpasswd.users
-rw-rw-r--. 1 nagios nagios 44710 Sep 18 14:46 nagios.cfg
drwxrwxr-x. 2 nagios nagios 4096 Sep 25 09:17 objects
-rw-rw----. 1 nagios nagios 1340 Sep 18 14:46 resource.cfg
# ls -la /usr/local/nagios/etc/objects
total 56
drwxrwxr-x. 2 nagios nagios 4096 Sep 25 09:17 .
drwxrwxr-x. 3 nagios nagios 4096 Sep 24 15:35 ..
-rw-rw-r--. 1 nagios nagios 7716 Sep 18 14:46 commands.cfg
-rw-rw-r--. 1 nagios nagios 2166 Sep 18 14:46 contacts.cfg
-rw-rw-r--. 1 nagios nagios 5408 Sep 25 09:17 localhost.cfg
-rw-rw-r--. 1 nagios nagios 3124 Sep 18 14:46 printer.cfg
-rw-rw-r--. 1 nagios nagios 3293 Sep 18 14:46 switch.cfg
-rw-rw-r--. 1 nagios nagios 10812 Sep 18 14:46 templates.cfg
-rw-rw-r--. 1 nagios nagios 3208 Sep 18 14:46 timeperiods.cfg
-rw-rw-r--. 1 nagios nagios 4019 Sep 18 14:46 windows.cfg

Re: localhost and switch status Down

Posted: Wed Sep 25, 2013 1:33 pm
by abrist
Well, you have a localhost.cfg, and it is not empty. Is the objects folder included in the nagios cfg?

Code: Select all

grep cfg_ /usr/local/nagios/etc/nagios.cfg

Re: localhost and switch status Down

Posted: Fri Sep 27, 2013 12:44 pm
by volpeadmin
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
# extension) in a particular directory by using the cfg_dir
#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers
# object configuration files (see the cfg_file and cfg_dir options above).

Re: localhost and switch status Down

Posted: Fri Sep 27, 2013 12:50 pm
by sreinhardt
By default the host checks are just check_ping. Have you verified that your host is allowing responses from icmp packets and allowing them output or that your switch is responding to them?

Re: localhost and switch status Down

Posted: Fri Sep 27, 2013 1:35 pm
by volpeadmin
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5903
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5902
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5901
ACCEPT icmp -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Re: localhost and switch status Down

Posted: Fri Sep 27, 2013 1:52 pm
by sreinhardt
well, everything looks good there. Let's do a ping to both and just be 100% sure that icmp is working.

Re: localhost and switch status Down

Posted: Fri Sep 27, 2013 2:19 pm
by volpeadmin
# ping -c3 152.122.15.15
PING 152.122.15.15 (152.122.15.15) 56(84) bytes of data.
64 bytes from 152.122.15.15: icmp_seq=1 ttl=255 time=0.469 ms
64 bytes from 152.122.15.15: icmp_seq=2 ttl=255 time=0.557 ms
64 bytes from 152.122.15.15: icmp_seq=3 ttl=255 time=0.425 ms

--- 152.122.15.15 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.425/0.483/0.557/0.060 ms

# ping -c3 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.070 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.018 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.042 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.018/0.043/0.070/0.021 ms