LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios: PROBLEM Host Alert: localhost is DOWN (https://www.linuxquestions.org/questions/linux-server-73/nagios-problem-host-alert-localhost-is-down-4175609599/)

upnort 07-10-2017 07:04 PM

Nagios: PROBLEM Host Alert: localhost is DOWN
 
Any Slackers using nagios? I have dug around the web to no avail.

I keep getting "PROBLEM Host Alert: localhost is DOWN" emails from nagios trying to ping localhost.

/bin/ping: chmod u+s / -rws--x--x

/etc/nagios/cgi.cfg:
ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$

LANG=en_US.UTF-8

nagios-plugins slackbuild:
Code:

  --with-ping-command=/bin/ping
  --with-ping6-command=/bin/ping6

ping works fine as root and non-root.

I can su - nagios and ping works fine.

Disabling iptables makes no difference.

Running the check_ping command manually:

Code:

/usr/libexec/nagios/check_ping -H localhost -w 100.0,20% -c 500.0,60% -p 5
/bin/ping6
CRITICAL - Could not interpret output from ping command

I thought perhaps nagios was defaulting to ipv6 but I see the same results for ipv4:

Code:

/usr/libexec/nagios/check_ping -H localhost -w 100.0,20% -c 500.0,60% -p 5 -4
/bin/ping
CRITICAL - Could not interpret output from ping command

Any ideas?

Thanks. :)

ShadowCat8 07-10-2017 07:47 PM

Greetings,

How about if you try the following from the command line:
Code:

/usr/lib/nagios/plugins/check_ping -H 127.0.0.1 -w 100.0,20% -c 500.0,60% -p 5 -4
What does that return?

Just trying to see if it is complaining about having the additional argument at the end of the command or if it doesn't know where to find localhost. Do you have an entry in your /etc/hosts for localhost like the following?
Code:

127.0.0.1      localhost localhost.localdomain
HTH. Let us know.

upnort 07-10-2017 08:24 PM

Yes, /etc/hosts is fine. Same results with 127.0.0.1 as localhost.

Quote:

/usr/libexec/nagios/check_ping -H 127.0.0.1 -w 100.0,20% -c 500.0,60% -p 5 -4
Returns the following:

Code:

/bin/ping
CRITICAL - Could not interpret output from ping command


ShadowCat8 07-17-2017 08:57 PM

Greetings again,

Well, I am a bit confused how this could happen since it would seem one of the most basic plugins, but I think there are a couple more steps to run down what exactly is going on...

Let's try this... If you "su - nagios", do you get the same output from the exact ping command that's being passed to the nagios plugin as I do below?
Code:

nagios@bakhost ~ $ ping -n -U -c 5 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.012 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.013 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.012 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.018 ms

--- 127.0.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997ms
rtt min/avg/max/mdev = 0.012/0.014/0.018/0.005 ms
nagios@bakhost ~ $

From that we can confirm that the output it should be expecting is what we are getting. Also, just for making sure on that end, what do you get when you run
Code:

~ $ file /usr/libexec/nagios/check_ping
HTH. Let us know.

upnort 07-17-2017 09:20 PM

Well, this is interesting. On a whim I installed the monitoring-plugins package and removed the nagios-plugins package.

Problem solved.

I notified the nagios slackbuild maintainer.

Thanks for trying to help! :)


All times are GMT -5. The time now is 01:55 AM.