Next Previous Contents

NSTAT Utility

Alexey Kuznetosv, kuznet@ms2.inr.ac.ru

some_negative_number, 20 Sep 2001


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.

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.


Next Previous Contents