Page 2 of 3
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 11:51 am
by abrist
You can ignore the warnings. You will have to add your iptables rules to:
To get nagios to start on boot, you need to add it to the init system in the same way you added iptables (except for downloading the init script as it already exists in /etc/init.d):
And you may need to add httpd (apache2) as well:
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 1:43 pm
by DiegoAnjos
abrist
I tried to add Nagios to startup but now I can not start apache2.
Nagios can be started/stopped but I am not able to access it on web.
[*]srvnagios:~# /etc/init.d/apache2 start
Starting web server: apache2(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
failed!
How can I revert this mess?
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 2:46 pm
by abrist
Looks like apache is already loading on boot? Remove the extra from the rc system:
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 3:01 pm
by DiegoAnjos
Did not work.
srvnagios:~# /etc/init.d/apache2 status
Apache2 is NOT running.
But I can not start it. Same error.
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 3:14 pm
by DiegoAnjos
I restarted the Debian machine and apache started as well. But if I stop it, I am not able to start it again.
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 3:16 pm
by abrist
Check to make sure you do not have more than 1 instance of apache running:
Re: Socket timeout / Connection Refused
Posted: Fri Feb 15, 2013 3:18 pm
by DiegoAnjos
srvnagios:~# ps -aef | grep apache
root 1117 1 0 18:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 1139 1117 0 18:20 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 1140 1117 0 18:20 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 1141 1117 0 18:20 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 1142 1117 0 18:20 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 1143 1117 0 18:20 ? 00:00:00 /usr/sbin/apache2 -k start
root 2088 2063 0 18:21 pts/0 00:00:00 grep apache
Re: Socket timeout / Connection Refused
Posted: Sat Feb 16, 2013 1:04 pm
by yancy
Diego,
The issue is that NSClient (0.3.8) is not sending information to Nagios.
By default NSClient is an active check, which means Nagios (on your Debian machine) starts the connection and receives a reply. Since Nagios initiates the communication, this is probably not an issue with firewalls or listening ports.
can you give this a try.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx
where xx.xx.xx.xx is the ip address of you nsclient machine.
also, the location of check_nrpe may be different if you compiled from source, but it should be in the same location as check_ping which you've been using.
Thanks,
-Yancy
Re: Socket timeout / Connection Refused
Posted: Mon Feb 18, 2013 6:37 am
by DiegoAnjos
hum... thanks yancy for you help.
In fact I do not have check_nrpe on libexec folder:
Code: Select all
srvnagios:/usr/local/nagios/libexec# ./check_nrpe -H XX.XX.XX.XX
-bash: ./check_nrpe: No such file or directory
but I gave a try of check_ping and...
Code: Select all
srvnagios:/usr/local/nagios/libexec# ./check_ping -H XX.XX.X.X -w 3000.0,80% -c 5000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 0.47 ms|rta=0.471000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
I compiled Nagios from source, following the "Quickstart Guide" from Nagios website.
I have other plugins on libexec folder:
- check_apt check_flexlm check_mailq check_ping check_udp
check_breeze check_ftp check_mrtg check_pop check_ups
check_by_ssh check_hpjd check_mrtgtraf check_procs check_users
check_clamd check_http check_nagios check_real check_wave
check_cluster check_icmp check_nntp check_rpc negate
check_dhcp check_ide_smart check_nt check_sensors urlize
check_dig check_ifoperstatus check_ntp check_smtp utils.pm
check_disk check_ifstatus check_ntp_peer check_snmp utils.sh
check_disk_smb check_imap check_ntp_time check_ssh
check_dns check_ircd check_nwstat check_swap
check_dummy check_load check_oracle check_tcp
check_file_age check_log check_overcr check_time
How can I install "check_nrpe"?
Re: Socket timeout / Connection Refused
Posted: Mon Feb 18, 2013 9:28 am
by yancy
DiegoAnjos,
sounds like you need to also compile the plugins.
plugins can be found here:
http://www.nagios.org/download/plugins
-Yancy