Symptoms
We have a customer with PA Subscription #SUB_ID - domain DOMAIN.TLD is associated with the subscription
PBA-S Top > Account Director > Subscription Manager > Subscriptions > #SUB_ID > Domains
Several mailboxes exist in the domain, they are shown in CP:
PBA-S > Top > Account Director > Subscription Manager > Subscriptions > #SUB_ID > Account #ACC_ID > Log in to CP > Mail
--->8---
MAIL1@DOMAIN.TLD
MAIL2@DOMAIN.TLD
MAIL3@DOMAIN.TLD
MAIL4@DOMAIN.TLD
MAIL5@DOMAIN.TLD
---8<---
But resource "Number of mailboxes" is not updated in PBA-S subscription - it still has value 0:
PBA-S > Top > Account Director > Subscription Manager > Subscriptions > #SUB_ID > Resources > Show Advanced Options
--->8---
Number of mailboxes (number_of_mailboxes) Current value 0 unit, Included value 0 unit
---8<---
When the customer will be charged for resource overusage?
Cause
Resource "Number of mailboxes" is not updated in PPA:
PPA > Top > Operations Director > Customers > #PPA_ACC_ID > Subscriptions > #PPA_SUB_ID > Resources
--->8---
1000318 Number of mailboxes 0 unit 1000 unit 1000 unit July 01, 2013 12:11
---8<---
Because periodic task "Sync resource usage" fails in PPA:
PPA > Top > System > Task Manager > Periodic
--->8---
Sync resource usage August 08, 2013 03:52:02 3600 second(s) Rescheduled
---8<---
Run periodic task "Sync resource usage" in PPA. If the task fails, check log /var/log/poa.debug.log for the reason of the failure.
Resolution
In PBA-S statistics are gathered by task #40 "Update POA nodes stats info" periodically (defined by times in poa_sync_time
table).
mysql> select * from poa_sync_time;
+-------+---------------------+---------------------+---------------------+---------------------+
| hw_id | res_usage_sync | subscr_sync | serv_tmpls_sync | conflicts_sync |
+-------+---------------------+---------------------+---------------------+---------------------+
| 1 | 2013-08-08 22:09:43 | 2013-08-09 01:40:05 | 2013-08-08 15:54:06 | 2013-08-09 01:25:05 |
+-------+---------------------+---------------------+---------------------+---------------------+
1 row in set (0.00 sec)
mysql>
To verify resource usage is updated - change res_usage_sync to the time in the past and run the task through GUI. Here is the record in PBA-S log about successful resource usage update for PPA subscription 18:
--->8---
[2013/08/09 02:30:03] [DEBUG] [9299] [HSPC::MT::PA::Protocol::compose_request] Request to PA:
[2013/08/09 02:30:03] [DEBUG] [9299] [HSPC::MT::PA::Protocol::compose_request] <?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>pem.getResourceUsageForPeriod</methodName><params><param><value><struct><member><name>to_time</name><value><i4>1376011802</i4></value></member><member><name>from_time</name><value><i4>1280989345</i4></value></member><member><name>resource_type_ids</name><value><array><data><value><i4>1000318</i4></value></data></array></value></member><member><name>subscription_id</name><value><i4>18</i4></value></member></struct></value></param></params></methodCall>
[2013/08/09 02:30:03] [DEBUG] [9299] [HSPC::MT::PA::Protocol::parse_response] Response from PA:
[2013/08/09 02:30:03] [DEBUG] [9299] [HSPC::MT::PA::Protocol::parse_response] $VAR1 = {
'status' => '0',
'result' => {
'actual_period' => {
'to_time' => '1376011802',
'from_time' => '1280989345'
},
'resource_type_usages' => [
{
'initial_usage64' => '0',
'parent_resource_type_id' => '1000317',
'usage_statistics' => [
{
'delta' => '5',
'time' => '1375951092',
'delta64' => '5'
}
],
'resource_type_id' => '1000318',
'initial_usage' => '0'
}
]
}
};
---8<---
In PBA-S the resource usage statistics for PPA subscription is added into table poa_stat_history:
mysql> select psh.subscr_id, pr.poa_res_id, pr.class_name, psh.total, from_unixtime(psh.last_update_ts) from poa_stat_history psh, poa_res pr where psh.subscr_id=<SUB_ID> and psh.res_id=pr.res_id group by psh.last_update_ts desc;
+-----------+------------+----------------------+-------+-----------------------------------+
| subscr_id | poa_res_id | class_name | total | from_unixtime(psh.last_update_ts) |
+-----------+------------+----------------------+-------+-----------------------------------+
| <SUB_ID> | 1000318 | plesk_mail.mailboxes | 5 | 2013-08-12 20:39:30 |
...
Statistic will be used for issue overusage invoice in billing day.