-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ethmonitor: fix to be able to monitor interface without IP #955
Open
oalbrigt
wants to merge
2
commits into
ClusterLabs:main
Choose a base branch
from
oalbrigt:ethmonitor-monitor-interface-without-ip
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ethmonitor: fix to be able to monitor interface without IP #955
oalbrigt
wants to merge
2
commits into
ClusterLabs:main
from
oalbrigt:ethmonitor-monitor-interface-without-ip
+3
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This seems to change the semantics of the test ("ip -f inet" vs "ip -f link"). Isn't it better to test the "inet" family?
|
That wont work when monitoring devices without an IP. |
Do we want to test the device without an IP at all? Could there
be a NIC running (as in cluster resource) and in some way provide
service?
|
Yeah. For Infiniband with pkeys. |
OK. I'm still bothered by the semantic change though (link vs
inet). It is conceivable that "ip link" can return success
but "ip inet" not necessarily. Whether that is a real world
scenario I cannot say.
|
On Tue, Apr 25, 2017 at 12:50:01AM -0700, Dejan Muhamedagic wrote:
OK. I'm still bothered by the semantic change though (link vs
inet). It is conceivable that "ip link" can return success
but "ip inet" not necessarily. Whether that is a real world
scenario I cannot say.
"ip -o -f link addr show | cut -d ' ' -f2" certainly will return a superset of
"ip -o -f inet addr show | ...",
but that is exactly the whole point of the cange, iiuc.
I'd even suggest to drop that "ip | grep | cut | sort | grep | sed " call completely.
case $NIC in
*/*) ... not a proper nic name
*:*) ... not a proper nic name
ipsec*) ... not a proper nic name
*)
test -d "/sys/class/net/$NIC" || {
.. does not exist ...
.. but if not validate-all, ignore anyways,
.. because it may be a temporarily non-existing
.. bond ...
...
BTW, what strange logic is that, check only on validate,
which is never called by pacemaker anyways?
And only check for "*:*" if it exists?
and filter out ipsec*, but then ignore it?
Just wondering ...
Cheers,
Lars
|
Bridge members, bond slaves, vlans carrier... |
On Tue, Apr 25, 2017 at 01:20:13AM -0700, Lars Ellenberg wrote:
On Tue, Apr 25, 2017 at 12:50:01AM -0700, Dejan Muhamedagic wrote:
> OK. I'm still bothered by the semantic change though (link vs
> inet). It is conceivable that "ip link" can return success
> but "ip inet" not necessarily. Whether that is a real world
> scenario I cannot say.
"ip -o -f link addr show | cut -d ' ' -f2" certainly will return a superset of
"ip -o -f inet addr show | ...",
but that is exactly the whole point of the cange, iiuc.
Yes, obviously it is. I'm just weary of semantic changes.
BTW, what strange logic is that, check only on validate,
which is never called by pacemaker anyways?
The version I have always invokes ip_validate. Or did you mean
something else?
|
On Tue, Apr 25, 2017 at 03:34:27AM -0700, Dejan Muhamedagic wrote:
On Tue, Apr 25, 2017 at 01:20:13AM -0700, Lars Ellenberg wrote:
> On Tue, Apr 25, 2017 at 12:50:01AM -0700, Dejan Muhamedagic wrote:
> > OK. I'm still bothered by the semantic change though (link vs
> > inet). It is conceivable that "ip link" can return success
> > but "ip inet" not necessarily. Whether that is a real world
> > scenario I cannot say.
>
> "ip -o -f link addr show | cut -d ' ' -f2" certainly will return a superset of
> "ip -o -f inet addr show | ...",
> but that is exactly the whole point of the cange, iiuc.
Yes, obviously it is. I'm just weary of semantic changes.
> BTW, what strange logic is that, check only on validate,
> which is never called by pacemaker anyways?
The version I have always invokes ip_validate. Or did you mean
something else?
https://github.com/oalbrigt/resource-agents/blob/8ec7bd4cfcbdbff10c1c5717eae91d8c41037cda/heartbeat/ethmonitor#L236
The change is to is_interface(),
which is used only in if_init(),
if is_interface ; then
*:*) --> exit OCF_ERR_GENERIC
otherwise: ok.
else
(apparently not an "interface" we currently know about,
or explicitly filtered out by grep -v ipsec)
$__OCF_ACTION == validate-all --> exit ERR_CONFIGURED
all other actions (start,stop,monitor):
ah well, log a warning, but otherwise ignore.
fi
|
On Tue, Apr 25, 2017 at 05:35:41AM -0700, Lars Ellenberg wrote:
On Tue, Apr 25, 2017 at 03:34:27AM -0700, Dejan Muhamedagic wrote:
> On Tue, Apr 25, 2017 at 01:20:13AM -0700, Lars Ellenberg wrote:
> > On Tue, Apr 25, 2017 at 12:50:01AM -0700, Dejan Muhamedagic wrote:
> > > OK. I'm still bothered by the semantic change though (link vs
> > > inet). It is conceivable that "ip link" can return success
> > > but "ip inet" not necessarily. Whether that is a real world
> > > scenario I cannot say.
> >
> > "ip -o -f link addr show | cut -d ' ' -f2" certainly will return a superset of
> > "ip -o -f inet addr show | ...",
> > but that is exactly the whole point of the cange, iiuc.
>
> Yes, obviously it is. I'm just weary of semantic changes.
>
> > BTW, what strange logic is that, check only on validate,
> > which is never called by pacemaker anyways?
>
> The version I have always invokes ip_validate. Or did you mean
> something else?
https://github.com/oalbrigt/resource-agents/blob/8ec7bd4cfcbdbff10c1c5717eae91d8c41037cda/heartbeat/ethmonitor#L236
The change is to is_interface(),
which is used only in if_init(),
if is_interface ; then
*:*) --> exit OCF_ERR_GENERIC
otherwise: ok.
else
(apparently not an "interface" we currently know about,
or explicitly filtered out by grep -v ipsec)
$__OCF_ACTION == validate-all --> exit ERR_CONFIGURED
all other actions (start,stop,monitor):
ah well, log a warning, but otherwise ignore.
fi
OK, see now what you mean, strange thing. Renders this part
effectively useless.
|
8ec7bd4
to
5fae126
Compare
if_validate is run before all actions except meta-data and usage/help. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.