partinfo

(Show summary of space on AFS server partitions)

SYNOPSIS

partinfo [-chqtv] [-T <empty>,<full>] afssvr

DESCRIPTION

partinfo does a vos partinfo on a particular AFS server to determine the amount of used and free space. Unlike vos partinfo, however, it also formats the output into a more easily readable tabular form, displays the total disk space, the used disk space, and the free disk space, calculates what percent full the partition is, and displays the amount that can still be put on the partition before it goes over a particular threshold.

Normally, partinfo displays a header above the output giving the meaning of the columns, but this can optionally be suppressed. partinfo can also optionally use color to highlight partitions with plenty of free space and partitions that are too full.

There are two thresholds that partinfo cares about. The first is the threshold before which the partition will be considered to be mostly empty. This will only change the output if color is requested with -c; if it is, the partition will be shown in green. It defaults to 60%. The second is the threshold after which the partition will be considered full. The final column, available space, is the amount of space remaining on the partition before it goes over this threshold, and partitions over this threshold will be shown in red if color is requested with -c. The thresholds may be changed at the top of this script or overridden for one invocation with -T.

If the server given is just a number, afssvr will be prepended to form the server name.

OPTIONS

-c, --color

Use color to highlight interesting data. Currently this just means that the percent full column will be shown in green for partitions under 60% full and in red for partitions over 90% full. Using this option requires that the Term::ANSIColor module be installed and available on the user's system (this module is not required if -c is not used).

To override the above thresholds, see the -T option.

-h, --help

Print out this documentation (which is done simply by feeding the script to perldoc -t).

-q, --quiet

Suppress the header normally printed to explain the meanings of each column of data.

-t, --total

Print totals for the entire server.

-T empty,full
--thresholds=empty,full

Override the default thresholds of 60% (before which a partition will be considered mostly empty) and 90% (after which the partition will be considered full). -T should take two integers between 0 and 100 separated by a comma.

-v, --version

Print out the version of partinfo and exit.

CONFIGURATION

partinfo loads configuration settings from /etc/afs-admin-tools/config if that file exists. If it exists, it must be Perl code suitable for loading with require. This means that each line of the configuration file should be of the form:

    our $VARIABLE = VALUE;

where $VARIABLE is the configuration variable being set and VALUE is the value to set it to (which should be enclosed in quotes if it's not a number). The file should end with:

    1;

so that Perl knows the file was loaded correctly.

The supported configuration variables are:

$PARTINFO_EMPTY
$PARTINFO_FULL

The default thresholds. The first gives the threshold before the partition is considered reasonably well-utilized, and defaults to 60%. The second gives the threshold before the partition is considered full (and also determines how much space is shown as available in the last column of the report). It defaults to 90%. These are used for colorizing the output (with the -c option) and can be overridden with the -T command-line option.

$VOS

The full path to the AFS vos utility. If this variable is not set, partinfo defaults to /usr/local/sbin/vos or /usr/sbin/vos if they exist, and otherwise looks for vos on the user's PATH.

EXAMPLES

The following command shows the current status of afssvr1:

    partinfo afssvr1

This command shows the same data, but without the header and with color highlighting of interesting percent full data:

    partinfo -qc afssvr1

This command does the same for afssvr5:

    partinfo --color --quiet afssvr5

Use thresholds of 70% and 95% instead, showing the results in color:

    partinfo -T 70,95 -c afssvr5

AUTHORS

Original Perl script written by Neil Crellin <neilc@stanford.edu>, modified by Russ Allbery <eagle@eyrie.org> to use formats, to include an explanatory header, to use color if wanted, and to add optional totals.

COPYRIGHT AND LICENSE

Copyright 1998, 1999, 2003, 2004, 2011 The Board of Trustees of the Leland Stanford Junior University.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

vos(1), vos_partinfo(1)

This script is part of the afs-admin-tools package. The most recent version is available from the afs-admin-tools web page at <http://www.eyrie.org/~eagle/software/afs-admin-tools/>.

Last spun 2022-12-12 from POD modified 2014-09-06