Ipv6 port checks


I’ve been mandated to port check ipv4 and ipv6 ports “seperately” using check-ports.rb (or I suppose some other tool). Not sure why I’m supposed to do this, but that’s the mandate.

Anyway, do the plugins in sensu-plugins-network-checks support ipv6? Thx.

Using ‘::1’ ipv6 localhost as a quick test on my workstation seems to work, Unless the linux kernel is doing something very special and mapping localhost ipv6 back into ipv6… but I don’t think it is.

Here’s my test:
setup a listening socket real quick on ipv6 localhost in one terminal
nc -6 -l '::1' 9000

In other terminal run this test

$ check-ports.rb -H '' -p 9000
CheckPort CRITICAL: Connection refused by
$ check-ports.rb -H '::1' -p 9000
CheckPort OK: All ports (9000) are accessible for hosts ::1
$ check-ports.rb -H '::1' -p 9000
CheckPort CRITICAL: Connection refused by ::1:9000

Looks like its connecting to ipv6 ports just fine.

The nc socket shuts down after the first connection on the ipv6 host, so the second attempt to probe it fails. Keep both terminals open side by side when you do the test, you’ll see the nc process quit after first ipv6 connection test.