Bug #1346
Using 'ip addr' over ifconfig
| Status: | Code Insufficient | Start date: | 06/03/2008 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | library | |||
| Target version: | 1.6.x | |||
| Keywords: | Affected Facter version: | |||
| Branch: | ||||
| Votes: | 8 |
Description
# facter /usr/lib/ruby/site_ruby/1.8/facter/ipmess.rb:85: command not found: /sbin/ifconfig -a /usr/bin/facter:54: command not found: /sbin/ifconfig -a /usr/bin/facter:54: command not found: dnsdomainname /usr/bin/facter:54: command not found: domainname /usr/bin/facter:54: command not found: /sbin/ifconfig architecture => i386 domain => internal.HIDDEN facterversion => 1.3.8 fqdn => ruby-test.internal.HIDDEN hardwareisa => unknown hardwaremodel => i686 hostname => ruby-test id => root ipaddress => 10.200.201.73
It would be nice if when ifconfig can’t be found, it falls back to using ‘ip addr’ (or the other way around) – also, notice that domainname and dnsdomainname are not present on this system – however facter does appear to get them correct regardless.
Related issues
History
Updated by James Turnbull almost 4 years ago
- 6 changed from Unreviewed to Needs more information
What platform is this? Versions?
Updated by James Turnbull almost 4 years ago
- Category set to library
- Target version set to 1.5.0
Updated by Redmine Admin almost 4 years ago
- Status changed from 1 to Needs More Information
Updated by James Turnbull almost 4 years ago
- Target version changed from 1.5.0 to 14
Updated by Miah Johnson over 3 years ago
The ‘ip’ command is available on most Linux distributions, in the iproute2 package. The ‘ip’ command provides avanced functionality that isnt available in ifconfig.
http://www.linuxfoundation.org/en/Net:Iproute2 http://en.wikipedia.org/wiki/Iproute2 http://www.policyrouting.org/iproute2-toc.html
Updated by Joe McDonagh almost 3 years ago
Just to chime in on this- ifconfig is being deprecated on Linux, so it may be worth it to start moving towards the use of ip for network facts on Linux systems.
Updated by Benedikt Böhm over 2 years ago
the following patch fixes the domainname/dnsdomainname warnings: http://github.com/hollow/facter/commit/92f6b049724a620f3833dde10b8126a70ce52a08
Updated by Paul Nasrat almost 2 years ago
- Status changed from Needs More Information to Accepted
- Assignee set to martin krafft
Assigning to Martin as in Issue #4498
Updated by Spencer Rinehart 11 months ago
Arch Linux recently deprecated net-tools in favor of iproute2 and yp-tools. [1] I give a big +1 for ip addr.
[1] http://www.archlinux.org/news/deprecation-of-net-tools/
Updated by Julien GEORGES 11 months ago
- File facter-ip_addr-linux.patch added
Hi everyone, I’ve work on a personal patch for facter 1.5.7-1 to use ‘ip addr’ instead of ‘ifconfig’.
I had some trouble with ifconfig when you enable infiniband interfaces. In this situation, ifconfig is obsolete and facter prints a lot of garbage messages like that :
Ifconfig uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes. Because Infiniband address has 20 bytes, only the first 8 bytes are displayed correctly.
Here is my little contribution, you will find my svn diff file attached to this issue (facter-ip_addr-linux.patch).
This patch is only for linux usage! I didn’t modify the code for the other systems (like ‘OpenBSD’, ‘NetBSD’, ‘FreeBSD’, ‘Darwin’…) because I don’t have any of these systems to test my modifications. If you use one of these systems, be careful if you apply this patch.
I’ll be glad if you give me some return about my work or if you have any advice to improve this patch.
Thanks, Julien.
Updated by Alex Demidov 8 months ago
On Gentoo hosts ifconfig -a output has interface names truncated to 9 chars (see this gentoo bug) so facter actually broken there because it gets incorrect interfaces list. See this discussion in puppet-users google group for additional details.
Updated by Ken Barber 6 months ago
- Description updated (diff)
- Assignee deleted (
martin krafft)
Updated by Ken Barber 6 months ago
According to #11113 – the June version of Archlinux no longer includes ifconfig … so Facter is broken for that.
Updated by Adrien Thebo 5 months ago
- Target version changed from 14 to 1.6.x
This should happen sooner rather than later. We can add another fact resolution that uses ip if it’s available, and then fall back to ifconfig if it isn’t present.
Updated by Shawn Taaj 4 months ago
- Assignee set to Shawn Taaj
Updated by Shawn Taaj 4 months ago
- Assignee deleted (
Shawn Taaj)
Updated by shubhra sinha varma 4 months ago
- Status changed from Investigating to Accepted
- Assignee set to shubhra sinha varma
Updated by shubhra sinha varma 3 months ago
Linux is functional (ip addr instead of ifconfig), working on other parts.
Updated by Daniel Pittman 3 months ago
The submitted pull request was entirely wrong.