~~NOTOC~~

Accounting Client 3.0

:!: To use this functionality you need to install the [[software:addons:accounting|Accounting Toolset Addon]]
The accounting toolset visualizes and reports resource usage data, and allows their integration with chargeback and billing platforms. The toolset generates accounting reports using the information from the accounting OpenNebula Database. These accounting tools address the accounting of the virtual resources, it includes resource consumption of the virtual machines as reported from the hypervisor. ====== Prerequisites ====== This addon requires the following gems: * sequel * mysql (if using the MySQL adaptor) * sqlite3 (if using the sqlite database) * accounting subsystem configured and running as shown in the [[|acctd_confguide]] ====== Installation ====== [[http://www.opennebula.org/software:addons:accounting|Download the addon]], untar and execute 'install.sh' as the oneadmin user. ====== Configuration ====== No configuration is needed for this addon. ====== Accounting for the Virtual Resources ====== Accounting information for Virtual Machines can be obtained for a given user or all of them. ===== Command Line Usage ===== ''oneacct'' - prints accounting information for virtual machines Usage: oneacct [options] -s, --start time Start date and time to take into account -e, --end time End date and time -u, --user user User id to make accounting -j, --json Output in json format -x, --xml Output in xml format The time is written as ''month/day/year hour:minute:second''. To integrate this tool with your billing system you can use ''-j'' or ''-x'' flags to get all the information in an easy computer readable format. ===== Sample Output ===== Obtaining the accounting information for a given VM # User 0 VMID MEMORY CPU NETRX NETTX TIME 4 64M 50.1 556K 12.1K 01/09 04:56:44 # User 2 VMID MEMORY CPU NETRX NETTX TIME 6 64M 50.1 156K 7M 01/01 01:16:24 7 64M 50.1 803K 6.5M 01/08 04:50:09 The columns are: * VMID: VM identifier * MEMORY: Memory allocated for the VM * CPU: Cpu allocated for the VM * NETRX: in bandwidth used * NETTX: out bandwidth used * TIME: Time the VM was running Obtaining the accounting information for a given user $ oneacct -u 0 # User 0 VMID MEMORY CPU NETRX NETTX TIME 4 64M 50.1 556K 12.1K 01/09 04:56:44