kuznet@ms2.inr.ac.ru
nstat
is simple tool helping to monitor kernel snmp
counters.
The format of the command is:
nstat [ OPTIONS ] [ PATTERN [ PATTERN ] ]
PATTERN
is shell style pattern, selecting identifier
of variables to dump. Variable is displayed if one of patterns
matches its name. If no patterns are given, nstat
assumes
that user wants to see all the variables.
OPTIONS
is list of single letter options, using common unix
conventions.
-h
- show help page-?
- the same, of course-v
, -V
- print version of nstat
and exit-z
- dump zero counters too. By default they are not shown.-a
- dump absolute values of counters. By default nstat
calculates increments since the previous use.-s
- do not update history, so that the next time you will
see counters including values accumulated to the moment
of this measurement too.-n
- do not display anything, only update history.-r
- reset history.-d INTERVAL
- nstat
is run in daemon mode, collecting
statistics. INTERVAL
is interval between measurements
in seconds.-t NUMBER
- tune time constant of rate estimator. It is floating
point number greater or equal 1. The larger value is the
more inertial rate estimation. With value of 1 rate value
is taken from the last measurement.
History is just dump saved in file /tmp/.nstat.uUID
or in file given by environment veariable NSTAT_HISTORY
.
Each time when you use nstat
values there are updated.
If you use patterns, only the values which you _really_ see
are updated. If you want to skip an unintersting period,
use option -n
, or just output to /dev/null
.
nstat
understands when history is invalidated by system reboot
or source of information switched between different instances
of daemonic nstat
and kernel SNMP tables and does not
use invalid history.
Beware, nstat
will not produce sane output,
when many processes use it simultaneously. If several processes
under single user need this utility they should use variable
NSTAT_HISTORY
to put their history in safe places
or to use it with options -a -s
.
Well, that's all. The utility is very simple, but nevertheless very handy.
Output
The first line of output is #
followed by identifier
of source of information, it may be word kernel
, when nstat
gets information from kernel or some dotted decimal number, when
it obtains information from running nstat
daemon.
The rest of output consists of three columns: SNMP MIB identifier, its value (or increment since previous measurement) and average rate of increase of the counter per second.
Environment
NSTAT_HISTORY
- name of history file.
BUG. Damn, current kernel is buggy and prints one additional zero after ICMP MIB. Currently it is worked around with dirty hack. However this workaround will break after the bug in the kernel will be fixed. Certainly it is better to rewrite parser... I am lazy.