hermeszhang / fiberstat

Optic fiber RX/TX power level monitoring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fiberstat

fiberstat is a small C program that allows monitoring TX/RX power levels in optic fiber network links.

It relies on the kernel exposing a hwmon entry in sysfs that can be associated to the network interface, and this program just polls the power values in mW and shows them in a bar diagram with the values in dBm.

Building

options and dependencies

The only dependency of the fiberstat program is the ncurses library.

configure, compile and install

Building for target iMX6 with a generic toolchain:

  $ NOCONFIGURE=1 ./autogen.sh
  $ ./configure --host=arm-linux-gnueabihf --prefix=/opt/test
  $ make
  $ sudo make install

Building at host forcing test features (e.g. if the host doesn't have any optic fiber based network interface):

  $ NOCONFIGURE=1 ./autogen.sh
  $ ./configure --prefix=/usr CFLAGS="-DFORCE_TEST_SYSFS -DFORCE_TEST_LEVELS"
  $ make
  $ sudo make install

Running

The program may be run just with the defaults, where it will automatically look for the network interfaces exposing hwmon entries with the specific power level files for TX and RX:

$ fiberstat

The program may also be run specifying which explicit interfaces to monitor:

$ fiberstat -i eth_fc_1000_1 -i eth_fc_1000_2

Or with a polling rate faster than the default of 1Hz; e.g. setting 10Hz (argument is the period given in ms):

$ fiberstat -t 100

License

This fiberstat program is licensed under the GPLv3+ license.

About

Optic fiber RX/TX power level monitoring

License:GNU General Public License v3.0


Languages

Language:C 73.9%Language:M4 23.4%Language:Makefile 1.9%Language:Shell 0.8%