zentavr / linet.mikrotik

Zabbix Helpers To Fetch Mikrotik's Counters via API
21 stars 7 forks source link

Trying to fix the issue when int() comes as a BGP peer name #2

Closed zentavr closed 6 years ago

zentavr commented 6 years ago
ISSUE TYPE
SUMMARY

Sometimes the operators put the numbers as the names of BGP Peers (saying AS-NUM). Because of this the concatenation in plugins/bgp.py got failed with:

Traceback (most recent call last):
  File "/etc/zabbix/mikrotik/zabbix.py", line 62, in <module>
    main()
  File "/etc/zabbix/mikrotik/zabbix.py", line 55, in main
    m.run(api, args.use_timestamps)
  File "/etc/zabbix/mikrotik/plugins/bgp.py", line 30, in run
    key='mikrotik.bgp.node[' + bgpitem['name'] + ',remote-as]',
TypeError: cannot concatenate 'str' and 'int' objects

This PR should fix that.

Should fix #1