The script is able to update the queues data activity already stored in the QueueMetrics database with a new data coming from a different queue_log. It’s useful for maintaining corrupted (or restoring) databases.
This script works in pair with the qloader.pl script with revision number equal or greater than 1.12.
In order to use it, the script has to be customized with information related to the database. The relevant configuration keys are:
my $mysql_host = "127.0.0.1"; my $mysql_db = "queuemetrics"; my $mysql_user = "queuemetrics"; my $mysql_pass = "javadude"; my $qloaderbin = "./qloader.pl"; my $logfile = "queuepartialupdater.log";
More in detail:
You can pass the following parameters to avoid changing the file itself:
The script can be called via the command line by specifying:
The script will be responsible for removing all data overlapping with the period specified in the input queue data file for the defined partition. It will then be responsible for calling the qloader script. That script will be able to fill the database with the new information provided by the same queue data log. At the end of the processing, the log specified by the comnmand line will report the result of the new data filling. The log specified by the configuration, instead, will list the actions performed by the queuePartialUpdater script in order to correct the database.
An example of usage is:
./queuePartialUpdater.pl /var/log/asterisk/queue_log P001 /var/log/qlog.log