LibreNMS - Billing Module

Hey guys.

One Question I have in terms of the billing Module: in the Database I noticed that its saving the data in bytes:

MariaDB [librenms]> desc bills;
±-----------------±-------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±-----------------±-------------±-----±----±--------±---------------+
| bill_id | int(11) | NO | PRI | NULL | auto_increment |
| bill_name | text | NO | | NULL | |
| bill_type | text | NO | | NULL | |
| bill_cdr | bigint(20) | YES | | NULL | |
| bill_day | int(11) | NO | | 1 | |
| bill_quota | bigint(20) | YES | | NULL | |
| rate_95th_in | bigint(20) | NO | | NULL | |
| rate_95th_out | bigint(20) | NO | | NULL | |
| rate_95th | bigint(20) | NO | | NULL | |
| dir_95th | varchar(3) | NO | | NULL | |
| total_data | bigint(20) | NO | | NULL | |
| total_data_in | bigint(20) | NO | | NULL | |
| total_data_out | bigint(20) | NO | | NULL | |
| rate_average_in | bigint(20) | NO | | NULL | |
| rate_average_out | bigint(20) | NO | | NULL | |
| rate_average | bigint(20) | NO | | NULL | |
| bill_last_calc | datetime | NO | | NULL | |
| bill_custid | varchar(64) | NO | | NULL | |
| bill_ref | varchar(64) | NO | | NULL | |
| bill_notes | varchar(256) | NO | | NULL | |
| bill_autoadded | tinyint(1) | NO | | NULL | |
±-----------------±-------------±-----±----±--------±---------------+
21 rows in set (0.00 sec)

Example: I have this customer “CustB” that has a Quota type of billing with 2TB
| 2 | CustB | quota | 0 | 1 | 2000000000000 | 13941315 | 32700849 | 32700849 | out | 1999468072891 | 560964431339 | 1438503641552 | 5460438 | 14002420 | 19462858 | 2016-11-27 06:01:01 | CustB | | | 0 |

I noticed that 2TB is converted into 2000000000000 in the DB however 2000000000000 is only 1.8TB in real calculation !

Am I missing something here - or these values are just for reference in the Database.

Thanks

2000000000000 = 2TB = 1.8TiB

I Stand corrected.

Thanks Murrant.

No worries easy to confuse and many do.

Just a quick question on Billing tool.

Does it create a new Bill every month. I created one for November - however it did not create a new one for December, I have seen that it does not update the old BIlls
[root@system configs]# /opt/librenms/billing-calculate.php
3 Trunk to nrocswi6
4 LocalHost

But updates the new one I just created:
5 WAF Traffic
11/03/16 @ 00:00:00 to 12/02/16 @ 23:59:59 Quota 200GB 47.6MB 0.02% Updated! Updated history!

Just wondering if it can auto create bills.

One more thing - I noticed in current bills it shows the old bills as well. when I select the pervious bills it only shows the November bills.

Thanks

The new bill will be created on the roll over from the 1st to the 2nd - don’t ask me why, I don’t know.

lol, I wont ask why no worries.

Then I should expect a new bill tomorrow sometime. If not then I can play around with the API and backend

Thanks again