.\" .\" Copyright (c) 2001 Hellmuth Michaelis. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" last edit-date: [Sun Aug 19 14:37:15 2001] .\" .Dd August 19, 2001 .Dt NIFMON 8 .Os .Sh NAME .Nm nifmon .Nd display network interface status, statistics and data .Sh SYNOPSIS .Nm .Op Fl b .Op Fl e Ar expr .Op Fl i Ar if .Op Fl r Ar tty .Op Fl t Ar term .Sh DESCRIPTION .Nm is a curses application which displays counters and statistics of one particular network interface in one part of the screen and a stripped down .Xr tcpdump 8 output for this interface in the other part of the screen. .Pp It is intended to be run in background on an unused .Xr syscons 4 or .Xr pcvt 4 virtual terminal to monitor a .Xr tun 4 interface used with .Xr ppp 8 with an ADSL line but can also be started as a normal program to monitor any other network interface. .Pp The following options are available: .Bl -tag -width Ds .It Fl b selects background mode of operation, note that specifying options -t and -r is mandatory with this mode. .It Fl e specify a filter expression to be used with tcpdump. .It Fl i select the interface to be monitored (default is lo0). .It Fl r select the device file of a virtual terminal to which output is redirected. .It Fl t specify the terminal type (i.e. vt220, cons25, pcvt25) for the terminal selected with the -r option. .El .Pp Following is a description of the various displayed fields from top to bottom: .Br In the first line the interfaces IP address, hostname and either the destination address (for point-to-point links) or broadcast address is displayed followed by a line of the last administrative change time and the previous administrative change time and the hour, minutes and seconds how long these lasted (i wanted to know how long the dynamic IP addresses i got from my provider were in effect). .Pp Then come two lines with the number of bytes in and out and the number of packets in and out for this interface. .Pp After that you get statistics: the number of bytes and packets in and out for the last second, minute and hour. .Pp In the lower half of the screen an (adjusted and mangled) output of tcpdump running on that interface can be seen (i just wanted to get a very rough idea what is happening on that interface). A filter expression (i.e. "ip") for this tcpdump can be specified on the commandline using the -e switch. .Pp To get the most needed information available from tcpdump, its output is modified as follows: only lines starting with a timestamp are displayed, the date is removed from the timestamp, the own hostname is removed and the strings [tcp sum ok] and [udp sum ok] are removed. .Sh FILES /var/run/nifmon-.pid .Sh BUGS The whole thing started as a hack, a fact which can be seen at many places in the source. The pipe interface to run tcpdump is a bit strange, when .Nm is killed or abnormally terminated, the forked tcpdump will have to be terminated manually. Suggestions, hints and patches welcome. .Sh EXAMPLES The command: .Bd -literal -offset indent nifmon -b -itun1 -r/dev/ttyv2 -tpcvt25h .Ed .Pp monitors interface tun1 in background mode on virtual terminal /dev/ttyv2 with a terminal type of pcvt25h (for the pcvt driver). .Sh AUTHORS The .Nm utility and this manpage were written by .An Hellmuth Michaelis Aq hm@freebsd.org .