Adding BDCOM OLT on ABillS

In this article I will give an example of adding BDCOM-P3310C and BDCOM-P3310B to the ABillS billing system on the Ubuntu Server 16.04 operating system.

BDCOM OLT should be added through the menu “Maintenance” – “Equipment”, then in the menu “Settings” – “Access server” you can edit the access password (which should be the same for SNMP and telnet), you can see the device statistics in “Maintenance” – “Equipment” – “PON”.

To draw graphics, install the necessary components and RRD::Simple:

apt-get install -yq cpanminus build-essential librrdtool-oo-perl rrdtool librrds-perl
cpanm RRDTool::OO

You can view the installed version as follows:

cpan -D RRDTool::OO

To collect data, add to /etc/crontab:

# Every 5m
*/5 * * * * root /usr/abills/libexec/billd equipment_pon

If you need to run the script less frequently, for example, every 10 minutes, then:

# Every 10m
*/10 * * * * root /usr/abills/libexec/billd equipment_pon STEP=600

Or once a day at 3:55 AM:

55 3 * * * root /usr/abills/libexec/billd equipment_pon STEP=86400

To cron did not send the command output to email, you can add at the end of the command
> /dev/null 2>&1
Or to write a debug log:
DEBUG=5 >/tmp/graph.log 2>&1

In case of problems, run with DEBUG 1-7:

/usr/abills/libexec/billd equipment_pon DEBUG=1

I note that the data on the graph begins to be drawn after the second or third execution of equipment_pon, and if you changed STEP, it is better to delete the old rrd files.

To erase the old data from the database and add the ONU to the new one:

/usr/abills/libexec/billd equipment_pon RELOAD=1

With a large number of ONUs, to write rrd files, you must use a separate disk or for example raid10 from ssd. For me, with the number of rrd files exceeding 7000 and the size of 700 MB, this is about 3000 ONU), equipment_pon took about 10 minutes (this is normal), but when writing rrd files, the SSD drive stupid for 10+ seconds, which is why the database did not respond, so you need to execute equipment_pon with a low priority of the disk and cpu, for example:

55 3 * * * root nice -n 19 ionice -c2 -n7 /usr/abills/libexec/billd equipment_pon STEP=86400 >/dev/null 2>&1

You can see the number of files and their size for example like this:

ls -f /usr/abills/var/db/rrd/ | wc -l 
du -h -s /usr/abills/var/db/rrd/

An example of viewing and clearing records through the database:

SELECT * FROM equipment_pon_onu LIMIT 50
SELECT * FROM equipment_pon_onu ORDER BY datetime DESC LIMIT 50
TRUNCATE TABLE equipment_pon_onu;
TRUNCATE TABLE equipment_pon_ports;

To collect data but do not draw graphics, add:

SKIP_RRD=1

You can specify specific OLT (access server), by default all data is collected from all:

NAS_IDS='1;2;5;7'

To search for and alert about duplicate ONTs, you can add to cron:

/usr/abills/libexec/billd equipment_pon SERIAL_SCAN=1

On the client services page, we select through the BDCOM OLT search as an access server, select the port (onu) through the search, for example, find by description (I have all ONTs signed in the BDCOM configuration and these descriptions are pulled up via SNMP to ABillS).

Done, now on the client page you can see the status of the ONT port ethernet, the signal level and other information.

For one of the OLT, the equipment_pon script did not put epon ports into the database, so I added them manually:

snmpwalk -v2c -c public 192.168.2.2 .1.3.6.1.2.1.2.2.1.2
INSERT INTO equipment_pon_ports VALUES ('37','7','9','epon','0/1','EPON0/1','0');
INSERT INTO equipment_pon_ports VALUES ('38','8','9','epon','0/2','EPON0/2','0');
INSERT INTO equipment_pon_ports VALUES ('39','9','9','epon','0/3','EPON0/3','0');
INSERT INTO equipment_pon_ports VALUES ('40','10','9','epon','0/4','EPON0/4','0');

Delete if anything like this:

DELETE FROM equipment_pon_ports WHERE id=37;

Another example of manually adding ports Huawei MA5683T OLT:

INSERT INTO equipment_pon_ports (snmp_id, nas_id, pon_type, branch, branch_desc, vlan_id)
VALUES ('4194328576', '12', 'gpon', '0/3/0', 'Huawei-MA5600-V800R008-GPON_UN', '0');
INSERT INTO equipment_pon_ports (snmp_id, nas_id, pon_type, branch, branch_desc, vlan_id)
VALUES ('4194328832', '12', 'gpon', '0/3/1', 'Huawei-MA5600-V800R008-GPON_UN', '0');

The SNMP template is located in /usr/abills/Abills/modules/Equipment/Bdcom.pm, and equipment_pon.pm – /usr/abills/libexec/billd.plugins/equipment_pon.pm

rrd graph files are stored in /usr/abills/var/db/rrd/, for example, the file name format NAS-ID_ONU-SNMP-ID_signal.rrd

Once one chart was not drawn, so I removed it and it was created the next time the script was executed, and began to be drawn:

mv /usr/abills/var/db/rrd/12_4194304512.4_signal.rrd /tmp/12_4194304512.4_signal.rrd

See also my articles:
Configure BDCOM P3310 EPON
Installing and configuring ABillS

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading