Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
GATHER.PL.IN(1)        User Contributed Perl Documentation	 GATHER.PL.IN(1)

NAME
     gather -- collect and display system statistics

DESCRIPTION
     gather can be used to store system statistics provided by variety of system
     utils and display it. It is just a wrapper around these utils to make work
     with system statistics more convenient.

     Commands we want to use to get statistics should be described in gather.map
     file. This file contains a map -- Perl hash structure initialized to some-
     thing like this:

       %map = ('uptime'   => {'desc' => 'system uptime',
			      'cmd'  => '/usr/bin/uptime'},
	       'sysctl'   => {'desc' => 'sysctl variables',
			      'cmd'  => '/sbin/sysctl -a'},
	       'sockstat' => {'desc' => 'sockstat output',
			      'cmd'  => '/usr/bin/sockstat'});

     Location of gather.map and other gather configuration variables are set in
     gather.cfg file.

     When you have configured gather.cfg and the map you can run gather to col-
     lect data:

       gather collect

     gather will run all commands specified in map and store output in $datadir
     directory. It is supposed that you will set up cron to run this command
     with desired periodicity.

     If you don't have Perl on the host where you want to collect statistics you
     can generate shell script on another host (e.g. your workstation) using the
     command:

       gather script

     and use it. Collected statistics can be copied to your workstation and ana-
     lyzed with gather.

     Also you will probably need to setup command in crontab to run daily and
     expire old data:

       gather expire <days>

     otherwise you will risk to run out of free space. Data older then <days>
     will be deleted.

     The data are stored in $datadir directory (compressed if this is specified
     in config or by command line switch). You can browse and look on it as is,
     but in many cases it is convenient to use gather:

       gather show <subcommand>

     Run:

       gather show help

     to see minihelp about available subcommands.

     Running the command:

       gather arch -t <timeperiod> <archname>

     you can archive data for specified time period.

OPTIONS
     There are some options that can be used to modify behavior of gather util-
     ity. Run

       gather help

     to read their description.

TIMEPERIODS
     Running show command to display some statistics you should specify timepe-
     riod with option -t.

     The most general form of timeperiod is:

       YYYY-MM-DD/HH/MM--yyyy-mm-dd/hh/mm

     where YYYY-MM-DD/HH/MM is start of timeperiod and yyyy-mm-dd/hh/mm is its
     end. You can skip MM and HH in start or end part of range. E.g:

       2008-11-16/14--2008-11-17

     This is interpreted as:

       2008-11-16/14/00--2008-11-17/23/59

     It is also possible to specify only the first part of a timeperiod. E.g:

       2008-11-16/14 (interpreted as 2008-11-16/14/00--2008-11-16/14/59)

     or

       2008-11-16 (interpreted as 2008-11-16/00/00--2008-11-16/23/59)

     If day, hour or minute in end part of timeperiod is the same as in the
     start one, you can skip it:

       YYYY-MM-DD/HH/MM--/hh/mm (interpreted as YYYY-MM-DD/HH/MM--YYYY-MM-DD/hh/mm)

       YYYY-MM-DD/HH/MM--//mm (interpreted as YYYY-MM-DD/HH/MM--YYYY-MM-DD/HH/mm)

       YYYY-MM-DD/HH/MM--yyyy-mm-dd// (interpreted as YYYY-MM-DD/HH/MM--yyyy-mm-dd/HH/MM)

       and so on.

     Here are some shortcuts you can use to reduce typing:

       .	 current day

       ./.	 current day/current hour

       ././.	 current day/current hour/current minute

       $	 date of the last collection

       Nd	 N days ago

       Nh	 N hours ago

       Nm	 N minutes ago

     If N{d,h,m} is used alone (there is only start part) then it is replaced by
     timeperiod "from that time by now". I.e. timeperiod "Nd" is the same as
     "Nd--$".

SEE ALSO
     sysctl(8), netstat(1), vmstat(8), ps(1), iostat(8)

AUTHOR
     Mikolaj Golub <to.my.trociny@gmail.com>

perl v5.42.2			   2016-06-29			 GATHER.PL.IN(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gather&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help