Skip to content
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

which with remote Ohai doesn't seem to work as expected #1665

Open
tas50 opened this issue May 11, 2021 · 0 comments
Open

which with remote Ohai doesn't seem to work as expected #1665

tas50 opened this issue May 11, 2021 · 0 comments
Labels
Focus: Target Mode Issues related to running Ohai remotely Type: Bug Does not work as expected.

Comments

@tas50
Copy link
Contributor

tas50 commented May 11, 2021

The Network plugin has a check to see if the ip command exists:

if which("IP")

if this fails it falls back to route and executes:

shell_out("route -n")

When remote ohai is run against a Unifi UDM Pro:

[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /bin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /sbin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /usr/bin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /usr/sbin'
'/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /usr/local/sbin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /usr/local/bin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:54-07:00] DEBUG: [SSH] [email protected] cmd = stat -L /usr/sbin/ip 2>/dev/null --printf '%s
%f
%U
%u
%G
%g
%X
%Y
%C'
[2021-05-10T20:58:55-07:00] DEBUG: [SSH] [email protected] cmd = route -n

It's clearly failing to find the IP command which is there:

# which ip
/sbin/ip
@tas50 tas50 added the Type: Bug Does not work as expected. label May 11, 2021
@tas50 tas50 added the Focus: Target Mode Issues related to running Ohai remotely label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus: Target Mode Issues related to running Ohai remotely Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant