App::OpenVZ::BCWatch - Monitor the OpenVZ user_beancounters file
use App::OpenVZ::BCWatch; $watch = App::OpenVZ::BCWatch->new; $watch->process;
App::OpenVZ::BCWatch monitors the /proc/user_beancounters file and sends mail notifications whenever important values change (as defined by the user).
App::OpenVZ::BCWatch
The recommended usage of this application module is to use the provided vzwatchd daemon.
Version 2.5 of the user_beancounters file is supported.
$watch = App::OpenVZ::BCWatch->new;
Instantiate an App::OpenVZ::BCWatch object.
$watch->process;
Inspect whether the user_beancounters file differs from the last run, and if, report the differences via mail.
Run vzwatchd as root without arguments to obtain a list of commands.
When vzwatchd is started initially, the /etc/vzwatchd.conf file will be generated. The configuration will then subsequently remain inactive until the _active flag is either set within or deleted from the configuration file.
_active
The configuration file is being parsed by Config::File. Unless noted otherwise, each option takes exactly one value. Specifying more than one value for an option requires that the values are separated by whitespace.
Adjustable options with defaults are:
mail[from]
Mail sender address. Defaults to root@localhost.
root@localhost
mail[to]
Mail recipient address. Defaults to root@localhost.
mail[subject]
Mail subject line. Defaults to: vzwatchd: NOTICE.
vzwatchd: NOTICE
monitor_fields
One or more field names to monitor for changes. Defaults to: failcnt.
failcnt
sleep
Sleep interval in seconds. Defaults to 60.
verbose
Be verbose? Defaults to false.
Configuration active? Defaults to false.
Additional options with defaults are:
input_file
Location of the user_beancounters file. Defaults to /proc/user_beancounters.
data_file
Location of the data file. Defaults to $HOME/vzwatchd.dat.
Cannot parse anything else than the user_beancounters file.
Only version 2.5 of the user_beancounters file is known to work.
Fixed mail report template.
No more than one mail recipient.
Note that the sender and recipient mail address options with defaults might require adjustment in order for notifications to be delivered.
OpenVZ::BC, http://openvz.org
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
To install App::OpenVZ::BCWatch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::OpenVZ::BCWatch
CPAN shell
perl -MCPAN -e shell install App::OpenVZ::BCWatch
For more information on module installation, please visit the detailed CPAN module installation guide.