How to re-collect statistics
Problem
There are no statistics for a certain period and you need to re-collect the statistics for that time.
Solution
The statistics are written to the itemstat table and collected by the processing module once a day according to the task in cron. In the processing module's log, running the operation appear as follows:
An example of a log entry
Feb 15 00:20:01 [5977:1] processing INFO RUN with: processing/pmispmgr5 --command stat --module 1
pmispmgr5 — processing module;
module 1 — processing module id.
An example of a log entry
Feb 15 00:20:03 [5977:1] db EXTINFO Query: 'INSERT INTO itemstat(item, statdate, param, value, measure) VALUES (15, '2020-02-14', 'webdomainlimit', '1', 7) ON DUPLICATE KEY UPDATE
param='webdomainlimit', value='1', measure=7'
To re-collect the statistics:
Find the records for the days needed.
Find records
select * from itemstat where statdate="2020-02-14";
CODEComments to the commandstatdate — the date for which the statistics were collected.
To find records on a particular service:Find records on a particular service
select * from itemstat where statdate="2020-02-14" and item=15;
CODEComments to the commandstatdate — the date for which the statistics were collected;
item — service code.
Delete the found records.
Delete records
delete from itemstat where statdate="2020-02-14";
CODEComments to the commandstatdate — the date for which the statistics will be deleted.
To delete records on a particular service:Delete records
delete from itemstat where statdate="2020-02-14" and item=15;
CODEComments to the commandstatdate — the date for which the statistics will be deleted;
item — service code.
In the laststatdate field of the processingmodule table, set the date for which you want to collect the statistics.
Shift the date
update processingmodule set laststatdate="2020-03-18" where id=1;
CODEComments to the commandid — server id.
Start statistics collection manually:
Statistics collection
/usr/local/mgr5/processing/pmispmgr5 --command stat --module 1
CODE- If the statistics are not collected, check the processing module. Most often, the problem with collecting statistics occurs due to errors on the processing module side or due BILLmanager server being unable to access the processing module.