Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building map #2

Open
apofiget opened this issue Apr 4, 2019 · 14 comments
Open

Error when building map #2

apofiget opened this issue Apr 4, 2019 · 14 comments

Comments

@apofiget
Copy link

apofiget commented Apr 4, 2019

These error we've see when try to build network map.

./build_map.py example.ini
Using configured uplink mac 00:0d:66:94:b0:00

[/] Update info about uplinks in db
[|] Check edge status of deviceUplink not found on 10.245.185.176
[/] Check edge status of deviceUplink not found on 10.245.185.166
[-] Check edge status of deviceUplink not found on 10.245.185.2
[] Check edge status of deviceUplink not found on 10.245.185.123
[|] Check edge status of deviceUplink not found on 10.245.185.29
[/] Check edge status of deviceUplink not found on 10.245.185.28

Traceback (most recent call last):
File "./build_map.py", line 261, in
min_transit_count = min(len(tmp) for tmp in all_lists) - 1
ValueError: min() arg is an empty sequence

@infery
Copy link
Owner

infery commented Apr 4, 2019

Can you show your arp-table file?
A think ./arp.py ruled out 00:0d:66:94:b0:00 from calculations, because it is absent in arp-file.

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

On uplink switch we have:

Internet 10.245.185.254 - 000d.6694.b000 ARPA Vlan907

And that MAC specified in config:

uplink_mac = 000d.6694.b000

I hope it's correctly?

@infery
Copy link
Owner

infery commented Apr 4, 2019

Its ok, but is record Internet 10.245.185.254 - 000d.6694.b000 ARPA Vlan907 present in arp-file?

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

Its ok, but is record Internet 10.245.185.254 - 000d.6694.b000 ARPA Vlan907 present in arp-file?

Yes. It exists. And one more moment. When i've load arp table to DB, last string in script output was a:

!UPLINK MAC-ADDRESS MUST BE IN ARP TABLE!

But uplink MAC exists in arp file.

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

My config:

[network]
; switch's default gateway mac address
uplink_mac = 000d.6694.b000
; switches creditionals
sw_username = root
sw_password = password
; sqlite database filename
database = example.db
; from wich file to load 'show ip arp'
file_with_arp = arp_mgmt907.txt

And part of arp-file content:

Internet  10.245.185.254          -   000d.6694.b000  ARPA   Vlan907
Internet  10.245.185.108         19   f07d.68ff.0bc1  ARPA   Vlan907
Internet  10.245.185.123         11   f8f0.8277.cd98  ARPA   Vlan907
Internet  10.245.185.44           5   1caf.f76c.4d95  ARPA   Vlan907
Internet  10.245.185.35           4   1caf.f775.fcc7  ARPA   Vlan907
Internet  10.245.185.106         26   f07d.68ff.0c99  ARPA   Vlan907
Internet  10.245.185.66           2   1cbd.b9e8.37f5  ARPA   Vlan907
Internet  10.245.185.98          13   f07d.68ff.0d01  ARPA   Vlan907
Internet  10.245.185.52           9   2810.7b4b.09c3  ARPA   Vlan907
Internet  10.245.185.6            9   3408.0496.c4cb  ARPA   Vlan907
Internet  10.245.185.110          8   1caf.f775.f750  ARPA   Vlan907
Internet  10.245.185.87          13   1cbd.b9e8.2861  ARPA   Vlan907
Internet  10.245.185.42          14   1caf.f76c.4e4c  ARPA   Vlan907
Internet  10.245.185.144         86   c8be.19a5.aef0  ARPA   Vlan907
Internet  10.245.185.85          20   1caf.f775.f75d  ARPA   Vlan907
Internet  10.245.185.147          9   f07d.68ff.0c06  ARPA   Vlan907
Internet  10.245.185.16          11   1caf.f776.206b  ARPA   Vlan907
Internet  10.245.185.8           14   1caf.f776.1fa5  ARPA   Vlan907
Internet  10.245.185.50          14   1caf.f77d.253c  ARPA   Vlan907
Internet  10.245.185.17          10   1caf.f775.fdb1  ARPA   Vlan907
Internet  10.245.185.111         19   f07d.68ff.0c9c  ARPA   Vlan907
Internet  10.245.185.67          10   1cbd.b9e8.276e  ARPA   Vlan907

@infery
Copy link
Owner

infery commented Apr 4, 2019

All switches have uplink mac in fdb?
This is may be not case, when monitoring is in same subnet, for example.

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

All switches have uplink mac in fdb?
This is may be not case, when monitoring is in same subnet, for example.

I think it all should have uplink MAC in their FDB, because NMS system works in other subnet and PC where i'm execute scripts also works in other subnet

@infery
Copy link
Owner

infery commented Apr 4, 2019

I find it difficult to help without database file

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

How i can provide it to you?

@infery
Copy link
Owner

infery commented Apr 4, 2019

deulinartem@gmail.com
Telegram: https://t.me/infery

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

Ok. Done. All data on your email.

@infery
Copy link
Owner

infery commented Apr 4, 2019

Thanks

@infery
Copy link
Owner

infery commented Apr 4, 2019

Really strange because no uplink mac is found in fdb table. Can you manually get mac from 10.245.185.95, show fdb and confirm, what 000d.6694.b000 is here?
And then ./dlink.py 10.245.185.95 admin admin, 000d.6694.b000 is here?
And if you edit arp-file, you must rerun ./arp.py and ./get_mac_form_switches.py for consistency

@apofiget
Copy link
Author

apofiget commented Apr 4, 2019

At the moment i've delete DB and execute all scripts again from scratch. And have another error:


./build_map.py example.ini
Using configured uplink mac 00:0d:66:94:b0:00

[-] Update info about uplinks in db
[-] Check edge status of device
Cant sort for dev_ip: 10.245.185.123 , transit count: 2 tmp_tr_list len = 2
Transit list on enter: [u'10.245.185.123', u'10.245.185.29'] and searched mac f8:f0:82:77:cd:98
Trying to continue calculation
Cant sort for dev_ip: 10.245.185.29 , transit count: 1 tmp_tr_list len = 1
Transit list on enter: [u'10.245.185.29'] and searched mac f8:f0:82:79:37:f3
Trying to continue calculation
Cant sort for dev_ip: 10.245.185.2 , transit count: 2 tmp_tr_list len = 2
Transit list on enter: [u'10.245.185.2', u'10.245.185.29'] and searched mac 1c:bd:b9:e0:7a:6a
Trying to continue calculation
Traceback (most recent call last):
  File "./build_map.py", line 289, in <module>
    if devices[dev]['hostid'] not in added_hosts:
KeyError: ''

Is that error may occur because host not exists in zabbix DB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants