The best way to do this is with avahi
which implements multicast-dns (this is what Apple calls Bonjour).
I would disable Network Manager and go with configuring networking in /etc/network/interfaces
. The interfaces
file supports the ipv4ll
method, which uses avahi-autoipd to configure an interface with an IPv4 Link-Layer address (169.254.0.0/16 family).
Next, set up a service in avahi to ensure the host advertises itself via bonjour and add mDNS name resolution to /etc/nsswitch.conf
.
If the rest of your systems are configured to resolve mDNS names, it should all work like magic.
Have you tried dstat
?
in case of my enp025 Ethernet interface for example :
dstat -i -N enp0s25
----interrupts---
33 34 35
5 0 0
6 0 0
8 0 26
9 0 0
7 0 0
10 0 0
for doing more stuff , read the man page:
DSTAT(1) DSTAT(1)
NAME
dstat - versatile tool for generating system resource statistics
SYNOPSIS
dstat [-afv] [options..] [delay [count]]
DESCRIPTION
Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations and adds some extra features.
Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from
your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).
Dstat also cleverly gives you the most detailed information in columns and clearly indicates in what magnitude and unit the output is
displayed. Less confusion, less mistakes, more efficient.
Dstat is unique in letting you aggregate block device throughput for a certain diskset or network bandwidth for a group of interfaces,
ie. you can see the throughput for all the block devices that make up a single filesystem or storage system.
Dstat allows its data to be directly written to a CSV file to be imported and used by OpenOffice, Gnumeric or Excel to create graphs.
Note
Users of Sleuthkit might find Sleuthkit’s dstat being renamed to datastat to avoid a name conflict. See Debian bug #283709 for more
information.
OPTIONS
-c, --cpu
enable cpu stats (system, user, idle, wait, hardware interrupt, software interrupt)
-C 0,3,total
include cpu0, cpu3 and total (when using -c/--cpu)
-d, --disk
enable disk stats (read, write)
-D total,hda
include total and hda (when using -d/--disk)
-g, --page
enable page stats (page in, page out)
-i, --int
enable interrupt stats
-I 5,10
include interrupt 5 and 10 (when using -i/--int)
-l, --load
enable load average stats (1 min, 5 mins, 15mins)
-m, --mem
enable memory stats (used, buffers, cache, free)
-n, --net
enable network stats (receive, send)
-N eth1,total
include eth1 and total (when using -n/--net)
-p, --proc
enable process stats (runnable, uninterruptible, new)
-r, --io
enable I/O request stats (read, write requests)
-s, --swap
enable swap stats (used, free)
-S swap1,total
include swap1 and total (when using -s/--swap)
-t, --time
enable time/date output
-T, --epoch
enable time counter (seconds since epoch)
-y, --sys
enable system stats (interrupts, context switches)
--aio enable aio stats (asynchronous I/O)
--fs, --filesystem
enable filesystem stats (open files, inodes)
--ipc enable ipc stats (message queue, semaphores, shared memory)
`
and a lot of other options.
see also : lspci -v -x
Best Answer
It's the
device
link in class directories that you aren't supposed to use. The idea is that/sys/class/net/eth0
is a symbolic link to somewhere under/sys/devices
, and thedevice
link merely links to a (grand-)*parent directory; instead of using thedevice
link, you're supposed to walk back to a parent directory if needed.Accessing files in
/sys/class/net/eth0/
is fine.If you're refering to the operational status found in
/sys/class/net/eth0/operstate
, there are a few more. The names are defined innet/core/net-sysfs.c
and the constants ininclude/uapi/linux/if.h
. They come from RFC 2863.