I had the chance to install and use Monast (http://monast.sourceforge.net/) by Diego Aguirre and found it extremely useful, simple, fast and FREE to monitor Asterisk 1.4 or higher (this guide uses Asterisk 11.x). Thought i’d share this how to for basic asterisk monitoring needs. Even though the project has not been updated for years, i still find it super useful and works on Asterisk 11 for me just fine.
Important notes:
- This guide is for users of Debian 32/64, other platforms can adapt, esp the “apt” parts :-)
- You should already have a running FreePBX (or at least Apache and related libraries) if you do not have FreePBX
- This guide would likely work for Ubuntu as well
Follow this guide to get it up and running in minutes
- Update your apt and get some packages
- #apt-get update
- #apt-get install python-twisted python-zope.interface php-pear
- #pear install HTTP_Client
- Get starpy package and install it
- #cd /usr/src
- #wget -O starpy-1.0.0a13.tar.gz http://downloads.sourceforge.net/project/starpy/starpy/1.0.0a13/starpy-1.0.0a13.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fstarpy%2Ffiles%2Fstarpy%2F1.0.0a13%2F&ts=1402506121&use_mirror=jaist
- #tar –zxvf starpy-1.0.0a13.tar.gz
- #cd starpy-1.0.0a13/
- #./setup.py install
- #cd ..
- Now download monast
- #wget –O monast-3.0b4.tar.gz http://downloads.sourceforge.net/project/monast/Monast%20for%20Asterisk%201.4%2C%201.6%20and%201.8/3.0b4/monast-3.0b4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmonast%2Ffiles%2FMonast%2520for%2520Asterisk%25201.4%252C%25201.6%2520and%25201.8%2F3.0b4%2F&ts=1403193094&use_mirror=jaist
- #tar -zxvf monast-3.0b4.tar.gz
- #cd monast-3.0b4/
- At this point below, simply use the defaults, change if you know what you’re doing….
- #./install.sh
- Now, lets create an AMI user using FreePBX’s
- Note, use the module Asterisk Manager Users and its a recommended way to add AMI users
- Create a new manager user called monastfpbx with a secret like this “mysecret123”, select ALL for read, and ALL for write
Example below
- Submit and apply
- If you do not have/use this module, create you own user like this in [freepbx users] /etc/asterisk/manager_custom.conf or rest of the world /etc/asterisk/manager.conf
[monastfpbx]
secret = mysecret123
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate - Then reload the manager module #asterisk –rx “manager reload”
- Now, edit the monast config file
- #nano /etc/monast.conf
- Look for the following and change per suggested here (basic setup, change others if you know what you’re doing)
auth_required = true
[server: Server_1] # Server name can not contains space
hostname = 127.0.0.1
hostport = 5038
username = monastfpbx
password = mysecret123
default_context = from-internal
transfer_context = from-internal-xfer
[user: admin]
secret = secret12345
roles = originate,queue,command,spy
servers = ALL - Save and exit
- Now, lets test start monast
#/opt/monast/monast.py
You should see this at minimum (ignore server_2 errors)
[Fri Jun 20 19:17:05 2014] NOTICE :: Initializing Monast AMI Interface...
[Fri Jun 20 19:17:05 2014] NOTICE :: Parsing config file /etc/monast.conf
[Fri Jun 20 19:17:05 2014] NOTICE :: Server Server_1 :: AMI Connected... - Now, ctrl-c to stop that and run this monast as a daemon instead (runs in background)
#/opt/monast/monast.py --daemon
You should see something like this:
Monast daemonized with pid 6738 - That’s about it, now log on to the webUI
- http(s)://<yourIP>/html/monast with username admin and password secret12345
- Remember, you can right click and do stuff to the tabs you see there such as originate calls…
- The init.d should be automatically added and should auto start in daemon mode, but do verify yourself
- Shout out to Diego Aguirre! awesome software mate :-)
- Thanks and as usual do give us feedback
Happy weekend folks!