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

ansible==3.9.8,执行 prophet-cli -d collect --host-file /tmp/scan_hosts.csv --output-path /tmp/命令时,报错 #8

Open
qingyunliu opened this issue Jan 14, 2022 · 0 comments

Comments

@qingyunliu
Copy link

qingyunliu commented Jan 14, 2022

换了一个版本的ansible,并且没有再次安装sshpass包,执行命令的时候,还是会报错,不过好像报的错与ansible==2.7.8时不一样:

prophet-cli -d collect --host-file /tmp/scan_hosts.csv --output-path /tmp/
2022-01-14 10:54:52,720 20608 INFO [-] Collecting hosts information from /tmp/scan_hosts.csv...
2022-01-14 10:54:52,728 20608 INFO [-] Found 4 host(s) in csv...
2022-01-14 10:54:52,729 20608 DEBUG [-] Current row is: {'hostname': 'host-192-168-10-129.openstacklocal', 'ip': '192.168.10.129', 'username': 'root', 'password': 'root123.', 'ssh_port': 22, 'key_path': '', 'mac': 'fa:16:3e:b30a:3d', 'vendor': '', 'check_status': 'check', 'os': 'Linux', 'version': 'Linux 2.6.32 - 3.9', 'tcp_ports': '22,111,3306,8086,10082,15000,16000', 'do_status': 'failed'}
2022-01-14 10:54:52,729 20608 DEBUG [-] Current host check status is check, do status is failed, force check is False
2022-01-14 10:54:52,729 20608 INFO [-] Collecting host [LINUX]192.168.10.129...
2022-01-14 10:54:52,732 20608 DEBUG [-] reading /root/.cache/python-entrypoints/5bbc14f0da613c6839a8a8ec8e5606ae5420e438e464e18aaa12ac17a444f770
2022-01-14 10:54:52,739 20608 DEBUG [-] writing to /root/.cache/python-entrypoints/5bbc14f0da613c6839a8a8ec8e5606ae5420e438e464e18aaa12ac17a444f770
2022-01-14 10:54:52,741 20608 DEBUG [-] found extension EntryPoint(name='LINUX', value='prophet.collector.hosts.linux:LinuxCollector', group='host_collector')
2022-01-14 10:54:53,634 20608 DEBUG [-] found extension EntryPoint(name='VMWARE', value='prophet.collector.hosts.vmware:VMwareCollector', group='host_collector')
2022-01-14 10:54:53,635 20608 DEBUG [-] found extension EntryPoint(name='WINDOWS', value='prophet.collector.hosts.windows:WindowsCollector', group='host_collector')
2022-01-14 10:54:53,636 20608 INFO [-] Precheck for Linux 192.168.10.129 connection
2022-01-14 10:54:53,636 20608 INFO [-] Checking 192.168.10.129 SSH info...
2022-01-14 10:54:53,636 20608 INFO [-] Collecting host 192.168.10.129 info...
2022-01-14 10:54:53,636 20608 INFO [-] Prepare config file for Linux collection...
2022-01-14 10:54:53,637 20608 INFO [-] Write ansible hosts to /tmp/tmpn3gf2qee/hosts...
2022-01-14 10:54:53,637 20608 DEBUG [-] Ansible hosts: [linux]
192.168.10.129 ansible_ssh_user=root ansible_ssh_pass=root123. ansible_ssh_port=22 ansible_ssh_private_key_file=

2022-01-14 10:54:53,637 20608 INFO [-] Running ansible command...
2022-01-14 10:54:53,675 20608 ERROR [-] Host 192.168.10.129 check failed due to:
2022-01-14 10:54:53,675 20608 ERROR [-] init() got an unexpected keyword argument 'options'
Traceback (most recent call last):
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/collector/collector.py", line 149, in collect_hosts
c.collect()
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/collector/hosts/linux.py", line 42, in collect
host_info = self._collect_data()
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/collector/hosts/linux.py", line 147, in _collect_data
return ansible_api.run_task()
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/ansible_api.py", line 141, in run_task
run_tree=False
TypeError: init() got an unexpected keyword argument 'options'
2022-01-14 10:54:53,683 20608 INFO [-] Saving collection report to /tmp/hosts_collection/collection_report.csv
2022-01-14 10:54:53,684 20608 INFO [-] Saved collection report to /tmp/hosts_collection/collection_report.csv
2022-01-14 10:54:53,685 20608 DEBUG [-] Current row is: {'hostname': 'host-192-168-10-132.openstacklocal', 'ip': '192.168.10.132', 'username': 'root', 'password': '', 'ssh_port': 22, 'key_path': '', 'mac': 'fa:16:3e:ef:ac:e8','vendor': '', 'check_status': 'check', 'os': 'Linux', 'version': 'Linux 2.6.32 - 3.9', 'tcp_ports': '22,3260', 'do_status': ''}
2022-01-14 10:54:53,685 20608 DEBUG [-] Current host check status is check, do status is , force check is False
2022-01-14 10:54:53,686 20608 WARNING [-] Skip to collect 192.168.10.132 information due to password or key is not given.
2022-01-14 10:54:53,686 20608 DEBUG [-] Current row is: {'hostname': 'host-192-168-10-133.openstacklocal', 'ip': '192.168.10.133', 'username': 'root', 'password': '', 'ssh_port': 22, 'key_path': '', 'mac': 'fa:16:3e:ea:6c:71','vendor': '', 'check_status': 'check', 'os': 'Linux', 'version': 'Linux 2.6.32 - 3.9', 'tcp_ports': '22,111,3306,8086,10082,15000,16000', 'do_status': ''}
2022-01-14 10:54:53,687 20608 DEBUG [-] Current host check status is check, do status is , force check is False
2022-01-14 10:54:53,687 20608 WARNING [-] Skip to collect 192.168.10.133 information due to password or key is not given.
2022-01-14 10:54:53,687 20608 DEBUG [-] Current row is: {'hostname': 'host-192-168-10-135.openstacklocal', 'ip': '192.168.10.135', 'username': 'root', 'password': '', 'ssh_port': 22, 'key_path': '', 'mac': 'fa:16:3e:68:a5:c6','vendor': '', 'check_status': 'check', 'os': 'Linux', 'version': 'Linux 2.6.32 - 3.6', 'tcp_ports': '22,3260', 'do_status': ''}
2022-01-14 10:54:53,688 20608 DEBUG [-] Current host check status is check, do status is , force check is False
2022-01-14 10:54:53,688 20608 WARNING [-] Skip to collect 192.168.10.135 information due to password or key is not given.
2022-01-14 10:54:53,688 20608 INFO [-] ===========Summary==========
2022-01-14 10:54:53,688 20608 INFO [-] Need to check 1 host(s), success 0 hosts, failed 1 hosts.
2022-01-14 10:54:53,688 20608 INFO [-] Failed hosts: ['[LINUX]192.168.10.129']
2022-01-14 10:54:53,689 20608 INFO [-] ============================

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

1 participant