aTinyMON is tiny Real-Time Monitoring tool for Asterisk (
www.asterisk.org).
Download :
here.
aTinyMON in a few words
- Features :
- Few prerequisites for installation.
- Almost no configuration.
- Automatic device discovery : self-training from Asterisk Manager events.
- Limitations :
- Basic information only : device offline/online, ringing, active.
- No user access control feature.
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 :
- An Asterisk server - this Asterisk server should have its Asterisk Manager Interface enabled and an account created for aTinyMON.
- A Linux machine with Apache HTTPD server, PHP (including php-mysql) and Perl (including IO::Socket and DBI) to install aTinyMON and atinyman.
- A MySQL database server (it may be on the same Linux machine, of course) with a table dedicated to atinyman/aTinyMON,
and a database user with read/write privileges on this table.
- A web browser !
Installation
Follow the 5 installation steps below :
- 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.
- (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.
- 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.
- 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.
- 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 :
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 :
- Freeze display with the "Pause" icon ; then, a clock icon displays beside aTinyMON logo.
- Restart real-time display with the "Play" icon ; then, a wheel icon displays beside aTinyMON logo.
- Close aTinyMON session. You will be forwarded to the REFRESH address defined in config.php.
- Show or hide some category of devices with the associated green check / red cross.
- In "Freeze" mode only, select the number of items per row in the right panel.
- Choose to display or hide offline devices.
- Choose to display or not display AMI events.
- Zoom on a device state with the associated link in the right panel. The state is a compilation of all events parameters.
It also includes information about currents calls related to the device.
- Close a zoom with the Close button and come back to defaut display, that shows last handled event.
LEDs colors reflect devices states :
- Offline
- Online
- Online ringing
- Online active
- Unknown
Technical details
A few details about atinyman/aTinyMON duet :
- When you start a new aTinyMON PHP session, aTinyMON checks the availability of atinyman
(atinyman has a super-feature and responds 'pong' when someone calls it with parameter 'ping').
- If atinyman is available, then aTinyMON forks a atinyman process in background with appropriate parameters (Asterisk settings,
database settings, polling instructions, instruction to run unique, and more).
- If atinyman is called with 'serious' parameters (I mean : not 'ping'), and is instructed to run unique, it checks the presence
of other atinyman processes ; if it finds any, it quits, considering that another atinyman is already doing the work.
Otherwise, it does what it has to do.
- You may notice that aTinyMON contains no control to stop atinyman.
In other words, if you start a aTinyMON session, it will start atinyman, and atinyman will go on running background even when
you terminate your aTinyMON session.
However, if you want/need to stop atinyman : 'killall atinyman.pl' should do the trick.
Credits
aTinyMON icons partly come from Nuvola icons library (
Icon-King).
Contact
For all remarks, suggestions, you can send an email to vracbazar