Search for:

Version 1 of 6.10.06, 16:57
Home - Latest - Tags - History - Referers

User:
Pass:
Create user - Lost password
Loway QueueMetrics

Chatbox:
And all is quiet....

AstRecipes » Avoiding queue_log file rotation

starstarstar This version of the page is not up to date - Back to current Avoiding queue_log file rotation star

If you run a call center, you will definitely want the log rotation susbsystem not to rotate your queue_log file along with the other Asterisk logs found in /var/log/asterisk. The queue_log file contains essential information on how the call-center is going that is being used by software like QueueMetrics to report on the well-being and the actual work being performed by your CC, and you surely want to keep that data in a safe place for cross-period analysis.
The majority of prebuilt Asterisk distributions will instead lotate that file together with the other Asterisk logs, and this may cause lost data if you do not have a backup.

Disabling log rotation
Disabling log rotation is actually quite easy: go to /etc/logrotate.d and look for a file named asterisk. If you run TrixBox, you'll find something like:

/var/log/asterisk/*log {
   missingok
   rotate 5
   weekly
   create 0640 asterisk asterisk
   postrotate
       /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
   endscript
}

There may as well be other sections where other files are rotated. You just delete the section above and the queue_log file will not be rotated anymore.

What if my queue_log has already been rotated?
If your queue_log has already been rotated, you'll want to join the remaining pieces together. That's very easy:

star First, stop Asterisk.
star Rename the existing queue_log to queue_log.now.
star Execute the following commands (I give examples for 5 leftover pieces, you may find a different number on your system):

cat queue_log.5 >> queue_log
cat queue_log.4 >> queue_log
cat queue_log.3 >> queue_log
cat queue_log.2 >> queue_log
cat queue_log.1 >> queue_log
cat queue_log.now >> queue_log

starRestart Asterisk.

This should be it. Now your QueueMetrics will work just fine.