IPASTAT(8) IPASTAT(8)
NAME
ipastat -- statistics viewer
SYNOPSIS
ipastat -h|v
ipastat [-c <directory>] [-u <user>] [-g <group>] [-f <config-file>]
-t [-t]
ipastat [-c <directory>] [-u <user>] [-g <group>] [-f <config-file>]
-q <query>
DESCRIPTION
ipastat utility is used for querying IPA statistics modules and out-
putting results to the standard output (stdout). The ipastat.conf(5)
manual page gives the complete description how to configure ipastat, it
also describes all its features.
ipastat, accordingly to settings in the ipastat.conf(5) configuration
file and settings in the command line, queries IPA statistics modules
and outputs results to the standard output. This utility allows to out-
put rules, limits and thresholds list, output statistics for rules,
limits and thresholds. It is possible to use several statistics systems
at once and query statistics for several rules, limits and thresholds
at once.
ipastat does not accept any signals and signals handling is undefined.
Available options are:
-c <directory>
Set the directory ipastat should chroot(2) into immediately, the
directory should be given with absolute path. The working direc-
tory is not changed.
-f <config-file>
Use given <config-file> instead of using default configuration
file, the configuration file name should be given with absolute
pathname.
-u <user>
Change the UID of the running copy of ipastat to the given user.
The given value may be either a user name or the UID. If the -g
option is not given, then the GID will be the primary group of
the given user, all supplementary user's groups are set as well.
-g <group>
Change the GID of the running copy of ipastat to the given
group. The value given may be either a group name or a GID.
This option also changes all supplementary user's groups.
-t Parse the configuration file, output its content and exit. This
option allows to check if ipastat and IPA modules understand
your configuration file(s). Output configuration usually should
not be used as a configuration file (see a comment in the out-
put). Two -tt switches enable so called ``mimic real configura-
tion regime'', in this regime ipastat will set all default val-
ues and will apply settings from rulepat sections to rule sec-
tions.
-q <query>
Query statistics from IPA statistics modules (described in the
separate query options list).
-h Print the help message about available options and exit.
-v Show the version number, some settings, what is supported from
ipastat.conf(5) and exit.
Query options are:
-a rules
Output rules list.
-a limits
Output limits list for given rules in the -r options.
-a thresholds
Output thresholds list for given rules in the -r options.
-x <regexp>
Filter output of names (the -a option) with the given POSIX
extended regular expression.
-s <stat1> <stat2> ...
Specify st_list for next rules, limits or thresholds. New -s
option starts new list of statistics systems. This list changes
list of statistics systems given in the configuration file for
rule, limit or threshold. It is possible to specify built-in
null statistics system. If the list in this option is empty,
then previous list is forgotten and the list from the appropri-
ate section from the configuration file is used.
-i|I <interval>
Specify time interval, to specify non continuous time interval
use several options. The -I option means ``exact interval'' and
has effect only for statistics for rules. Description of formats
and what are time intervals see below.
-r <rule>
Specify rule name, it is possible to use several rules at once.
-l <limit>
Specify limit name, it is possible to use several limits at
once.
-t <threshold>
Specify threshold name, it is possible to use several thresholds
at once.
In all -a options it is allowed to use short arguments.
If the -a option is not given, then statistics for rules, limits or
thresholds is outputted. It is not allowed to mix -l and -t options,
also it is not allowed to mix single -r options and -r options with -l
or -t options. In other words: it is possible to query statistics only
for rules, only for limits or only for thresholds.
If a rule given in the -r option, does not exist in the configuration
file, then ipastat will create a rule with the given name on-the-fly if
this is allowed in ipastat.conf(5) and this rule will inherit settings
from rulepat and global sections. The same effect is for limits and
thresholds (even for rules which exist in the configuration file).
Time intervals.
The general and complete form of a time interval is the following:
Y1.M1.D1/h1:m1:s1-Y2.M2.D2/h2:m2:s2
where Y1, Y2 -- years, M1, M2 -- months, D1, D2 -- days, h1, h2 --
hours, m1, m2 -- minutes and s1, s2 -- seconds. Months can be given as
three characters abbreviations of English language months' names.
Any time interval consists of left and right parts. Each part is not
required to be completely specified. If the left part of a time inter-
val is not complete, then first second of first minute of first hour
(and so on) is taken. If the right part of a time interval is not com-
plete, then the end of last second of last minute of last hour (and so
on) is taken.
The right part of a time interval can be omitted. In this case the
right part is equal to the left part.
For a rule a time interval means, that rule's database records time-
stamps should be in the range of dates given in a time interval. If a
time interval is given in the -i option, then only one of rule's data-
base records timestamps should be in the range of dates. If a time
interval is given in the -I option, then both of rule's database
records timestamps should be in the range of dates. If a time interval
is not given, then by default time interval for the current month is
used.
For a limit a time interval means, that limit's start time should be in
the range of dates given in a time interval. If time interval is not
given, then the current state of a limit is outputted.
For a threshold a time interval does not have any effect.
EXAMPLES
Output rules list:
ipastat -q -a rul
Output rules list, which starts with "10" substring:
ipastat -q -x ^10 -a rul
Output limits list for my and lan rules:
ipastat -q -a lim -r my -r lan
Output thresholds list for given rules: rule1 and rule2 using statis-
tics system sdb, rule3 should use statistics system from the configura-
tion file:
ipastat -q -a thr -s sdb -r rule1 -r rule2 -s "" rule3
Output statistics for rules rule1 and rule2 for current month:
ipastat -q -r rule1 -r rule2
Output statistics for the rule rule1 for January and March for current
year:
ipastat -q -i jan -i mar -r rule1
Output statistics for the rule rule1 from 10:00 till 12:00 for current
day:
ipastat -q -i /10-/12 -r rule1
Output statistics for rules rule1, rule2 and rule3 for 2005 year:
ipastat -q -i 2005 -r rule1 -r rule2 -r rule3
Output current states of limits lim1 for rule1 and limx for rule2:
ipastat -q -r rule1 -l lim1 -r rule2 -l limx
Output statistics for the same limits, but all states of all limits
should have start time in January of 2004 year:
ipastat -q -i 2004.jan -r rule1 -l lim1 -r rule2 -l limx
Output statistics for thresholds thr1 for rule1, thrx and thry for
rule2, threshold thrx should use statistics system sdb, other thresh-
olds should use statistics systems from the configuration file:
ipastat -q -r rule1 -t thr1 -r rule2 -s sdb -t thrx -s "" -t thry
DIAGNOSTICS
ipastat exits with a return code 0 on success, and with a return code 1
if any error occurred.
FILES
ipastat.conf
(run ipastat with the -h switch and check default path)
SEE ALSO
ipa(8), ipactl(8), ipa.conf(5), ipastat.conf(5), ipa_mod(3)
AUTHOR
Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
BUGS
If you find any, please send email me.
April 16, 2005 IPASTAT(8)