check_icmp failed to resolve for IPv6!!!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

check_icmp failed to resolve for IPv6!!!

Post by ponnpr7 »

Run Check Command
Host Address
2001:4888:a3f:2032:362:ff0:0:50
Run Check Command
[[email protected] ~]$ /usr/local/nagios/libexec/check_icmp -H 2001:4888:a3f:2032:362:ff0:0:50 -w 3000.0,80% -c 5000.0,100% -p 5
check_icmp: Failed to resolve 2001:4888:a3f:2032:362:ff0:0:50

I'm not able to run check-host-alive in IPv6. Nagios was defined with IPv6 and able to ping the IPv6 Default Gateway.
[nagios@nagios libexec]$ ping6 2001:4888:a03:1f2b:c0:22::
PING 2001:4888:a03:1f2b:c0:22::(2001:4888:a03:1f2b:c0:22::) 56 data bytes
64 bytes from 2001:4888:a03:1f2b:c0:22::: icmp_seq=1 ttl=64 time=0.852 ms
64 bytes from 2001:4888:a03:1f2b:c0:22::: icmp_seq=2 ttl=64 time=0.708 ms
64 bytes from 2001:4888:a03:1f2b:c0:22::: icmp_seq=3 ttl=64 time=0.839 ms
64 bytes from 2001:4888:a03:1f2b:c0:22::: icmp_seq=4 ttl=64 time=0.892 ms
64 bytes from 2001:4888:a03:1f2b:c0:22::: icmp_seq=5 ttl=64 time=0.872 ms

Also able to ping the remote HOST IPv6:
[nagios@nagios libexec]$ ping6 2001:4888:a3f:2032:362:ff0:0:50
PING 2001:4888:a3f:2032:362:ff0:0:50(2001:4888:a3f:2032:362:ff0:0:50) 56 data bytes
64 bytes from 2001:4888:a3f:2032:362:ff0:0:50: icmp_seq=1 ttl=60 time=27.4 ms
64 bytes from 2001:4888:a3f:2032:362:ff0:0:50: icmp_seq=2 ttl=60 time=27.4 ms
64 bytes from 2001:4888:a3f:2032:362:ff0:0:50: icmp_seq=3 ttl=60 time=27.4 ms
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by mcapra »

check_ping should work with the -6 argument:
https://nagios-plugins.org/doc/man/check_ping.html

Code: Select all

     -6, --use-ipv6
        Use IPv6 connection
check_icmp should probably be modified with some sort of logic to handle IPv6 addresses. Currently it uses inet_addr for validation which I don't think can handle IPv6. There may be additional considerations beyond that. I've raised an issue on GitHub regarding this.
Former Nagios employee
https://www.mcapra.com/
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by ponnpr7 »

same

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_icmp -6 -H 2001:4888:a3f:2032:362:ff0:0:50 -w 3000.0,80% -c 5000.0,100% -p 5
check_icmp: Failed to resolve 2001:4888:a3f:2032:362:ff0:0:50
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by mcapra »

Try check_ping instead, it looks like that command is still using check_icmp.
Former Nagios employee
https://www.mcapra.com/
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by ponnpr7 »

what is wrong this

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_ping -6 -H 2001:4888:a3f:2032:362:ff0:0:50 -w -c -p 5
check_ping: %s: Warning threshold must be integer or percentage!
[code]services.cfg file:
# Service definition
define service{
         use                             generic-service
         host_name                       server_name
         service_description             PING
         is_volatile                     0
         check_period                    24x7
         max_check_attempts              10
         normal_check_interval           2
         retry_check_interval            1
         contact_groups                  linux-admins
         notification_interval           120
         notification_period             24x7
         notification_options            c,r
         check_command                   check_ping!1000,90%!5000,95%
         }
[/code]
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by mcapra »

If I may direct your attention back to the aforementioned manpage:
https://nagios-plugins.org/doc/man/check_ping.html

Code: Select all

    THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel
    time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the
    percentage of packet loss to trigger an alarm state.
check_ping works a bit differently than check_icmp. Try this:

Code: Select all

/usr/local/nagios/libexec/check_ping -6 -H 2001:4888:a3f:2032:362:ff0:0:50 -w 1000,90% -c 5000,95% -p 5
As far as your service definition, I would make sure the check_ping command definition is actually pointing to the check_ping plugin. I would also make sure that, if your server addresses are all IPv6, you either create a new command leveraging the -6 argument (something like check_ping6 maybe) or modify the check_ping command definition accordingly.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: check_icmp failed to resolve for IPv6!!!

Post by kyang »

Thanks @mcapra!

OP, let us know if mcapra's suggestion worked for you.
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

Re: check_icmp failed to resolve for IPv6!!!

Post by ponnpr7 »

Yes it works, but moving forward I would like to have the check_icmp for ipv6.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_icmp failed to resolve for IPv6!!!

Post by dwhitfield »

Locked