Mailing List Archive

Antw: Re: Q: ping (ocf:pacemaker:ping) from specific address?
>>> Lars Ellenberg <lars.ellenberg@linbit.com> schrieb am 04.09.2014 um 15:28
in
Nachricht <20140904132826.GH23497@soda.linbit>:
> On Thu, Sep 04, 2014 at 02:32:14PM +0200, Ulrich Windl wrote:
>> Hi!
>>
>> I'm using ocf:pacemaker:ping to ping some specific address. The requirement

> is that a specific source address (that is on a local interface) is being
> used to ping a destination. So if the resource moves between nodes, the same

> source address shall be used.
>>
>> The address to use is a secondary adress on interface bond0, like
bond0:xyz.
> I can spacify "-I bond0" and "-I bond0:xyz", but the latter seems to be
> ignores, as if I just said "-I bond0". Ping is from
iputils-ss021109-292.28.1
> (SLES11 SP3).
>>
>> I had this requirement for HP-UX years ago, and the solution was to install
a
> special local ping that allowed to select the source address.
>
>> So my preferences are:
>> 1) Get it done with the software I have
>
> ping -w 2 -c 3 -I 127.0.0.1 8.8.8.8
> ping: sendmsg: Invalid argument
> ping: sendmsg: Invalid argument
> PING 8.8.8.8 (8.8.8.8) from 127.0.0.1 : 56(84) bytes of data.
>
> --- 8.8.8.8 ping statistics ---
> 2 packets transmitted, 0 received, 100% packet loss, time 1008ms
>
> ping -w 2 -c 3 -I 10.11.12.13 8.8.8.8
> bind: Cannot assign requested address
>
> ping -w 2 -c 3 -I 10.43.9.55 8.8.8.8
> PING 8.8.8.8 (8.8.8.8) from 10.43.9.55 : 56(84) bytes of data.
> 64 bytes from 8.8.8.8: icmp_seq=1 ttl=41 time=27.4 ms
> 64 bytes from 8.8.8.8: icmp_seq=2 ttl=41 time=27.4 ms
>
> --- 8.8.8.8 ping statistics ---
> 2 packets transmitted, 2 received, 0% packet loss, time 1000ms
> rtt min/avg/max/mdev = 27.405/27.430/27.456/0.167 ms
>
> Does that help?

Hi!

Yes, it helps: The problems with ping are:
1) There is no error if you use an interface alias with -I (like bond0:xyz)
2) You can use an IP address as "interface" for -I
3), but you cannot use a hostname (resolving to the same IP address as in 2)):
"ping: unknown iface <hostname>"

Regards,
Ulrich

>
> --
> : Lars Ellenberg
> : LINBIT | Your Way to High Availability
> : DRBD/HA support and consulting http://www.linbit.com
>
> DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Q: ping (ocf:pacemaker:ping) from specific address? [ In reply to ]
On Thu, Sep 04, 2014 at 04:23:36PM +0200, Ulrich Windl wrote:
> >>> Lars Ellenberg <lars.ellenberg@linbit.com> schrieb am 04.09.2014 um 15:28
> Hi!
>
> Yes, it helps: The problems with ping are:
> 1) There is no error if you use an interface alias with -I (like bond0:xyz)
> 2) You can use an IP address as "interface" for -I

Right. So what is wrong with that.

If you already know you want to explicitly specify it,
you probably also know which IP address you want to specify?

> 3), but you cannot use a hostname (resolving to the same IP address as in 2)):
> "ping: unknown iface <hostname>"

Send a patch upstream to check if
"interface" can be matched as interface
or, failing that, can be resolved.

That would still require it to be presently configured on that host...
Does not look like the right approach to me.

Lars

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Antw: Re: Q: ping (ocf:pacemaker:ping) from specific address? [ In reply to ]
On 09/04/2014 09:23 AM, Ulrich Windl wrote:

> 2) You can use an IP address as "interface" for -I
> 3), but you cannot use a hostname (resolving to the same IP address as in 2)):
> "ping: unknown iface <hostname>"

Uhmm... ping -I `host <hostname> | awk '{print $NF;}'` ?

--
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
Antw: Re: Q: ping (ocf:pacemaker:ping) from specific address? [ In reply to ]
>>> Lars Ellenberg <lars.ellenberg@linbit.com> schrieb am 04.09.2014 um 16:43 in
Nachricht <20140904144351.GJ23497@soda.linbit>:
> On Thu, Sep 04, 2014 at 04:23:36PM +0200, Ulrich Windl wrote:
>> >>> Lars Ellenberg <lars.ellenberg@linbit.com> schrieb am 04.09.2014 um 15:28
>> Hi!
>>
>> Yes, it helps: The problems with ping are:
>> 1) There is no error if you use an interface alias with -I (like bond0:xyz)
>> 2) You can use an IP address as "interface" for -I
>
> Right. So what is wrong with that.
>
> If you already know you want to explicitly specify it,
> you probably also know which IP address you want to specify?

It's a silent expectation that any adress can be specified as resolvable name or literal address. Here's one example.
We follow the policy to avoid literal adresses whenever possible.

>
>> 3), but you cannot use a hostname (resolving to the same IP address as in
> 2)):
>> "ping: unknown iface <hostname>"
>
> Send a patch upstream to check if
> "interface" can be matched as interface
> or, failing that, can be resolved.

If time permits, I'll try...

>
> That would still require it to be presently configured on that host...
> Does not look like the right approach to me.

Why? We add the IP as resource, the start a server on that IP, and the ping is actually needed to keep an outbound connection alive through a firewall.
The resources are properly rodered and co-located...

Regards,
Ulrich


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Antw: Re: Q: ping (ocf:pacemaker:ping) from specific address? [ In reply to ]
>>> Dimitri Maziuk <dmaziuk@bmrb.wisc.edu> schrieb am 04.09.2014 um 20:05 in
Nachricht <5408A9D3.9030804@bmrb.wisc.edu>:
> On 09/04/2014 09:23 AM, Ulrich Windl wrote:
>
>> 2) You can use an IP address as "interface" for -I
>> 3), but you cannot use a hostname (resolving to the same IP address as in
> 2)):
>> "ping: unknown iface <hostname>"
>
> Uhmm... ping -I `host <hostname> | awk '{print $NF;}'` ?

Yes, I had that in mind, but I think specifying option="-I `host <hostname> | awk '{print $NF;}'`" is at least non-portable (assuming that the options are evaluated by some shell).

>
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Antw: Re: Q: ping (ocf:pacemaker:ping) from specific address? [ In reply to ]
Hi!

After option="-I <addr>" did not work I had a look into the RA: It's a big
mess!

---
ping_update() {

if have_binary fping; then
fping_check
active=$?
else
ping_check
active=$?
fi
[...]
---

So if the system has an fping (mine has!), the RA uses fping; otherwise it
uses ping.
Also, $OCF_RESKEY_options is only used for ping, but not for fping!
Needless to say that thje options of ping and fping cannot be compared.
Welcome to the mess!

At the very least the documentation should be updated!

Regards,
Ulrich

>>> Lars Ellenberg <lars.ellenberg@linbit.com> schrieb am 04.09.2014 um 15:28
in
Nachricht <20140904132826.GH23497@soda.linbit>:
> On Thu, Sep 04, 2014 at 02:32:14PM +0200, Ulrich Windl wrote:
>> Hi!
>>
>> I'm using ocf:pacemaker:ping to ping some specific address. The requirement

> is that a specific source address (that is on a local interface) is being
> used to ping a destination. So if the resource moves between nodes, the same

> source address shall be used.
>>
>> The address to use is a secondary adress on interface bond0, like
bond0:xyz.
> I can spacify "-I bond0" and "-I bond0:xyz", but the latter seems to be
> ignores, as if I just said "-I bond0". Ping is from
iputils-ss021109-292.28.1
> (SLES11 SP3).
>>
>> I had this requirement for HP-UX years ago, and the solution was to install
a
> special local ping that allowed to select the source address.
>
>> So my preferences are:
>> 1) Get it done with the software I have
>
> ping -w 2 -c 3 -I 127.0.0.1 8.8.8.8
> ping: sendmsg: Invalid argument
> ping: sendmsg: Invalid argument
> PING 8.8.8.8 (8.8.8.8) from 127.0.0.1 : 56(84) bytes of data.
>
> --- 8.8.8.8 ping statistics ---
> 2 packets transmitted, 0 received, 100% packet loss, time 1008ms
>
> ping -w 2 -c 3 -I 10.11.12.13 8.8.8.8
> bind: Cannot assign requested address
>
> ping -w 2 -c 3 -I 10.43.9.55 8.8.8.8
> PING 8.8.8.8 (8.8.8.8) from 10.43.9.55 : 56(84) bytes of data.
> 64 bytes from 8.8.8.8: icmp_seq=1 ttl=41 time=27.4 ms
> 64 bytes from 8.8.8.8: icmp_seq=2 ttl=41 time=27.4 ms
>
> --- 8.8.8.8 ping statistics ---
> 2 packets transmitted, 2 received, 0% packet loss, time 1000ms
> rtt min/avg/max/mdev = 27.405/27.430/27.456/0.167 ms
>
> Does that help?
>
> --
> : Lars Ellenberg
> : LINBIT | Your Way to High Availability
> : DRBD/HA support and consulting http://www.linbit.com
>
> DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems