Pinging from a specific interface


I need to be able to ping from a specific interface for Nagios.

i.e. ping -I

Does anyone know of anyway to make Nagios do this1?



Neither the standard check_ping or check_icmp plugins have that ability, however there is a script that uses the Net::Ping perl module. You could use that, but you would need to modify to enable it to take advantage of the bind($local_addr) function within the perl module, which appears to do what you require. See to download the check script.




Strides, thanks for the help! What i ended up doing was:

$USER1$/check_icmp -s -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

and this seems to be working, Any reason that this would not be working and I am tricking myself ;)?