vracbazar.free.fr v2

VracBazar

aTinyMON Real-Time Monitoring tool for Asterisk

aTinyMON is tiny Real-Time Monitoring tool for Asterisk (www.asterisk.org).
Download : here.

aTinyMON in a few words

- Features :
- Limitations :

Architecture

aTinyMON works in the architecture shown below. Blocks represent software entities and may be located on the same server (performance considerations won't be discussed here, but Asterisk had rather have its own server for optimal calls handling, however).

In brief :
aTinyMON is a PHP application. It uses PHP sessions to store information between each HTML page refresh.
aTinyMON forks atinyman.pl Perl utility that connects to Asterisk Manager and feeds a MySQL database table with 'tickets' that represent Manager events.
So, atinyman.pl provides the 'tickets', aTinyMON reads them and elaborates the real-time monitoring board.
The 'tickets' table constitutes the 'buffer' between continuous Manager events flow and aTinyMON periodical execution.

Prerequisites

The prerequisites for aTinyMON :

Installation

Follow the 5 installation steps below :
  1. Uncompress aTinyMON archive somewhere in your Apache HTTPD root directory : let's say at the root, /var/www/html/ typically. Rename the directory atinymon-x.xx as atinymon.
  2. (optional) Check that HTTPD server is PHP-ready : open http://<your server>/atinymon/phpinfo.php with a browser (see note 1 below). This page contains one single PHP instruction <?php phpinfo(); ?> that should display information about your PHP settings.
  3. Enable Asterisk Manager Interface and create an account for atinyman :
    Edit manager.conf, usually located in /etc/asterisk.
    • In section [general], set enabled=yes
    • Create a section [<your account>] (e.g. [atinymon]), and set the following parameters : secret=<your password>, read=all and write=system,call (write is required for atinyman polling operations).
    • Reload the configuration in Asterisk.
  4. Create a table for atinyman/aTinyMON tickets in your MySQL database, create a user with SELECT/INSERT/DELETE permission on this table (of course, it will also work with MySQL 'root' user, but I recommend creating a dedicated user). The user for atinyman/aTinyMON needs no permission except read/write on the tickets table. You can create a dedicated database or use the 'test' database.
    • CREATE TABLE `tickets` (
      `id` int(11) NOT NULL auto_increment,
      `datetime` datetime NOT NULL default '0000-00-00 00:00:00',
      `ticket` text NOT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    • Alternatively, give also a CREATE permission to atinyman/aTinyMON user on selected Database, and aTinyMON will be able to create the table for you.
  5. Enter settings in config.php file :
    • Asterisk settings : host, port, AMI username, AMI password.
    • MySQL settings : host, port, MySQL username, MySQL password, database, table.
    • Declare atinyman.pl location (define MON_APP). Either you keep it inside atinymon directory, or you move it to another directory that is accessible to Apache HTTPD.
    • That's enough. You will adjust other settings later if you want.
Note 1 : we suppose here that you uncompressed aTinyMON archive in Apache HTTPD root directory. Otherwise, adapt and use the adequate URL : http://<your server>/some/complex/path/atinymon/phpinfo.php if you uncompressed in <HTTPD root>/some/complex/path).

You are ready now to jump to the "Operation" section !

Operation

Open now http://<your server>/atinymon/ with a browser. The index.html file should redirect you to atinymon.php
That is not usual, but let's begin with troubleshooting : if aTinyMON encounters any problem, it will notify you with an error box. For instance if it can't start atinyman.pl, it will display something like this :

error box

It will also notify you if aTinyMON has any problem with database connection.
If you want to check atinyman activity, you can do a 'ps -e | grep atinyman' and you should find 3 processes. You should also find atinyman logs in /tmp directory, and an atinyman-xxxx-loop.tmp file that contains periodical polling instructions for atinyman.
If nothing displays, set DEBUG value to 1 in config.php and retry.

And if (hopefully !) aTinyMON has no problem, it will display current activity around your Asterisk server.

The available controls are :

LEDs colors reflect devices states :

Technical details

A few details about atinyman/aTinyMON duet :

Credits

aTinyMON icons partly come from Nuvola icons library (Icon-King).


Contact

For all remarks, suggestions, you can send an email to vracbazar at free.fr