Reset queue stats automatically - HUD Queues

Gasmanz
Posts: 235
Member Since:
2007-09-04

Not sure if this has been covered off before but here it is anyway.

With HUD Queues you have statistics displayed as part of the details for each queue which includes the Abandoned and Completed call counts. These can only be reset manually and the last reset time is displayed in each queue. The problem with this is that nobody can tell why the queue statistics were reset at that time and who reset them.

The other issue is getting someone to remember to reset the queue statistics periodically that gives the statistics some meaning i.e. Daily, Weekly or Monthly. There is a way to achieve automatic periodic statistics resets but it requires implementing cron jobs to do it. This can't be done in the CP so you will need CLI access to do it.

At the root CLI you can enter "crontab -l" to list the current cron jobs that your trixbox server runs. To edit this and add your own cron jobs follow my instructions below.

1. Enter "crontab -e" at the CLI to open the crontab with vi editor.

2. Press the "*a" keys to put it in "--INSERT--" mode which can be seen at the bottom of the page.

3. Use the down arrow key to take the cursor down the page to a blank line where you can insert your new cron job.

4. Enter "0 0 * * * /usr/sbin/asterisk -r -x 'flush queue stats Sales'" to reset the "Sales" queue at midnight everyday. You can enter any queue name to replace Sales in my example but remember that it is case sensitive. Add additional cron job entries on new lines for each queue you want to reset. This command works for asterisk 1.2 but will need to be changed to 'queue flush stats Sales' in the next release of trixbox pro which uses asterisk 1.6.

5. When you have finished entering the commands press the "Esc" key to exit the edit mode.

6. Press the ":x" keys to save your changes and exit.

At the root CLI enter "crontab -l" again to list the cron jobs and confirm the changes you made have been saved.

That's all it takes. These new cron jobs are not saved as part of the Hybrid Host service from Fonality so if you have to rebuild the server from the ISO you will have to re-enter them again. Fonality may look at including this in the CP one day but for now this is the only way to do it. There are more options for setting the time periods between the execution of your cron jobs. Below is an explanation of how that works.

0 0 * * * = Every day at 12:00am
0 0 * * 1 = Every Monday at 12:00am
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)

Cheers,

--

Graham Campbell

FtOCC Tech Certified
Hi-Tech Solutions Ltd.
Auckland
New Zealand



riyal
Posts: 2
Member Since:
2010-07-15
Reset queue stats automatically - HUD Queue

Thanks Graham much appreciated.



Tirabytes
Posts: 4
Member Since:
2009-08-07
Well done Gazman, you're a

Well done Gazman, you're a legend.



Schwood
Posts: 478
Member Since:
2006-06-23
Agreed - nicely done

Agreed - nicely done Graham...you are a true wizard down there in NZ.

--

Chris Sherwood
FtOCC Admin and Tech Certified
Fonality Sales Engineer



tmerritt
Posts: 1
Member Since:
2010-07-19
Send me wine

NZ varietals are coming up and up here in LA - popular stuff.

Oh and good work :)



nzkef
Posts: 171
Member Since:
2007-12-11
pfft...

I taught Graham everything he knows ;)

Nice work Gray.

Kevin

P.S. tmerritt... you want meat pies with that wine? I'm sure it'll keep :)



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.