How to do one-day statistics re-parsing
Statistics re-parsing is the process of removing corrupt or inaccurate xDR files for a target period from the database and uploading new records. That's useful especially at a time when you need to parse one-day statistics once again due to wrong data in files or a new collector in usage.
This procedure is considered unrecoverable, so utmost caution should be applied while performing it.
Before starting this process, please make sure that you have all the needed xDR files to upload to substitute deleted records. If you have any doubts and you do this for the first time, we highly recommend contacting our support engineers for receiving additional help.
Case 1: this day's xDRs are stored on the softswitch​
If the xDRs of this day are stored on the softswitch, follow these steps:
-
Go to Statistics → Archive Management and delete statistics of a target day by enabling a checkbox opposite it in the column and pressing Process button. Wait till Statistics Manager tool deletes files from the database and rolls back Clients' Balances.
-
Then go to Gateways → Downloads History and remove xDR files this day from download history (for all gateways).
For instance, if you need to remove xDR fields history for September 26, 2016, select respective entries and click Delete button. You can just type the following 201609276 in a Search bar to simplify the process of finding the required files.
Case 2: this day's xDRs are NOT stored on the softswitch​
If the xDRs of this day are NOT stored on the softswitch, follow these steps:
-
Check the existence of these xDR files for all gateways in
/usr/local/vcs/var/cdrs_parsed/host_(id of gateway)
folder for VCS version 3.12.0 and lower or/opt/jerasoft/vcs-data/external/xdrs_parsed/host_(id of gateway)
folder for VCS version 3.13.0 and higher. -
Go to Statistics → Archive Management and mark checkbox opposite a target day in the column. After that press Process button. Wait till Statistics Manager deletes files.
-
Then move xDRs of a respective day from the "xdrs_parsed" folder ("cdrs_parsed" for older versions) to the "xdrs" folder ("cdrs" for older versions) for each Gateway.
Examples:
- For older VCS versions:
mv /usr/local/vcs/var/cdrs_parsed/host_11/cdr_20140401_* /usr/local/vcs/var/cdrs/host_11/
mv /usr/local/vcs/var/cdrs_parsed/host_12/cdr_20140401_* /usr/local/vcs/var/cdrs/host_12/
- For newer VCS versions
mv /opt/jerasoft/vcs-data/external/xdrs_parsed/host_11/cdr_20140401_* /opt/jerasoft/vcs-data/external/xdrs/host_11/
mv /opt/jerasoft/vcs-data/external/xdrs_parsed/host_12/cdr_20140401_* /opt/jerasoft/vcs-data/external/xdrs/host_12/
warningPlease note that your xDR files names will be different from the ones in the given example, so make sure you use the correct alias and correct gateway id folder, which are usually named like host_11, host_12, etc.
-
Usually, your parsed xDRs are archived, so now you need to extract them:
-
if you have ".gz" format, you need to run
gunzip *
-
if you have "tar.gz" format, you need to run
tar -zxvf *
-
-
Check if the owner of these files is vcs user. If it's not, run
sudo chown vcs:vcs *
-
Check if these files are allowed for reading/writing for all users. If not, run
sudo chmod 777 *
-
Wait till the system processes and calculates these files.