[Nagiosplug-devel] [PATCH] Outbound connections from alternate interfaces

Sam Clippinger samc at silence.org
Tue Feb 5 19:25:35 CET 2013

Hey, thanks for a great package!  It's been a lifesaver!

Most of my servers have multiple IP addresses and today I needed the ability to check outbound SMTP from those secondary addresses instead of always using the primary address.  (I use check_smtp to test if my mail servers are blocked by blacklists that can't be checked through DNS (e.g. AT&T) and some of my servers use alternate interfaces for delivery.)  So I came up with this patch.  It adds a "-I" argument to check_smtp that will accept a hostname, IP or IPv6 address.  If the argument is supplied and the address is bound to the local machine, it will use it for the outgoing connection.  If it can't bind to the address, it will print an error and exit with UNKNOWN status.  Since the meat of the changes are in netutils.[ch], it should be trivial to add a similar argument to other tests as well, if anyone wants to.

The patch is against version 1.4.16.  It compiles cleanly and works on CentOS 5.9.

-- Sam Clippinger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130205/c20e7fbe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outbound_interface.patch
Type: application/octet-stream
Size: 5310 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130205/c20e7fbe/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130205/c20e7fbe/attachment-0001.html>

More information about the Devel mailing list