Thursday, July 29, 2010

LoadAVG

lightweight load, memory & transfer monitoring

Installation

Posted by admin On March - 19 - 2009

Installation & Configuration
Important! If you have a Virtuozzo v. 3 or OpenVZ VPS you must install the beanc helper app before installing loadavg.

Installation may be done from a shell command line or via FTP. Installation should be done as an ORDINARY USER, not root. All loadavg directories & files should be owned by the user who owns the account/filespace where the scripts are installed.

Command line install:

1. Fetch & extract the files to public webspace:

[user@server] # cd public_html
[user@server] # wget http://downloads.sourceforge.net/project/loadavg/loadavg.tar.gz
[user@server] # tar -zxf loadavg.tar.gz

When you extract the tarball, a “loadavg” directory will be created.

2. Next you edit the file “config.php” and set the correct path for the variable “$datadir”. Your path will probably look something like this:

$datadir = ‘/home/USER/public_html/loadavg/logs/’;

Adjust the path as necessary. Make sure there is a trailing slash. Other settings in config.php may be changed according to personal preference.

Also set the correct value for “$eth”, your ethernet interface. The default value is “venet0″ for a VPS. Change it to “eth0″ for a dedicated machine (or whichever interface you use):

$eth = ‘venet0′;

3. Next you set the cronjob. The script “logger.php” must be set to run exactly every 6 minutes. Do NOT attempt to change the timing, it simply will not work correctly.

Use “crontab -e” to edit the crontab and insert a line something like this:

*/6 * * * * /PATH/TO/php -q /PATH/TO/logger.php >/dev/null 2>&1

Edit the paths to php and logger.php as necessary.

4. Wait. The logger.php must run 3 times before there is enough data to start producing charts. In 20 minutes or so, check the index.php page in your web browser.

FTP install:

  1. Download the archive to your workstation and extract it to a temporary location.
  2. Edit the config.php file as above in #2.
  3. Upload all files to public webspace, ensuring that you preserve the directory structure.
  4. Set the cronjob in your control panel. See the example in #3 above.

Optional Settings

There are a number of settings in config.php which may be tailored to your personal preference. See the comments in that file.

In particular you may want to adjust the $txchart and $rxchart values. These determine the y-axis (vertical) scale of the transmit & receive charts. For example, if you regular do 30 KB/sec transmit, set $txchart to a value slightly higher, perhaps 50 KB/sec.

Note on First Day Results:

The loadavg graphs will not display quite right during your first day. Once the second day is started the graphs will be correct. This is a design issue that may (or may not) eventually be fixed :)

Upgrading from Previous Version
Current users of loadavg may upgrade like this:

  1. Fetch and extract the tarball to a temporary location on the server.
  2. Edit config.php to set your current full path to the loadavg logs directory.
  3. Copy *.php and display.css to your current loadavg installation directory, overwriting existing files.

Your existing log files will be preserved and used.

Popularity: 100% [?]

Add A Comment

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.