Skip to content
Stas Trefilov edited this page Oct 5, 2016 · 11 revisions

Monitask installation

Shortcut version

Install from GitHub, create datastore file and put an HTML template into the web folder:

$ git clone https://github.com/dotgit/monitask.git
$ chmod +x monitask/run-monitask.php
$ sudo mkdir /var/lib/monitask
$ sudo mkdir /var/www/monitask
$ sudo monitask/run-monitask.php --datastore
$ sudo sh -c 'monitask/run-monitask.php --template > /var/www/monitask/index.html'

Requirements

Monitask is written in PHP and may be run on any *NIX - like OS. Al the code below is provided for FreeBSD.

If you do not have PHP with json and mbstring extensions installed, run the following code (PHP 5.6 is currently the latest version):

$ sudo pkg install php56 php56-json php56-mbstring

If PHP is already installed, check for the json and mbstring modules:

$ php -m

If the modules do not appear as installed extensions, install them (php56-* part below corresponds to php version currently installed on your server):

$ sudo pkg install php56-json php56-mbstring

Installation

To install Monitask you need to select a program folder, a datafile location and a folder for exporting metrics.

Program folder

We'll create program folder in our home directory by cloning the monitask repository from GitHub:

$ git clone https://github.com/dotgit/monitask.git

This command creates monitask directory, where the program and default config files are stored. When Monitask is called without specifying the location of its config file, it starts with the ini/monitask.ini file inside the program folder.

Datafile location

Monitask is a flexible plugin-based architecture. Default datastore is of type CSV and stores data in a single .csv file. Check the ini/monitask.ini file section [datastore] and filename directive to find out the location of datastore file. See Config files for detailed discussion about config files parsing rules.

Default datastore file is /var/lib/monitask/monitask.csv. To create the file run the following command:

$ sudo monitask/run-monitask.php --datastore

This command creates a new datastore file (or exits with an error if the file already exists).

Export folder

Check the [export] section of config file and export_dir directive. It contains the folder where the exported JSON files will be generated when Monitask is invoked with --export argument.

Default export folder is /home/www/monitask. You may change the directive to point to existing folder or create a new export folder:

$ sudo mkdir /var/www/monitask

If creating a new folder, be sure to modify your web server configuration accordingly.

The template HTML file will contain the list and placeholders for all graphs. This file will be served from your web folder. To generate it, run the following command:

$ monitask/run-monitask.php --template > /var/www/monitask/index.html

or, if the web folder is configured with specific permissions:

$ sudo sh -c 'monitask/run-monitask.php --template > /var/www/monitask/index.html'