2. Installation guide

In the course of this guide, we will use two servers; their IP’s as used in the examples below are:

Server IP Address Notes

PBX

1.2.3.4

QueueMetrics

1.2.3.5

MySQL is on this server

2.1. Performing a basic QueueMetrics installation

Go to the server you plan to use for QueueMetrics; it is easier if you install it using a version of Linux that user RPM as its package manager (e.g. Red Hat or CentOS).

A virtual machine is OK, but you have to make sure that the clock does not drift much or the real-time tools might be inaccurate (see below).

2.1.1. Install QueueMetrics

Forst add the QueueMetrics repositories from which all software will be downloaded:

wget -P /etc/yum.repos.d http://yum.loway.ch/loway.repo

Install QueueMetrics and its dependecies by typing:

yum install queuemetrics

Follow the on-screen instructions for database installation. It will create a local database called ’queuemetrics’ to which QM accesses using a MySQL user "queuemetrics" with password "javadude".

Now we will create a new user that can connect to the database right from the PBX box; so we type:

mysql mysql

(you may have to add a login and/or a password to connect to the admin database)

Run the following command:

grant all privileges on queuemetrics.* to ’fonloader’@’1.2.3.4’ identified by ’javadude’;

Change the IP ’1.2.3.4’ to the actual address of your PBX.

2.1.2. Check external reachability of the database

To check that MySQL is actually able to accept connections via TCP/IP, run the following command:

[root@abc ~]# lsof -i | grep -i mysql..listen
mysqld     2552   mysql   10u  IPv4     6067       TCP *:mysql (LISTEN)

If you see a line like the one above, this means your MySQL server is working and listening for incoming connections.

If you have configured a firewall for this server, open it on port 3306 to allow incoming connections or stop it altogether for the moment:

/etc/init.d/iptables stop

Now we are ready to install

2.1.3. Time-sync both boxes using NTP

It is of paramount importance that both the PBX and QueueMetrics share the same clock to a sub-second precision. Luckily this is trivial to do on most Unix systems, as your PBX already syncs to a NTP source.

First make sure that you have NTP installed:

yum install ntp

Then edit the Crontab file to run NTP periodically:

[root@qm ~]# export VISUAL=nano
[root@qm ~]# crontab -e

Now add the following line:

0-59/5 * * * * /usr/sbin/ntpdate tick.ucla.edu > /dev/null 2>&1

This will time-sync every 5 minutes ("/5") to the PBX.

If you are running on a VMWare instance and the clock is drifting quite too much:

  • Install the VMWare tools on your QueueMetrics server
  • Make it resync every minute ("/1")

2.2. Install Fonloader on the PBX

Fonloader is a piece of software that translates the PBX logs into a format that is understood by QM and uploads it directly to the QM database.

2.2.1. Access the PBX over SSH

If you have not done so, you need to enable access as an administrator to your PBX. To do this, go to the console screen (that is, the monitor that is attached to your box) and login as "ip" password "ip".

  • Select option "11 - Set root password"
  • Confirm
  • Enter your new password (twice) - remember to write it down!
  • Exit by pressing Q

Now try and login over SSH as ’root’ with the password you chose.

2.2.2. Check that the MySQL connection is working

If the connection does not appear to be working, you can test it by typing:

mysql -h 1.2.3.5 -u queuemetrics -p queuemetrics

(When asked for a password, type ’javadude’).

Where 1.2.3.5 is the IP of the QueueMetrics box.

If you get an error connection, check that the permissions allow for network access to the MySQL server that resides on the QM box.

2.2.3. Install Fonloader

Now login to the PBX as ’root’ and add the Loway software repositories:

wget -P /etc/yum.repos.d http://yum.loway.ch/loway.repo

Now install Fonloader - it’s all automated:

yum install fonloader2

after installation, you need to:

  • Create the tables it need in the QueueMetrics database
  • Configure Fonloader parameters

2.2.4. Create the database table

Fonloader needs a special database extension that is not present in the "stock" QueueMetrics database.

In order to create it, just enter the following commands:

[root@trixbox ~]# cd /usr/local/fonloader2/
[root@trixbox fonloader2]# mysql -u fonloader2 -p -h 1.2.3.5 queuemetrics < fonloader2_schema.sql
Enter password: ****

The password, as always, is ’javadude’.

Now Fonloader is ready to run.

2.2.5. Configure and start Fonloader

Configure Fonloader by editing the configuration file to match your system configuration.

nano /etc/sysconfig/fonloader2

Edit it as follows:

dbhost=1.2.3.5
dbinstance=queuemetrics
dbuser=fonloader2
dbpass=javadude
partition=PF

You have to change the following properties:

  • ’dbhost’ is the address of the QM server
  • ’dbinstance’ is the name of the QM database
  • ’dbuser’ is the MySQL user to connect under
  • ’dbpass’ is the MySQL password
  • ’partition’ is used on clustered systems. For now leave it as it is.

After that, restart Fonloader by typing:

[root@trixbox ~]# /etc/init.d/fonloader2 restart
Stopping /etc/init.d/fonloader2:                           [  OK  ]
Starting /etc/init.d/fonloader2:                           [  OK  ]

2.2.6. Check that Fonloader is running

To see whether Fonloader is running or not, do a:

[root@trixbox ~]# tail -f /var/log/asterisk/fonloader2.log

It will show you the log as it is being written to in real-time. To stop, press Ctrl+C.

If the logs looks like this:

 |Thu Dec 17 06:59:54 2009|FonLoader2 MySQL loader - $Revision: 1.4 $
 |Thu Dec 17 06:59:54 2009|MYSQL: H: 1.2.3.5 D: queuemetrics U: fonloader2 P: javadude
 |Thu Dec 17 06:59:54 2009|SYS  : Log: /var/log/asterisk/fonloader2.log - PID: /var/run/qloader.pid
 |Thu Dec 17 06:59:54 2009|DIRS : Spool: /var/log/asterisk/real/
 |Thu Dec 17 06:59:54 2009|PARM : Part.: PF - Run once? 0 - Move after 43200 minutes - Offs. 0
 |Thu Dec 17 06:59:54 2009|Now connecting to DB queuemetrics on 1.2.3.5 as user fonloader2 with password javadude
 |Thu Dec 17 06:59:54 2009|FILE: /var/log/asterisk/real/queue_log.queued.1261046341 MIN: 1261045844 MAX: 1261045844
 |Thu Dec 17 06:59:54 2009|FILE: /var/log/asterisk/real/queue_log.queued.1261046733 MIN: 1261046500 MAX: 1261046500
 |Thu Dec 17 06:59:54 2009|Initial loading took 0sec.

this means that the process is working fine.

[Note]Note for the first run

If you have a lot of old data, it may take a while to process it before the database gets to be up-to-date (even in the order of 10-20 minutes). This will happen only the fist time you run Fonloader; after that, Fonloader will pick up from where it was last interrupted.

When it is up-to date and running successfully, Fonloader produces a log that looks like:

 |Thu Dec 17 07:01:50 2009|MASTER: after 1261051309
 |Thu Dec 17 07:01:50 2009|QLOG: after 1261051309
 |Thu Dec 17 07:01:50 2009|SLEEP @1261051310

If you instead see something like:

 |Thu Dec 17 06:56:28 2009|Now connecting to DB qm_fon2 on 1.2.3.5 as user fonloader with password javadude
E|Thu Dec 17 06:56:28 2009|---ERROR FOUND--
E|Thu Dec 17 06:56:28 2009|Error type: dr
E|Thu Dec 17 06:56:28 2009| Statement:
E|Thu Dec 17 06:56:28 2009|     Error: Access denied for user ’fonloader’@’%’ to database ’qm_fon2’
E|Thu Dec 17 06:56:28 2009|Waiting 15s before reattempting to connect

it means the database connection is not working. You have to edit the configuration file and restart.

2.3. Configuring QueueMetrics

2.3.1. Editing the configuration file

The main configuration file for QueueMetrics is located under ’/usr/local/queuemetrics/webapps/queuemetrics-1.5.5/WEB-INF’ and it is called ’configuration.properties’ (Note that if the version of QueueMetrics is different, so the path will be different).

It can be edited using a text editor, as in:

cd /usr/local/queuemetrics/webapps/queuemetrics-1.5.5/WEB-INF
nano configuration.properties

The following properties must be changed:

# This is the default queue log file.
default.queue_log_file=sql:PF

# Rewrites Local/XXX@ext channels in the format Agent/XXX
default.rewriteLocalChannels=true

2.3.2. Logging on

Point your browser to http://1.2.3.5:8080/queuemetrics - you should see a welcome screen appear in a few seconds.

You can log in initially as ’demoadmin’ password ’demo’.

2.3.3. Checking that data is available

To make sure that data produced from your PBX is actually available, after logging on go to ’Edit QueueMetrics settings’ → ’Mysql storage information’.

You should see a number of rows available under partition PF.

By clicking on the Info button, you will be shown the actual queues and agents that have activity data in your database.

Print this page and use it as a guide to initially configure the system.

2.3.4. Creating queues

In order to create queues, go to the home page of QueueMetrics and select ’Edit QueueMetrics settings’ → ’Edit queues’.

Create a queue entry for each queue that was displayed in the Partition Info report; you can leave everything blank but the following fields:

  • ’Queue Alias’: The name you want to see the queue under in QM
  • ’Queue(s)’: The identifier that was shown in the Partition Info page

We also suggest creating a queue called ’00 All’ that allows you to see together all the queues defined on the system (this is very handy when running the realtime reports).

Create it like this:

  • ’Queue Alias’: Set it to "00 All". You could name it anything, but starting with a 0 it will always be shown as the first entry in the queue list.
  • ’Queue(s)’: All the identifiers that were shown in the Partition Info page, separated by the pipe character. E.g. if you have queues 7000, 7001 and 7002 you would enter "7000|7001|7002".

You can remove any queues that do not belong to your call centre.

2.3.5. Creating agents

In order to create agents, go to the home page of QueueMetrics and select ’Edit QueueMetrics settings’ → ’Edit agents’.

[Note]Note

We suggest creating agents at this point, but QM will work even if agents are not defined - it will just show them under their default agent code.

Create an agent entry for each agent that was displayed in the Partition Info report; you can leave everything blank but the following fields:

  • ’Asterisk agent code’: The identifier that was shown in the Partition Info page, usually in the form ’Agent/123’
  • ’Agent description’: The name you want to see the agent under in QM.

2.3.6. Running reports

If you want to see what happened to your queues during an historical period, from the home page of QueueMetrics select a queue entry and click on a predefined time period.

If you want to see what is going on in your call-center at the very moment, agains select a queue from the main page and click on "Real-time report".

If you want to run a report using a different time period and/or a differnet restrictions (e.g only calls coming from a given caller-id), go to the "Custom reports" page.

You can also use QM to give each agent a web interface to the last processed calls.

QueueMetrics offers a lot of statistics and features; it has a 100+ page User Manual that covers everything and explains every graph and feature. You can get it from http://queuemetrics.com

2.3.7. Getting a QueueMetrics temporary licence

We believe that the best way to get a hold of what QueueMetrics is and how useful it is for you is to try it with your own production system. That’s why we give a 30-day free evalutation key that you can use freely.

You can get it from: http://queuemetrics.com/sendDemoLicence.jsp and it includes installation instructions.