LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-10-2017, 07:04 PM   #1
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 642

Rep: Reputation: Disabled
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.
 
Old 07-10-2017, 07:47 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 252

Rep: Reputation: 52
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.

Last edited by ShadowCat8; 07-10-2017 at 07:51 PM. Reason: Added host file entry.
 
Old 07-10-2017, 08:24 PM   #3
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 642

Original Poster
Rep: Reputation: Disabled
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

Last edited by upnort; 07-17-2017 at 09:08 AM.
 
Old 07-17-2017, 08:57 PM   #4
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 252

Rep: Reputation: 52
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.
 
Old 07-17-2017, 09:20 PM   #5
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 642

Original Poster
Rep: Reputation: Disabled
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nagios not working (http://localhost/nagios or http://ip/nagios) 404 error connect2janu Linux - Server 1 11-18-2012 02:06 AM
Nagios notifications for a host problem cmx08 Linux - Software 1 07-20-2011 07:35 AM
[SOLVED] nagios adding remote host problem uppalagayatri Linux - Software 2 03-20-2011 11:16 PM
nagios adding remote host problem ramesh14 Linux - Software 3 03-04-2011 08:37 AM
Nagios passive or remote-host-side alert. knockout_artist Linux - Server 1 01-06-2010 11:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration