Administering WombatDialer

Installing

WombatDialer is easily installed using yum or it can be installed manually. It can be installed on the same server as Asterisk is (for small systems or testing) but on larger production systems we recommend that it should be installed on a dedicated system (even a virtual machine will do).

WombatDialer can share a Tomcat instance with QueueMetrics for smaller systems (up to 50 agents/50 lines) but it should be really installed on a separate machine for larger systems, as it might use large quantities or RAM and CPU.

WombatDialer can also be easily deployed using Docker, as explained in Docker installation. This is perfect for installing a test system; but we have a number of sites running real-life workloads on it.

WombatDialer offers a HTTP control API that is very simple, as to be used by the Asterisk dial plan, IoT and scripts; it is not meant to be exposed to unauthenticated access.

The best approach is to either protect access to the whole WombatDialer system via the firewall, or to put a proxy in front and filter all requests to /api/…​ URLs for whitelisted IPs.

It is also possible to add optional auth tokens to all API calls, as explained in Optional authentication. This can be combined with a firewall and a proxy for a thorough approach to system security.

Installing using yum

On a CentOS or derived Linux distribution, just run the following commands:

wget https://yum.loway.ch/loway.repo -O /etc/yum.repos.d/loway.repo

yum install wombat

This will in turn:

  • install Java 8

  • install Tomcat 8.5

  • install MariaDB or MySQL server (if missing)

  • install the dialer

At the moment we support CentOS 7, CentOS Stream 8, CentOS Stream 9, Rocky Linux 8 and Rocky Linux 9. If you run CentOS 5 or 6, it is time to upgrade - if you really cannot, please see https://www.queuemetrics.com/faq.jsp?uid=faq-110-java8-centos5

Manual installation

You can install WombatDialer within any working servlet container version 2.5 or newer - we suggest Tomcat 8.5. You will also need a working MariaDB or MySQL server. OpenJDK 8 or 11 are fine.

  • Download the latest version of WombatDialer as a .tar.gz package from the website

  • Unpack the file in your servlet containers' webapps directory and rename the folder to "wombat"

  • Restart your servlet container

Example: manual installation on Debian / Ubuntu

The following example was tested on an Ubuntu 22.04 system (LTS until 2027). All Debian-inspired systems should anyway be very similar.

First make sure you are running your shell as as root.

The main dependencies are OpenJDK and MariaDB. WombatDialer works with MySQL as well.

apt update
apt-get install tomcat9 mariadb-server

Then let’s download WombatDialer as a TGZ archive:

cd /var/lib/tomcat9/webapps/
wget ..../WombatDialer-23.12.1-215.tar.gz
tar zxvf WombatDialer-23.12.1-215.tar.gz
mv wombatdialer-23.12.1/ wombat/

Now we install the initial database schema - we will create a database called "wombat" on the local DB, create a user to connect to it, and upload initial schema.

cd /var/lib/tomcat9/webapps/wombat/WEB-INF/DB
mysql < wombat_create.sql
mysql -uwombat -pdials wombat < wombat_schema.sql

Now we restart Tomcat so changes will be picked up:

service tomcat9 restart

Now connect to http://127.0.0.1:8080/wombat and follow the on-line wizard to create/update the database.

The default installers for both Tomcat 8/9 and MariaDB start their services automatically on boot.

On earlier versions (es 18.04 LTS, supported up to April 2023, EOL in 2028), you would use the package tomcat8 instead of tomcat9, and its webapps are stored in /var/lib/tomcat8 and not in /var/lib/tomcat9. For the rest, it just works.

On installation complete…​.

When installation is done, connect to http://myserver.address:8080/wombat - you will be asked for the MySQL root password to create a local database When done, login using as user demoadmin password demo.

WombatDialer ships with a free demo key that lets you use up to two lines - no limit on the number of calls you make. You may want to get a free demo key so you can run a full evaluation of the software in a real-life scenario.

License keys can be installed from the License page as soon as you log in.

Using an outbound proxy

WombatDialer requires outbound HTTPS internet connectivity to our licensing servers and cannot run without. It can use a direct connection or can go through a standard Java SOCKS proxy.

If a direct connection is not possible, then you have to set up a SOCKS 5 proxy (that we imagine being on address 1.2.3.4 at port 8888). You can then tell WombatDialer to use it by adding the following items to the JAVA_OPTS start-up parameters:

-Dhttps.proxyHost=1.2.3.4 -Dhttps.proxyPort=8888

For more information on proxies supported by the JVM and how to configure them, refer to https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html

Checking connectivity

To check whether connectivity is working correctly, and to test the different Java parameters that you can set in JAVA_OPTS, you can use a script called checkLicenseConnectivity.sh that can be found under WEB-INF/DB/.

For example, to check connectivity with no proxy, you would simply run:

# ./checkLicenseConnectivity.sh
============================================================
  Attempting connection to the Loway licensing servers
============================================================

No proxy configuration settings
============================================================
   All went well.
============================================================

While to attempt using a SOCKS proxy, you could for example try:

# ./checkLicenseConnectivity.sh -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=63080
============================================================
  Attempting connection to the Loway licensing servers
============================================================

Proxy configuration:

 |Property      |Value    |
-+--------------+---------|
0|socksProxyHost|127.0.0.1|
1|socksProxyPort|63080    |


Feb 04, 2022 9:21:44 AM it.loway.tpf.web.LowayHttpClient connect
SEVERE: Error accessing license server
java.net.SocketException: Connection refused (Connection refused)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:435)

============================================================
  Connection failed:
Error accessing HTTP URL
============================================================

Configuring e-mail

If you plan to use e-mail notifications, you should edit the tpf.properties file to tell WD about your SMTP servers and the e-mail address it is supposed to use.

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_AUTH=yes
SMTP_USER=your-gmail-account@gmail.com
SMTP_PASSWORD=wombat
SMTP_USE_SSL=no
SMTP_FROM="WombatDialer" <your-gmail-account@gmail.com>
SMTP_DEBUG=yes

As e-mail sending happens on the notification thread, a very slow SMTP server might delay HTTP notifications. In this case, we suggest setting up a local SMTP relay that will immediately accept e-mail and will forward it to the "true" SMTP host.

We suggest leaving SMTP_DEBUG on during the initial setup as it writes a verbose log of all SMTP activity on the logs and lets you spot errors and issues quickly.

Installing on Docker

Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system-level virtualization on Linux.

When you have Docker installed, starting a temporary instance of WombatDialer is as simple as typing:

docker run -p 8080:8080 -d loway/wombatdialer

This will download the current WombatDialer (already pre-configured for you) and will run it by exposing it on the local port 8080.

The problem with this approach is that when the image is terminated, all data is lost.

A better approach would be to create a data-only container to store the data. At this point, every time you start WombatDialer, it looks for its own data into the data-only container.

You start by creating a named data-only container:

docker run --name=MYWBT loway/data true

At this point, you can run WombatDialer using that container, as in:

docker run --volumes-from MYWBT -p 8080:8080  -d loway/wombatdialer

WombatDialer will recognize whether the data container is blank and will initialize it properly. The container also monitors the health of the running WombatDialer process and will restart it as needed.

If you prefer, you may use a local folder instead of a data-only container, as in:

docker run -v /root/WBT1DATA:/data -p 9090:8080 -d loway/wombatdialer

This command mounts the local folder /root/WBT1DATA for WombatDialer to store its data in, and - for a change - will expose WombatDialer on port 9090.

You can also control the local time-zone and the amount of memory used, by passing them as parameters when starting up the image:

docker run -e CFG='{"memory":400,"timezone":"GMT"}' -p 8080:8080 -d loway/wombatdialer

When you need to upgrade WombatDialer - you simply stop the current image and start a new one using the same data container. Your dialer is updated!

It is also possible to have a deeper control the JVM execution environment by overriding the default JVM variables; for example:

docker run --name WOMBAT
           -e CATALINA_OPTS="-Xms256M -Xmx512M -Duser.timezone=GMT+01:00"
           -e TZ=Europe/Lisbon
           -p 8088:8080
           -P -d loway/wombatdialer

What this means is that:

  • the CATALINA_OPTS setting will affect the Java machine memory and timezone, so you can fine-tune the JVM as you best see fit

  • the TZ setting will affect the container’s own timezone

Upgrading

Upgrading WombatDialer is meant to be very easy - it is in any case worthwhile to make a complete backup (see below) before attempting an upgrade. If you run WombatDialer on a virtual machine, the easiest way might be taking a snapshot of the whole box before attempting the upgrade.

Before attempting an upgrade, always make sure that no calls are in progress and that the dialer is turned OFF. If you have running campaigns, you should pause them and wait for relevant calls to terminate.

If you update from a version of WombatDialer before 18 to version 18+, the database driver was changed. Look for your tpf.properties file and replace the entry:

JDBC_DRIVER=com.mysql.jdbc.Driver
JDBC_URL=jdbc:mysql://127.0.0.1/wombat?user=wombat&password=dials&useUnicode=true&characterEncoding=UTF-8

With:

JDBC_DRIVER=org.mariadb.jdbc.Driver
JDBC_URL=jdbc:mariadb://127.0.0.1/wombat?user=wombat&password=dials&autoReconnect=true

And restart.

Upgrading via yum

If you originally installed via yum, this should be enough:

yum update wombat

System settings should be automatically transferred.

When the update is complete, on the first connection you might be asked to upgrade the database - the dialer will not start until the database is up to date. Database upgrades will be applied automatically.

If after an upgrade you get an error like java.util.MissingResourceException: Can’t find bundle for base name org.eclipse.jdt.internal.compiler.problem.messages, this means that there are cached classes created with a different version of the JDK.

You can have them flushed by issuing the commands:

service qm-tomcat6 cleancache
service qm-tomcat6 start

Manual upgrade

  • Stop the servlet container

  • Download the latest version of WombatDialer as a .tar.gz package from the website

  • Move the current "wombat" webapp to a storage place (do not delete it!)

  • Unpack the file in your servlet containers' webapps directory and rename the folder to "wombat"

  • Copy the tpf.properties file from the old wombat webapp to wombat/WEB-INF

  • Restart your servlet container

When the update is complete, on the first connection you might be asked to upgrade the database - the dialer will not start until the database is up to date. Database upgrades will be applied automatically.

Starting and stopping

If you installed using yum, you should be able to run:

/etc/init.d/qm-tomcat6 stop
/etc/init.d/qm-tomcat6 start

to stop and start the Tomcat servlet container and thence WombatDialer.

If you installed manually, see the user manual for your servlet container.

Before stopping, always make sure that no calls are in progress and that the dialer is turned OFF. If you have running campaigns, you should pause them and wait for all relevant calls to terminate. If not, those calls will end up in status LOST.

Additional environment configuration

It is possible to add additional Java environment configuration options to specify system-wide behavior. Those are generally added to the JAVA_OPTS environment variable - eg to specify an HTTP proxy, to force a specific time-zone, to enable JMX monitoring, a garbage collection policy or a number of other features.

WombatDialer has also a few parameters of its own:

  • wd.auth.tokens: sets a securty token to protect API calls from unauthorized access, see Optional authentication. By default it is unset.

  • wd.core.pause: after each iteration, Wombat may need a small pause to let the database commit. On some systems, a value too low may cause errors with the message "Batch update returned unexpected row count". Default is 200ms; you may want to tweak it higher or lower.

On a default RPM installation of WombatDialer, you can set these properties by editing the file /etc/sysconfig/qm-tomcat6, by adding them to the end of the JAVA_MEM property so that instead of being e.g. JAVA_MEM="-Xms256M -Xmx768M" it becomes JAVA_MEM="-Xms256M -Xmx768M -Dwd.auth.tokens=3db6e6b81bfe8a,e51979ce575e949dc".

The dialer status at startup

The dialer will usually start automatically when the webapp is loaded. Exceptions to this behavior happen if:

  • WombatDialer was updated and the database required updating. In this case the dialer will be turned off until manually activated.

  • There is no valid license installed.

If you prefer to avoid the dialer starting automatically, you can do this by creating a flag file called ''donotstart'' to be placed under WEB-INF, like e.g.

touch ./WEB-INF/donotstart

In order to revert to the previous behavior, simply remove the flag file.

Backing up

All the information WombatDialer requires to run is contained within the wombat MySQL database. Backing it up should suffice in most cases.

If you use a different database that the default MySQL on localhost, then you need to back-up the file wombat/WEB-INF/tpf.properties that contains the database connection information.

For ease of recovery, you may also want to back up the whole "wombat" webapp.

Logs and logging

User-serviceable logs are available on the syslog viewer page. This tracks errors, agent logins, campaign activity and many common user-facing conditions.

A log of severe errors is also held in the Tomcat logs directory, usually with file names of the format wombat.2013-01-05.txt or similar.

This behavior can be customized by editing the file WEB-INF/classes/logging.properties in the WombatDialer webapp.

org.apache.juli.FileHandler.level = SEVERE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = wombat.

java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

You can turn off logging by setting the logging level to NONE, or create extra-detailed and huge logs by setting the log level to FINE.

An extensive tutorial on Tomcat logging can be found at http://wiki.apache.org/tomcat/Logging_Tutorial

Please note that running very detailed logs on a production system may create huge files and may render the system unusable by generating too many I/O requests.

Monitoring a running instance

WombatDialer exposes a large set of metrics through the JMX interface of Java; such metrics can be inspected, downloaded and monitored by remote processes, or sent to a database for further analysis.

A detailed reference description of each counter is available in JMX statistics API, as well as a webservice to download all these data at once as a JSON object.

Connecting via VisualVM

One of the nicest things of the Java environment, the one that sits behind QueueMetrics and WombatDialer, is that it offers a very accurate and detailed view of what is actually going on. You do not need to use a special build of the software that is meant to gather statistics, and you do not have to pay a high performance price for understanding what the system is doing, so that it is perfectly acceptable to gather live statistics on a production environment. Even better, JVMs are built for being monitored, so that there is a standardized ecosystem of tools to help you understand what is actually going on. This approach is called JMX.

VisualVM is a free graphic tool that can be used to connect to a running Java VM in order to understand what it is doing. Apart for checking memory, CPU usage and garbage collections, it can be used to gather accurate information on what WD is doing internally, as WD exposes its own telemetry through JMX.

To monitor WD running on a server from a workstation, the easiest thing is to set up a SSH tunnel. You will need a recent Tomcat RPM (8.5.64 or newer).

So, once it is installed, you edit /etc/sysconfig/qm-tomcat6, and where it says:

# Remove the comments below to activate JMX monitoring
# JAVA_RMI_ADDRESS=localhost
JAVA_JMX_PORT="30000"

You uncomment the line with JAVA_RMI_ADDRESS; save the file and restart. You just need to do this once, and this can be done safely even on production systems. You can change the JMX port if you need to - does not matter which port you choose, as long as it is the same on your PC and on the server.

Now, you go to your workstation and start a new SSH session with the following incantation, to create a local tunnel for port 30000 and the following one too:

ssh root@my.wombat.server \
    -L 30000:localhost:30000 \
    -L 30001:localhost:30001

You can now run VisualVM on your workstation - most likely it will already be installed if you have a Java SDK; if not, you can download it from: https://visualvm.github.io

Note that while the example above logs in over SSH as 'root', any user will do.

When you launch VisualVM, you should now click on the button 'Add JMX connection', and create a new connection to localhost:30000, with no password and no encryption (as we already use the SSH tunnel to guarantee security and encryption).

Peeking around: CPU and memory

Apart from the welcome page, the first things you should check are memory and CPU.

VisualVM memory

For example, in the graphs above, we can see that:

  • CPU usage is around 30%, and is stable (graph on the top left). Very little garbage collections (the blue lines) - they are usually the main culprits for Java performance problems.

  • We have no memory pressure. The system hovers around 2G of usage (graph on the top right) and has more memory than it actually needs.

  • The system was kind of idle in the last few minutes - it did not allocate much memory (look at the memory graph), but it is computing something, as the CPU is still running.

  • We can know what it is doing by getting a thread dump.

WombatDialer is not especially memory-hungry, but might create a lot of intermediate objects that may cause memory pressure; of course, if you do not have enough memory, you will have a lot of garbage collections that will freeze the system and will severely impact performance.

A number of interesting things can be done with VisualVM:

  • 'Know your JVM': you can see the JVM settings from 'Overview' / 'JVM arguments'.

  • 'Memory monitoring': you can see the current CPU, memory and thread usage from the 'Monitor' page. Note that with most settings, it is normal that all memory be used up before a garbage collection is performed; so you would expect to see spikes and falls in the graph. You can also force a garbage collection if you want to see the "true" memory usage, but this may be unwise on heavily loaded production servers.

  • 'Thread monitoring': you can get a textual thread dump like the one discussed above by selecting 'Threads' / 'Thread dump'

  • You can use the 'Sampler' to acquire a breakdown of memory and CPU usage per class (you first need to install the plugin 'VisualVM-Sampler' from the Plugins menu, if not already available)

  • You can keep a server open with multiple instances of VisualVM in order to monitor multiple servers at once and compare what is happening on each of them.

Understanding WombatDialer’s telemetry

To access telemetry, you click on MBeans, and open the items under "Metrics", as displayed below. Each metric has a name and offers one or more attributes. When you find an interesting attribute, you just click on any number to turn it into a graph that follows the value across time, as shown below.

VisualVM

Most things that WD exposes in its telemetry are loops; so they usually offer:

  • a Count, that shows how many times the loop was traversed. Often, a loop runs when there is an incoming message to be processed

  • a value, that is usually shown in terms of Min, Mean and Max, and also in terms of percentiles (median, 95%, 99%).

  • a Rate, that is how many times per second the loop was triggered, in the last 1, 5 and 15 minutes

When inspecting a system, you should start from the core metrics, that is the brain, and from metrics of connected Asterisk servers. The brain should be running smoothly, and at least 4/5 times per second, and the command queue on each Asterisk server should be empty or nearly-empty.

Core Metrics

On each iteration, WD receives a set of messages from the GUI, your API and from any connected PBX servers. It uses those messages to update its state, then decides what to do, and every once in a while runs clean-up tasks. At the end of each loop, the database is synchronized (with a commit and/or an eviction and/or a refresh).

  • wombat.all.msg-in is the time spent processing the incoming mailbox. On an healthy system, each loop should take just a few milliseconds. When processing API requests, it might spike up. If a loop is taking more than 1 second, messages are processed in a further iteration; this should never happen, or very rarely. Look at the high percentiles to see if this happens to you.

  • wombat.all.brain tracks how long each brain iteration takes. They should be taking a few milliseconds each. Detail on what is happening within is shown below.

  • wombat.all.runafter is the task queue. Most times it should complete in zero time, i.e., the queue is empty.

Brain time is further divided into:

  • wombat.brain.brain is the actual decision time

  • wombat.brain.runs is the time spent updating the campaign (e.g. refilling new calls)

  • wombat.brain.calls is the time spent scheduling calls (included the second check against blacklists)

  • wombat.brain.reschedule is the time to close terminated calls, and apply reschedule/disposition rules

After that, timed commits happen and logs are shipped for writing to a separate helper process.

When starting new campaign runs, or just running normally, numbers to be dialed have to be loaded from the database:

  • wombat.refill.new is the time spent fetching new numbers to dial

  • wombat.refill.retry is the time spent fetching retries

  • wombat.refill.blacklist is the time spent checking calls against blacklists. Calls are checked against black-lists twice: when loaded and just before being attempted.

Database metrics

  • wombat.hibernate.openconnection is the time and number of connections open by the brain. As connections are persistent, it should happen just once, or a few times - otherwise it means the dialer keeps restarting or the database disconnects. This is a major signal of distress.

  • wombat.hibernate.save, wombat.hibernate.flush and wombat.hibernate.commit happen when Wombat tries to write to the database. Theey might take a while - check high percentiles of duration.

  • wombat.hibernate.evict is called to remove old objects

  • wombat.hibernate.refresh does a deep reload of objects

Look out for very high numbers, and then check what is happening on your database. Does it have enough CPU and IOPS to run smoothly? Is it very busy, or is it sitting idle?

Asterisk metrics

Each Asterisk head has separate statistics and is displayed with its own name.

  • WD/AMI-xxx.commandQueueSize is the number of messages that are ready to be sent to the PBX, but cannot be delivered because the messages-per-second limit is hit, or because the PBX is processing them too slowly. Ideally should always be zero - a long queue prevents WD from working correctly. If this is consistently high, you need to increase the AMI message limit - but beware that a PBX flooded with messages is prone to sudden crashes, so run your experiments before changing it in production.

  • WD/AMI-xxx.isConnected is 1 when the server is connected and 0 otherwise.

  • WD/AMI-xxx.fromAsterisk is the time taken processing messages from Asterisk.

  • WD/AMI-xxx.fromMaster is the time spent converting actions from WD to Asterisk.

  • WD/AMI-xxx.sendSocket is the time spent sending messages on the socket.

Other metrics

The Helper offloads some tasks from the main dialer:

  • wd-hlp.autorun is the time spent running tasks (HTTP, SMTP, database updates)

  • wd-hlp.email is the time spent sending email

  • wd-hlp.http is the time spent in HTTP notifications

Logger:

  • wd-log.cycles is the time spent writing call logs. Logs are written in batches, where possible.

  • wd-log.n_logs is the number of log entries written

Troubleshooting a running instance

Problems with a WD instance are usually either on the Java side or on the database side. We present a few useful techniques to gather important data to be sent over for inspection.

Creating a thread dump

In order to diagnose problems with WombatDialer, it may be needed to take thread dumps by running:

/etc/init.d/qm-tomcat6 threaddump > dump_2013-01-18.txt

These dumps prints what the threads are doing at a point in time. It may be worthwhile to take multiple ones, a few minutes apart from each other.

Creating a TCP dump

In order to diagnose problems with WombatDialer, it may be needed to take TCP dumps:

First off you can check your network interfaces by typing:

tcpdump -D

the result will be something like

1.eth0
2.any (Pseudo-device that captures on all interfaces)
3.lo

Issue the dump on port 5038 (remember to add the -s option to avoid capturing only packet’s headers)

tcpdump -i lo -s 65535 -w dump.pcap port 5038

This will generate a file called dump.pcap which can be analyzed using Wireshark.

Creating a heap dump

On request, you may need to create a heap dump. This is a large file containing the full contents of the live JVM.

[root@wombat1 ~]# /usr/local/queuemetrics/java/bin/jps
1900 Jps
30808 Bootstrap

The line containing Bootstrap contains the PID of the Java VM running Tomcat.

[root@wombat1 ~]# /usr/local/queuemetrics/java/bin/jmap -F -dump:live,format=b,file=heap.bin 30808
Attaching to process ID 30808, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 17.1-b03
Dumping heap to heap.bin ...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Finding object size using Printezis bits and skipping over...
Heap dump file created

The resulting file (called heap.bin as specified on the command line) might be very large and it might take a while to create on busy systems with large Java heaps.

Before sending the file over it is better to compress it:

[root@wombat1 ~]# ls -l heap.bin
-rw-r--r-- 1 root root 40779016 Jan 10 08:45 heap.bin
[root@wombat1 ~]# bzip2 heap.bin
[root@wombat1 ~]# ls -l heap.bin.bz2
-rw-r--r-- 1 root root 8055474 Jan 10 08:45 heap.bin.bz2

Logging all MySQL queries

Edit the my.cnf file (usually in /etc/mysql/my.cnf). Look for the section called "Logging and Replication".

#
# * Logging and Replication
#
# Both location gets rotated by the cron-job.
# Be aware that this log type is a performance killer.

log = /var/log/mysql-all-queries.log

Just uncomment the "log" entry to turn on logging. Restart MySQL with this command:

service mysql restart

Logging of "slow queries" in MySQL

Edit file my.cnf and add the following parameters:

[mysqld]
log-slow-queries=/var/log/mysql-slow-queries.log
long_query_time = 2
log-queries-not-using-indexes

This will log all queries taking more than two seconds or running without a defined index to the slow queries log.

Then restart MySQL.

Database Clean-up Script

In order to manage WombatDialer’s database size, a clean-up script is included in WombatDialer’s installation package. The script file can be found in the application folder at the following path:

WEB-INF/DB/cleanup_wbt.sh

Before you run this script make sure you give it the appropriate permissions it needs to be executed.

This script, when executed, searches for old data that is no longer useful or has been hidden by the user. To decide how old must this data be in order for it to be deleted, the user must input a date that will be considered its clean-up threshold.

There are two areas where data can be deleted:

  • Campaign runs that are hidden, or happened before the given threshold date. This means that the script will search for all runs of campaigns that are currently hidden that happened before the input date. The runs will be removed; if the campaign has no other runs, then it will be removed as well. If a campaign is deleted, all logs associated with the campaign will be deleted as well. All System logs records before the given date are erased as well.

  • Unused lists. If a list is hidden, and is used by no campaign or runs, then the list and all numbers and attributes are removed. If you run this after cleaning old campaigns, lists used by those campaigns will be removed.

When all the data has been erased, the script will initiate a procedure to rebuild all tables and indexes, thus optimizing and improving database access times.

Please note that in order to successfully run this script, WombatDialer must be turned off before running it. On a multi-gigabyte database, plan a few hours of possible downtime.
Running this script will cause some data to be deleted permanently. It is possible for the script to leave the database in an inconsistent state. It is mandatory that you make a backup copy of your database before running this script.

Running the clean-up script

After navigating to the correct folder and setting the appropriate permissions to the script file, you can execute it by typing:

./cleanup_wbt.sh -u wombat -p dials -d wombat -t 2017-12-31 -m all

As you can see, we need to input five parameters to execute the script. These parameters are all mandatory except for one:

  • -u: MySQL user parameter (Mandatory)

  • -p: MySQL password parameter (Mandatory)

  • -d: MySQL WombatDialer database name (Mandatory)

  • -t: Date threshold to identify old data (yyyy-mm-dd). Data more recent than this date will not be considered for elimination. (Mandatory)

  • -m: Mode selection. Available modes are: list, delete, optimize, preview, all. The default mode is all.

There are five different modes for the script:

  • list: Does not delete any data, only shows hopper elements that would be removed in a normal execution.

  • preview: Does not delete any data, only shows hopper elements and call lists that would be removed in a normal execution.

  • delete: Deletes all old data, without table optimization.

  • optimize: Optimizes all the tables.

  • all: Default mode. Executes all the passages in order.

We suggest manually running the script as preview first; then delete and then optimize.