Flapping

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Flapping

Post by MPIvan »

Here is what iv got
root@mpnagios:/usr/local/nagios/libexec# ./check_ping -H 172.16.1.251 -w 3000.0,80% -c 5000.0,100% -p 5
/bin/ping -n -U -w 30 -c 5 172.16.1.251
CRITICAL - Could not interpret output from ping command
root@mpnagios:/usr/local/nagios/libexec#
and in the command.cfg file i have this

Code: Select all

################################################################################
#
# SAMPLE HOST CHECK COMMANDS
#
################################################################################


# This command checks to see if a host is "alive" by pinging it
# The check must result in a 100% packet loss or 5 second (5000ms) round trip
# average time to produce a critical error.
# Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)

# 'check-host-alive' command definition
define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
        }

# 'check-host-alive 2' command definition
define command{
        command_name    check_icmp
        command_line    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 2
}

this is the cgi.cfg file

Code: Select all

# PING SYNTAX
# This option determines what syntax should be used when
# attempting to ping a host from the WAP interface (using
# the statuswml CGI.  You must include the full path to
# the ping binary, along with all required options.  The
# $HOSTADDRESS$ macro is substituted with the address of
# the host before the command is executed.
# Please note that the syntax for the ping binary is
# notorious for being different on virtually ever *NIX
# OS and distribution, so you may have to tweak this to
# work on your system.

This is what iv do now --- i comment this part, but no changes 
#ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$       
This is the router.cfg file

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          router-bp
        service_description     PING
        check_command           check_ping!200.0,20%!600.0,60%
       normal_check_interval   5
       retry_check_interval    1
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Flapping

Post by slansing »

Please show the output of:

Code: Select all

which ping
ls -l /bin/ping
ls -l /usr/local/nagios/libexec | grep ping
Also, what version of the nagios plugins did you install on this system?

Can you uncomment the ping_syntax line from cgi.cfg and restart nagios? Then try to re-schedule a check from the interface.

Also, if you call /bin/ping and pass your information manually in from the command line does it error out?
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Flapping

Post by MPIvan »

root@mpnagios:/usr/local/nagios/etc/objects# which ping
/bin/ping
root@mpnagios:/usr/local/nagios/etc/objects#

root@mpnagios:/usr/local/nagios/etc/objects# ls -l /bin/ping
-rwsr-xr-x 1 root root 35712 Nov 8 2011 /bin/ping
root@mpnagios:/usr/local/nagios/etc/objects#

root@mpnagios:/usr/local/nagios/etc/objects# ls -l /usr/local/nagios/libexec | grep ping
-rwxr-xr-x 1 nagios nagios 158770 Sep 30 07:54 check_ping
root@mpnagios:/usr/local/nagios/etc/objects# ^C
Im using nagios-plugins-1.4.15 and Nagios 3.5.1 core ... on ubuntu server 12.04.03 LTS .... i uncomment the ping_syntag
Then try to re-schedule a check from the interface.

Also, if you call /bin/ping and pass your information manually in from the command line does it error out?
Im not quite sure if i understand you ....
But still same error
root@mpnagios:/usr/local/nagios/libexec# ./check_ping -H 172.16.1.251 -w 3000.0,80% -c 5000.0,100% -p 5
/bin/ping -n -U -w 30 -c 5 172.16.1.251
CRITICAL - Could not interpret output from ping command
root@mpnagios:/usr/local/nagios/libexec#
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Flapping

Post by slansing »

What do you get returned when running this manually:

Code: Select all

/bin/ping -n -U -c 5 172.16.1.251
And:

Code: Select all

/usr/local/nagios/libexec/check_ping -H 172.16.1.251
Can you send us a copy of your check_ping plugin?
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Flapping

Post by MPIvan »

here it is:

Code: Select all

root@mpnagios:/usr/local/nagios/libexec# /bin/ping -n -U -c 5 172.16.1.251
PING 172.16.1.251 (172.16.1.251) 56(84) bytes of data.
From 192.168.100.241: icmp_seq=1 Redirect Host(New nexthop: 192.168.100.3)
From 192.168.100.241 icmp_seq=1 Redirect Host64 bytes from 172.16.1.251: icmp_req=1 ttl=254 time=9.07 ms
From 192.168.100.241: icmp_seq=2 Redirect Host(New nexthop: 192.168.100.3)
From 192.168.100.241 icmp_seq=2 Redirect Host64 bytes from 172.16.1.251: icmp_req=2 ttl=254 time=9.14 ms
From 192.168.100.241: icmp_seq=3 Redirect Host(New nexthop: 192.168.100.3)
From 192.168.100.241 icmp_seq=3 Redirect Host
--- 172.16.1.251 ping statistics ---
3 packets transmitted, 2 received, +3 errors, 33% packet loss, time 2002ms
rtt min/avg/max/mdev = 9.077/9.113/9.149/0.036 ms
root@mpnagios:/usr/local/nagios/libexec#
root@mpnagios:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_ping -H 172.16.1.251
<wrta> was not set
check_ping: Could not parse arguments
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-p packets] [-t timeout] [-4|-6]
root@mpnagios:/usr/local/nagios/libexec#
and interesting... im trying to open the file but all it gave me this (О©ҐО©ҐО©ҐО©Ґ%bО©Ґ) and i change the permission of the file and all that stuff but i just cant open ...

and here is this
root@mpnagios:/tmp# ls -la /usr/local/nagios/
total 36
drwxr-xr-x 9 root root 4096 Sep 30 07:54 .
drwxr-xr-x 11 root root 4096 Sep 30 07:49 ..
drwxrwxr-x 2 nagios nagios 4096 Sep 30 07:49 bin
drwxrwxr-x 3 nagios nagios 4096 Sep 30 07:52 etc
drwxr-xr-x 2 root root 4096 Sep 30 07:54 include
drwxrwxr-x 3 nagios nagios 4096 Oct 7 19:02 libexec
drwxrwxr-x 2 nagios nagios 4096 Sep 30 07:49 sbin
drwxrwxr-x 11 nagios nagios 4096 Sep 30 07:54 share
drwxrwxr-x 5 nagios nagios 4096 Oct 7 19:20 var
root@mpnagios:/tmp#

Code: Select all

root@mpnagios:/tmp# ls -la /usr/local/nagios/libexec/
total 6640
drwxrwxr-x 3 nagios nagios   4096 Oct  7 19:02 .
drwxr-xr-x 9 root   root     4096 Sep 30 07:54 ..
-rwxr-xr-x 1 nagios nagios 426270 Sep 30 07:54 check_apt
-rwxr-xr-x 1 nagios nagios   2245 Sep 30 07:54 check_breeze
-rwxr-xr-x 1 nagios nagios 153431 Sep 30 07:54 check_by_ssh
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_clamd -> check_tcp
-rwxr-xr-x 1 nagios nagios 103277 Sep 30 07:54 check_cluster
-r-sr-xr-x 1 root   nagios 155750 Sep 30 07:54 check_dhcp
-rwxr-xr-x 1 nagios nagios 144153 Sep 30 07:54 check_dig
-rwxr-xr-x 1 nagios nagios 472463 Sep 30 07:54 check_disk
-rwxr-xr-x 1 nagios nagios   8704 Sep 30 07:54 check_disk_smb
-rwxr-xr-x 1 nagios nagios 154372 Sep 30 07:54 check_dns
-rwxr-xr-x 1 nagios nagios  96457 Sep 30 07:54 check_dummy
-rwxr-xr-x 1 nagios nagios   3056 Sep 30 07:54 check_file_age
-rwxr-xr-x 1 nagios nagios   6318 Sep 30 07:54 check_flexlm
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_ftp -> check_tcp
-rwxr-xr-x 1 nagios nagios 497787 Sep 30 07:54 check_http
-r-sr-xr-x 1 root   nagios 165236 Sep 30 07:54 check_icmp
-rwxr-xr-x 1 nagios nagios 111583 Sep 30 07:54 check_ide_smart
-rwxr-xr-x 1 nagios nagios  15137 Sep 30 07:54 check_ifoperstatus
-rwxr-xr-x 1 nagios nagios  12601 Sep 30 07:54 check_ifstatus
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_imap -> check_tcp
-rwxr-xr-x 1 nagios nagios   6890 Sep 30 07:54 check_ircd
-rwxr-xr-x 1 nagios nagios 125436 Sep 30 07:54 check_load
-rwxr-xr-x 1 nagios nagios   6026 Sep 30 07:54 check_log
-rwxr-xr-x 1 nagios nagios  20287 Sep 30 07:54 check_mailq
-rwxr-xr-x 1 nagios nagios 108741 Sep 30 07:54 check_mrtg
-rwxr-xr-x 1 nagios nagios 108550 Sep 30 07:54 check_mrtgtraf
-rwxr-xr-x 1 nagios nagios 126091 Sep 30 07:54 check_nagios
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_nntp -> check_tcp
-rwxr-xr-x 1 nagios nagios 157950 Sep 30 07:54 check_nt
-rwxr-xr-x 1 nagios nagios 160603 Sep 30 07:54 check_ntp
-rwxr-xr-x 1 nagios nagios 148938 Sep 30 07:54 check_ntp_peer
-rwxr-xr-x 1 nagios nagios 143263 Sep 30 07:54 check_ntp_time
-rwxr-xr-x 1 nagios nagios 197199 Sep 30 07:54 check_nwstat
-rwxr-xr-x 1 nagios nagios   8326 Sep 30 07:54 check_oracle
-rwxr-xr-x 1 nagios nagios 130757 Sep 30 07:54 check_overcr
-rwxr-xr-x 1 nagios nagios 158770 Sep 30 07:54 check_ping
-rw-r--r-- 1 root   root     4096 Oct  7 19:02 .check_ping.swp
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_pop -> check_tcp
-rwxr-xr-x 1 nagios nagios 447437 Sep 30 07:54 check_procs
-rwxr-xr-x 1 nagios nagios 124987 Sep 30 07:54 check_real
-rwxr-xr-x 1 nagios nagios   9584 Sep 30 07:54 check_rpc
-rwxr-xr-x 1 nagios nagios   1137 Sep 30 07:54 check_sensors
-rwxr-xr-x 1 nagios nagios 446129 Sep 30 07:54 check_smtp
-rwxr-xr-x 1 nagios nagios 477356 Nov 28  2012 check_snmp
-rwxr-xr-x 1 nagios nagios 123706 Sep 30 07:54 check_ssh
-rwxr-xr-x 1 nagios nagios 126936 Sep 30 07:54 check_swap
-rwxr-xr-x 1 nagios nagios 139324 Sep 30 07:54 check_tcp
-rwxr-xr-x 1 nagios nagios 124773 Sep 30 07:54 check_time
lrwxrwxrwx 1 root   root        9 Sep 30 07:54 check_udp -> check_tcp
-rwxr-xr-x 1 nagios nagios 141823 Sep 30 07:54 check_ups
-rwxr-xr-x 1 nagios nagios 119186 Sep 30 07:54 check_users
-rwxr-xr-x 1 nagios nagios   2939 Sep 30 07:54 check_wave
drwxr-xr-x 4 nagios nagios   4096 Sep 30 07:50 eventhandlers
-rwxr-xr-x 1 nagios nagios 128224 Sep 30 07:54 negate
-rwxr-xr-x 1 nagios nagios 119301 Sep 30 07:54 urlize
-rwxr-xr-x 1 nagios nagios   1890 Sep 30 07:54 utils.pm
-rwxr-xr-x 1 nagios nagios    862 Sep 30 07:54 utils.sh
root@mpnagios:/tmp#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Flapping

Post by tmcdonald »

check_ping is a binary file, so you won't be able to read it manually. I believe slansing was asking for you to attach a copy of that file and upload it.
Former Nagios employee
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Flapping

Post by MPIvan »

Here it is check_ping or this or this :) sorry no good uploader :S
Last edited by slansing on Mon Oct 07, 2013 2:21 pm, edited 1 time in total.
Reason: Please upload the files as attachments in your reply, we cannot link out to filesharing sites besides text on pastebin for security reasons.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Flapping

Post by slansing »

Please attach the files you linked from offsite in a reply here, simply click the attach button in your "Post A Reply" page.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Flapping

Post by MPIvan »

Here it is ... my mistake ... :)
check_ping.rar
CheckPing
(53.85 KiB) Downloaded 197 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Flapping

Post by lmiltchev »

Can you run the following command and show us the output?

Code: Select all

/usr/local/nagios/libexec/check_ping -H 172.16.1.251 -w 3000.0,80% -c 5000.0,100% -p 5
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked