mxStatExport2 - account data export
|
This application analyzes costs of individual users, groups and cost centers at regular intervals.
Application can be run by UMStaskManager every day at 00:00 (daily statistics) and at the first day of every month (monthly statistics).
It connects MX database through MX dbAPI. Database configuration data are read from the HKLM\software\datasys\mobilchange\database
registry key.
Application consists of 6 task in umsTaskCfg - MxStatDen, MxStatDenC, MxStatDenG, MxStatMes, MxStatMesC, MxStatMesG. Only MxStatDen
and MxStatMes are enabled, other must be disabled - do not change this setting, otherwise export will be run repeatedly every minute.
Application does three basic operations:
- cumulative / detailed statement of groups
- cumulative / detailed statement of cost centers
- cumulative / detailed statement of individual users
Cumulative statements are stored into "/mobilchange/log" folder and can be sent to specified email address. Detailed statements are sent
in case of individual users to their email address, in case of groups and cost centers to email address of the "group owner" - his address is
filled in Displayed name field of group properties. If address is not in SMTP format, nothing is sent.
Export goes through these steps:
- "timestamp" check if export wasn't already run today (or this month).
- export of cumulative / detailed statement of cost centers and eventual sending information by email to the owner of the group
together with isting of individual members of cost center.
- export of cumulative / detailed statement of groups and eventual sending information by email to the owner of the group together
with listing of individual members of group.
- export of cumulative / detailed statement of individual users.
- reseting of database counters
- sending information by email to the users and administrators
- writing of last run "timestamp" (protection against second run)
Command line parameters:
mxstatexport2 /R(M | D) [/Llevel] [/U] [/E{U | G | C | D}] [/T]
- /R{M | D} - export mode, M monthly, D daily
- /Lx - MobilChange log level: if message code is equal to x or lesser, it is written into log file
- /U - don't reset exported values – in this case counters also will not be reset after export.
- /T - don't check timestemp – application can be started even if it was already run today.
- /E{U | G | C| GD| CD } - export users (U), groups (G), cost centers (C) - if not specified, all data are exported. If "D" is added,
detailed statistics of individual users will be sent to group (cost center) owner/.
Configuration:
Configuration is stored in HKLM/Software/Datasy/MobilChange/Statexport2/
registry key (if this key is missing, import
MobilChange\extended\registry\uk\statexp2.reg
file into the registry).
Common value:
- "directory" - folder where exported files are stored
Following with "d_" or "m_" prefix for daily or monthly stastics:
- "export_all" - export all or only non-zero SMS cost? (1/0)
- "email2all" - send info email to all users or only to these who spent for SMS more than "email_limit"? (1/0)
- "email_limit" - limit value (see "email2all"), if it ends by % char, then it is procentual value of "day_(month_)limit"
from mxUser table
- "receivers_u" - list of email addresses separated by spaces, to which are sent statistics with /EU* option (sumary statistics of users)
- "receivers_g" - list of email addresses separated by spaces, to which are sent statistics with /EG* option (sumary statistics of groups)
- "receivers_c" - list of email addresses separated by spaces, to which are sent statistics with /EC* option (sumary statistics of cost
centers)
- "rec_export" - format (text) of line, can contain column names surrounded by %, also \t (tabulator) \n (CR), \r (LF),
\\ (backslash), \% (percent sign)
- "rec_info" - text message format (see rec_export), used if d_(m_)mail_info.txt doesn't exist in user's nor default language
- "sender" - address of statistic messages sender (mobilchange@datasys.cz)
Name convention for exported files:
- stat_day_<yyyymmdd>.txt for daily statistics
- stat_month_<yyyymm>.txt for monthly statistics
- Template file of message text for users is stored in individual language folders with name d_mail_info.txt (daily), m_mail_info.txt
(monthly). You can use database column names (from "mxUser" table, see Mobilchange database) in the text
surounded by "%" char. If template is missing, text from registry value "rec_export" is used.
Text example:
Dear %I_SURNAME%,
You have sent %THIS_DAY% messages today of your daily limit %DAY_LIMIT%.
You have sent %THIS_MONTH% messages this month of your monthly limit %MONTH_LIMIT%.
During the Mobilchange using you have sent %SUM_SMS% messages and spent %SUMCOST% money unit.
If list of addresses for statistics sending is not empty, then file with statistics is sent to all specified addresses after file closing.
For cumulative statements it is used as a body text and attachment, for individual user statistics data are put into template according user's
language. Cumulative statement of all members of group (cost center) is sent to the address specified by "Displayed name" name in group
properties.
back to top of page