device42/nix_bsd_mac_inventory

Linux: starter.py too many values to unpack

Closed this issue · 6 comments

pdana commented

Getting the following error running latest version against centos 7.3 vm

python starter.py 192.168.254.144

[*] Connecting to 192.168.254.144:22 as "user" using key file.
[+] Linux running @ 192.168.254.144 
[+] Collecting data from: 192.168.254.144
too many values to unpack
None

Hi, Peter

I tried to repeat this issue on CentOS 7.3.1611 but I can't.

If you can, please replace main.py and module_linux.py in your version with the version from https://gist.github.com/bearburger/dec8aa1b8cc113248f61cb37fe508ac0 and run starter.py again. It should print stack trace with exact place where the error occurs.

Thanks.

pdana commented

Sorry for the delay in getting back to you, below is the output using the provided script

pete@jenkins ~/nix_bsd_mac_inventory-debug $[master *%] python starter.py 
[*] Connecting to 192.168.254.102:22 as "pete" using key file.
[+] Linux running @ 192.168.254.102 
[+] Collecting data from: 192.168.254.102
[-] Error in get_hdd_info_hdaparm() for IP: 192.168.254.102 . Message was: [u'sudo: hdparm: command not found\n']
[-] Error in get_hdd_info_hdaparm() for IP: 192.168.254.102 . Message was: [u'sudo: hdparm: command not found\n']
['  File "/home/pete/nix_bsd_mac_inventory-debug/main.py", line 452, in check_os\n    data = process_data(data_out, ip, usr, pwd)\n', '  File "/home/pete/nix_bsd_mac_inventory-debug/main.py", line 338, in process_data\n    data = get_linux_data(ip, usr, pwd)\n', '  File "/home/pete/nix_bsd_mac_inventory-debug/main.py", line 204, in get_linux_data\n    data = linux.main()\n', '  File "/home/pete/nix_bsd_mac_inventory-debug/module_linux.py", line 88, in main\n    self.get_ip_ipaddr()\n', '  File "/home/pete/nix_bsd_mac_inventory-debug/module_linux.py", line 575, in get_ip_ipaddr\n    _, mac, _, _ = mac_word.split()\n']
too many values to unpack
None
pdana commented

One comment, we have a TON of network data on our nodes, as high as 20,000k connections w/ multiple docker containers. We run quagga in a docker container that runs bgp daemon, and we bind several IPs to the loopback so we can 'advertise the IPs' out over 'unnumbered nics' - aka we dont assign IPs directly to our NICs, but instead bind the IPs to lo and use BGP to advertise a nodes IPs to the network.

pdana commented
pete@jenkins ~/nix_bsd_mac_inventory-debug $[master *%] python main.py

[!] Running 5 threads.
Traceback (most recent call last):
  File "main.py", line 542, in <module>
    main()
  File "main.py", line 507, in main
    q.put(ip_scope[0])
TypeError: 'set' object does not support indexing

Hi @pdana

We have a testing branch with the improved queue system. It should fix the error from your last message. And I pushed the yout initial issue fix into it too. Can you test it, please?

https://github.com/device42/nix_bsd_mac_inventory/tree/improved-threading

Best regards, Roman

pdana commented

Thanks Roman, the script did complete from the new branch !