SkillAgentSearch skills...

Sysusage

SysUsage is a system monitoring and alarm reporting tool. It can generate historical graph views of CPU, memory, IO, network and disk usage, and very much more.

Install / Use

/learn @darold/Sysusage
About this skill

Quality Score

0/100

Category

Operations

Supported Platforms

Universal

README

NAME SysUsage v5.7 - System Monitoring Tool

DESCRIPTION SysUsage is a tool used to continuously monitor a system and generate daily/weekly/monthly/yearly graphical report using rrdtool and sar.

FEATURES SysUsage generate graphical reports on all system activity information. His periodical reports allow you to keep track of the machine activity during his life and will be a great help for performance analysis and resources management.

SysUsage can be run periodically from 10 seconds cycle in daemon mode to
1 minute or more using crond.

SysUsage can be run from a central server to call a ssh remote execution
of the sysusage perl script so that collected data will be stored in
this central place. You also will have just one place where rrdtool and
related Perl modules need to be installed as well as just one place
where sysusagegraph or sysusagejqgraph need to be executed.

CPUs - CPUs distribution usage (user, nice, system). - CPUs global usage (total cpu used, iowait). - CPUs virtualized usage (steal, guest).

Memory - Memory usage (with and without cache). - Swap usage (with and without cache). - Amount of memory need for current workload. - Posix share memory. - Hugepages utilisation - Active versus inactive memory - Dirty memeory that need to be written to disk

I/O - Context switches per second. - Interrupts per second. - Page swapping. - Page I/O stats. - I/O request stats. - I/O block stats.

Network - TCP connections per second. - TCP segments per second. - Number of socket in use (Total, TCP and UDP). - Number of socket in TIME_WAIT state. - Active network interface usage. - Active network interface bad packet, dropping, collision.

Devices - CPU time for I/O on device. - Read/Write sectors on device. - Disk throughput on device. - I/O workload on device.
- Times for I/O requests issued to device. - Hard drive temperature if your hardward support it (with hddtemp). - MotherBoard/CPU/Remote temperature reported by sensors or sar. - Fan RPM reported by sensors.

Files - Number of open file. - Number of file in a queue directory. - Disk space used on mounted partition.

Process - Load average. - Process created per second. - Number of running process (ex: sendmail, httpd, oracle, etc.). - Number of running thread (ex: mysqld, amarok, etc.). - Number of task blocked waiting for I/O

Notification You can have mail or Nagios notification when some monitored values are outside max/min threshold values for all type of monitoring.

Plugins With SysUsage you can create your own monitoring plugins. Any script or program can be embeded in SysUsage provided that it return up to 3 numeric values. The graphic title and labels are defined in the configuration file.

Remote call SysUsage can be installed and run onto a central server that will be used to store statistics data by periodically calling sysusage on remote host using SSH. This central place will also be in charge to renderer HTML plages and graphics for all hosts. This will allow to simplify the SysUsage installation on remote host that will only require sysstat and rsysusage.

REQUIREMENT rrdtool You need to install rrdtool. All distribution may have a dedicated package for rrdtool. On CentOs/RedHat distributions, use the following command:

        yum install rrdtool rrdtool-perl

on Debian/Ubuntu distributions use command:

        apt-get install rrdtool librrds-perl

The sources can be found here:

        http://people.ee.ethz.ch/~oetiker/

If you compile from sources and want to use the RRDs perl module
embedded with it, you must use the following command to compile:

        make site-perl-install

This installation is optional if sysusage is installed on a remote host.

sysstat You also need sar to collect statistics. Sar is part of the sysstat package. For RPM like distributions:

        yum install sysstat

and Debian like distributions:

        apt-get install sysstat

The sources can always be found here :

        http://freshmeat.net/projects/sysstat/

If you plan to use threshold notification you must have Net::SMTP
installed.

        yum install perl-Net-SMTP-SSL

or

        apt-get install libnet-smtp-ssl-perl

Sources can be found on CPAN (https://metacpan.org/pod/Net::SMTP)

Perl modules Sysusage can be run in a central place to collect remote sysusage statistics using ssh. The remote calls are proceed simultaneously using fork with the Proc::Queue Perl module.

If you're plan tu use sysusagegraph instead of sysusagejqgrpah you will
also need the GD and GD::Graph3D Perl modules. Note that the use of GD
and GD::Graph is deprecated and sysusagegraph will be removed in next
major release (6.0).

All these modules are always available from CPAN (https://metacpan.org/)
and may at least be installed on the central server. On remote host this
is optional and depend if you want to run it on each server or by ssh
from a central place.

Nagios nsca client (optional) If you want to send message to Nagios you need to install nsca-2.7.2.tar.gz or a more recent version. You can get it here:

        http://sourceforge.net/projects/nagios/files/

hddtemp and sensors (optional) If you want to monitor your hard drive temperature you must install a small utility called hddtemp. You can download it from http://download.savannah.gnu.org/releases/hddtemp/. Run it to see if your hard drive have a temperature sensor.

You can also use sensors to monitor your cpu temperature and fan speed.
If you harware support it run sensors-detect and load the required
kernel modules at boot time.

INSTALLATION Quick install Simply run the following commands:

        perl Makefile.PL
        make && make install

By default it will copy the perl programs into /usr/local/sysusage/bin
and the HTML output will be done to /var/www/htdocs/sysusage/. The
configuration file is /usr/local/sysusage/etc/sysusage.cfg and all RRD
Bekerley DB databases from rrdtool will be saved under
/usr/local/sysusage/rrdfiles.

If you plan to run sysusage on different servers from a central place
you may just want to install the rsysusage Perl script on remote hosts.
So proceed as follow:

        perl Makefile.PL REMOTE=1
        make && make install

It will copy the only the rsysusage into /usr/local/sysusage/bin and the
configuration file under /usr/local/sysusage/etc/sysusage.cfg. The RRD
data directory will be created under /usr/local/sysusage/rrdfiles but
just to hold the *.cnt files relatives to the count of alert attempt on
threshold exceed.

Custom install You can overwrite all install path with the following Makefile.PL arguments. Here are the default values:

        BINDIR=/usr/local/sysusage/bin
        CONFDIR=/usr/local/sysusage/etc
        PIDDIR=/usr/local/sysusage/etc
        BASEDIR=/usr/local/sysusage/rrdfiles
        PLUGINDIR=/usr/local/sysusage/plugins
        HTMLDIR=/var/www/htdocs/sysusage
        MANDIR=/usr/local/sysusage/doc
        DOCDIR=/usr/local/sysusage/doc
        REMOTE=

For example on a RedHat System you may prefer install SysUsage as this:

        perl Makefile.PL BINDIR=/usr/bin CONFDIR=/etc PIDDIR=/var/run \
                BASEDIR=/var/lib/sysusage HTMLDIR=/var/www/html/sysusage \
                MANDIR=/usr/man/man1 DOCDIR=/usr/share/doc/sysusage

If you are installing sysusage on a host that will be call by ssh from a
central place, you may want to install just what is necessary and not
more:

        perl Makefile.PL BINDIR=/usr/bin CONFDIR=/etc PIDDIR=/var/run \
                MANDIR=/usr/man/man1 DOCDIR=/usr/share/doc/sysusage \
                REMOTE=1

This will just install the rsysusage Perl script, the configuration file
and documentation. So that you don't need to install extra Perl modules
and other graphics related things.

Package/binary install In directory packaging/ you will find all scripts to build RPM, slackBuild and debian package. See README in this directory to know how to build these packages.

USAGE SysUsage consist in two main Perl scripts, sysusage and sysusagegraph. Once you have correctly installed and configured SysUsage the best way to execute them is by setting a cron job. If you prefer javascript graphics instead of GD::Graph images use sysusagejqgraph that is based on jqplot javascript library. This is the recommanded script as use of GD::Graph through sysusagegraph is deprecated.

sysusage The script sysusage is responsible of collecting system informations at a given interval and store them into rrdtool database files.

As it is very fast you can set running interval time to 1 minute. This
is the default pooling interval used in configuration and graph reports.
If you change this interval you must also change it in the configuration
file otherwise your graph will be false. See the INTERVAL configuration
directive.

Here is how I use it with a default installation:

        */1 * * * * /usr/local/sysusage/bin/sysusage > /dev/null 2>&1

rsysusage This script do the same things as the sysusage Perl

View on GitHub
GitHub Stars29
CategoryOperations
Updated8mo ago
Forks5

Languages

Perl

Security Score

82/100

Audited on Jul 16, 2025

No findings