Queue stats reset issue

queue
Tags: #<Tag:0x00007f70327e8778>

(Chris) #1

Hi,

I have created an queue and assigned 5:00 AM as the “Queue Stats Reset” time, but the stats are getting reset at 12:00 midnight.

Can anyone help me with this please.


(P Ramarajan) #2

@Chris1996 Can you check the cron entry time? and confirm its added as per your config or not?

“crontab -l -u asterisk | grep queue”


(Chris) #3

@pramarajan Output for the above command:

[root@freepbx ~]# crontab -l -u asterisk | grep queue

          • /usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1
            0 5 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7000
            0 5 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7001
            0 5 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7002

(P Ramarajan) #4

Looks the cron entries are added properly so might be the problem with the system’s timing?
Check system’s time is set to correct or not ?


(Chris) #5

System timing is according to my zone, which is correct


(Matt Brooks) #6

@Chris1996 It appears that FreePBX is setup correctly, but can you execute date from the cli and show us what timezone the system is set to?

Example:

[root@localhost ~]# date
Fri May 29 20:00:59 CDT 2020

My assumption here is that the system is set to UTC time. This means that the crontab entries should say:
0 2 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7000
0 2 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7001
0 2 * * * /var/lib/asterisk/bin/queue_reset_stats.php --id=7002

That being said, it’s possible that this could be a bug, can you tell us what module version of freepbx and queuestats you are running?


(Chris) #7

@mbrooks

[root@freepbx ~]# date
Mon Jun 1 16:25:11 +03 2020

FreePBX version:
image

I’m not able to find “queuestats” module, in the module admin section


(Matt Brooks) #8

Well, it looks like everything is setup correctly. The only thing I’ll note is that the version of FreePBX that you’re running is really old . It’s possible this was a bug that has been fixed in a later version, but I’m not sure.


(Chris) #9

Thank you for the quick response. I will update the FreePBX.


(Lorne Gaetz) #10

That pbx firmware version is not old. 2002 = Feb 2020, and is the current FreePBX Distro version for 15


(Chris) #11

@lgaetz
Yea I just got it on the web. I’m not understanding what exactly went wrong :slightly_frowning_face:


(Matt Brooks) #12

Yeah, I was wrong, we have a million version numbers for FreePBX. You gave me the FreePBX Distro version, which is not the same as the version of FreePBX. I saw it and thought you were running FreePBX 12, which is wrong. You’re actually running FreePBX 15 which is the latest.


(Matt Brooks) #13

@Chris1996 take a look at /var/log/cron to see if you can find a reason why the cron entries are not running. They should show execution or an error. If they are not showing execution, then they are probably not installed for some reason.


(Chris) #14

@mbrooks

Below you can see cron jobs ran for two dates,

May 31:

May 31 05:00:02 freepbx CROND[4797]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7002)
May 31 05:00:02 freepbx CROND[4798]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7001)
May 31 05:00:02 freepbx CROND[4799]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7000)
May 31 05:00:02 freepbx CROND[4800]: (asterisk) CMD (/usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1)
May 31 05:00:02 freepbx CROND[4801]: (asterisk) CMD ([ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall)
May 31 05:00:03 freepbx crontab[4876]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4878]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4889]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4891]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4893]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4894]: (asterisk) REPLACE (asterisk)
May 31 05:00:03 freepbx crontab[4896]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4898]: (asterisk) LIST (asterisk)
May 31 05:00:03 freepbx crontab[4899]: (asterisk) REPLACE (asterisk)
May 31 05:00:03 freepbx crontab[4901]: (asterisk) LIST (asterisk)
May 31 05:01:01 freepbx crond[1788]: (asterisk) RELOAD (/var/spool/cron/asterisk)
May 31 05:01:01 freepbx CROND[4983]: (asterisk) CMD (/usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1)

Jun 1:

Jun 1 05:00:01 freepbx CROND[22061]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7002)
Jun 1 05:00:01 freepbx CROND[22062]: (root) CMD (php -q /usr/local/parselog/parselog.php convertlocal)
Jun 1 05:00:01 freepbx CROND[22063]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7001)
Jun 1 05:00:01 freepbx CROND[22064]: (asterisk) CMD (/var/lib/asterisk/bin/queue_reset_stats.php --id=7000)
Jun 1 05:00:01 freepbx CROND[22065]: (asterisk) CMD ([ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall)
Jun 1 05:00:01 freepbx CROND[22066]: (asterisk) CMD (/usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1)
Jun 1 05:00:27 freepbx crontab[22163]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22165]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22176]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22178]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22180]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22181]: (asterisk) REPLACE (asterisk)
Jun 1 05:00:27 freepbx crontab[22183]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22185]: (asterisk) LIST (asterisk)
Jun 1 05:00:27 freepbx crontab[22186]: (asterisk) REPLACE (asterisk)
Jun 1 05:00:27 freepbx crontab[22188]: (asterisk) LIST (asterisk)
Jun 1 05:01:01 freepbx crond[1771]: (asterisk) RELOAD (/var/spool/cron/asterisk)
Jun 1 05:01:01 freepbx CROND[22251]: (root) CMD (run-parts /etc/cron.hourly)
Jun 1 05:01:01 freepbx CROND[22252]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null)
Jun 1 05:01:01 freepbx CROND[22253]: (asterisk) CMD (/usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1)
Jun 1 05:01:22 freepbx crontab[22302]: (asterisk) LIST (asterisk)
Jun 1 05:01:22 freepbx crontab[22304]: (asterisk) LIST (asterisk)


(Matt Brooks) #15

@Chris1996 Sorry for taking so long to get back to you on this, but this smells like a bug. The good news is that the queuestats module is a commercial module and if the license is up to date it should give you some access to commercial support from Sangoma. Support may also be able to explore something we’re missing to fix the issue, or at least verify it is indeed a bug.


(Itzik) #16

AFAIK, the issue here is with the regular queue module.


(Matt Brooks) #17

And so it is. He used fwconsole queuestats --syncall above, which got me confused I guess. A regular jira can probably created on https://issues.freepbx.org for the freepbx team to take a look at then.


(Sandesh Prakash) #18

Hi @Chris1996

Can you please check your hardware clock is set correctly. As the cron jobs run with respect to hardware clock. If your hardware clock is not set properly then sync your hardware clock with your system clock and this should resolve the issue.


(Chris) #19

@psandesh I checked the hardware clock it is correct.