Author Topic: qloaderd not loading after log rotation started again  (Read 10226 times)

trymes

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 0
    • View Profile
qloaderd not loading after log rotation started again
« on: February 22, 2008, 16:47:25 »
I had a working qloaderd install on Trixbox until I removed and reinstalled asterisk (don't ask, it was a bad idea). Anyhow, that forced asterisk to start rotating the queue_log file again, and I didn't notice until a week or so later. I repeated to process of combining the rotated queue_log files into one big file and I restarted qloaderd, checked all of the settings, etc, and all appears to be working, except that the database is not receiving any new data.

qloader.log prints out multiple lines of "Heart is still beating... Imported 0 lines." and it just spits out "Skipped xxxxxx lines" if I restart it.

In the Queuemetrics datbase inspector, it only shows data up to Jan 15, though we have data all the way to today in the queue_log file.

If I connect to mysql using the parameters specified in the qloaderd.pl script, (username, password, database), I can connect successfully.

Does anyone have any suggestions as to where I can look next? I'm sure it's something obvious, but I can't seem to figure it out.

Tom

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #1 on: February 24, 2008, 10:08:22 »
The thing that usually affects qloaderd not loading is the highest index it has in that partition. Try this: use a different partition name and see if the DB gets loaded.

trymes

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 0
    • View Profile
Re: qloaderd not loading after log rotation started again
« Reply #2 on: February 25, 2008, 20:50:05 »
OK, I modified the partition name in the /etc/init.d/qloaderd file, and it loaded the info to the p002 partition. However, there seems to be some information missing, as P001 has data from October through Feb 12, while P002 has info just from November through Feb 12. (I had the permissions wrong on the /var/log/asterisk file, so it seems that asterisk has been unable to write anything to it since Feb 12) Maybe the "chown asterisk.asterisk /var/log/asterisk/queue_log" command and the appropriate chmod command would be a good thing to add to the tutorial on combining previously rotated call log files.
« Last Edit: February 25, 2008, 21:11:37 by trymes »

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #3 on: February 26, 2008, 09:04:25 »
I think that you lost some data due to a rotation then - but you can manually load the previous data from partition P001 to P002.

trymes

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 0
    • View Profile
Re: qloaderd not loading after log rotation started again
« Reply #4 on: February 26, 2008, 15:22:34 »
Quote
I think that you lost some data due to a rotation then - but you can manually load the previous data from partition P001 to P002.
Would the easiest way to do this be to copy Partition P001 to P003 and then force qloaderd to use that?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #5 on: February 28, 2008, 16:54:55 »
I would select the lowest timestamp in partition P002 and then move all values from P001 that have a lower timestamp than that to partition P001, something like:

UPDATE queue_log
SET partition = 'P002'
WHERE partition = 'P001' and time_id < 1111111111


where 1111111111 is the minimum timestamp for P002.

Do run a backup first :)






ew

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: qloaderd not loading after log rotation started again
« Reply #6 on: November 02, 2009, 09:36:45 »
My Qloaderd doesn't collect data, when the logratation starts again. I add the lines to /etc/logrotate.d/asterisk with the qloaderd manual

Code: [Select]
/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log {
        weekly
        missingok
        rotate 4
        sharedscripts
        postrotate
                /usr/sbin/invoke-rc.d asterisk logger-reload > /dev/null 2> /dev/null
                /etc/init.d/qloaderd restart > /dev/null 2> /dev/null
        endscript
}

Now I have to rename the file queue_log.1 to queue_log and do an restart of qloaderd.
An restart of qloaderd only, doesnt show any data on the QM page.

My System:

Ubuntu 7.04
Asterisk 1.4

Any suggestions are welcome. Thanks in advance

Bes regards

T. Lai

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #7 on: November 02, 2009, 09:41:59 »
You should likely create the /var/log/asterisk/queue_log file - if it has been rotated and nothing is written to it, qloaderd will stop complaining that the file does not exist.


ew

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: qloaderd not loading after log rotation started again
« Reply #8 on: November 02, 2009, 12:33:59 »
There was some Data in the queue_log file. But qloaderd doesn't load the datas into SQL after logratation.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #9 on: November 02, 2009, 14:10:33 »
You have to restart qloaderd

ew

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: qloaderd not loading after log rotation started again
« Reply #10 on: November 02, 2009, 16:57:04 »
An restart of qloaderd only, doesnt show any data on the QM page. So i have to rename the old logfile queue_log.1 to the existing file queue_log after restarting qloaderd, the datas was there without the datas from the overwritten one.
So any suggestion for the logrotate file?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: qloaderd not loading after log rotation started again
« Reply #11 on: November 04, 2009, 09:46:06 »
1. logrotate
2. do a touch to create the queue_log file
3. restart qloaderd