roldaojr / zabbix_lldp_map

Criar mapa no zabbix a partir dos dados de LLDP
1 stars 1 forks source link

"dot" with args ['-Tpng', '/tmp/tmp20yg4hj7'] returned code: 1 #7

Open wildarp opened 3 years ago

wildarp commented 3 years ago

Have this problem python 3.7

`Connecting to zabbix Getting zabbix hosts from group MES3124F Getting data from hosts Getting data from hosts "dot" with args ['-Tpng', '/tmp/tmp20yg4hj7'] returned code: 1

stdout, stderr: b'' b"Error: /tmp/tmp20yg4hj7: syntax error in line 5 near ','\n"

Traceback (most recent call last): File "./zabbix_lldp_map.py", line 233, in graph.write_png(get_config('graphviz.imagefile')) File "/usr/lib/python3/dist-packages/pydot.py", line 1734, in new_method encoding=encoding) File "/usr/lib/python3/dist-packages/pydot.py", line 1817, in write s = self.create(prog, format, encoding=encoding) File "/usr/lib/python3/dist-packages/pydot.py", line 1945, in create assert process.returncode == 0, process.returncode AssertionError: 1 `

Faraday13 commented 2 years ago

Hi. I have this problem too. Python 3.9.5 Connecting to zabbix Getting zabbix hosts from group autodiscovered_test Getting data from hosts Getting data from hosts "dot" with args ['-Tpng', '/tmp/tmpx5hbk_44'] returned code: 1

stdout, stderr: b'' b"Error: /tmp/tmpx5hbk_44: syntax error in line 5 near ','\n"

Traceback (most recent call last): File "/etc/zabbix/zabbix-scripts/zabbix_lldp_map-master/zabbix_lldp_map.py", line 232, in graph.write_png(get_config('graphviz.imagefile')) File "/etc/zabbix/zabbix-scripts/env/lib/python3.9/site-packages/pydot.py", line 1743, in new_method self.write( File "/etc/zabbix/zabbix-scripts/env/lib/python3.9/site-packages/pydot.py", line 1828, in write s = self.create(prog, format, encoding=encoding) File "/etc/zabbix/zabbix-scripts/env/lib/python3.9/site-packages/pydot.py", line 1956, in create assert process.returncode == 0, ( AssertionError: "dot" with args ['-Tpng', '/tmp/tmpx5hbk_44'] returned code: 1

rollby commented 1 year ago

I also had the problem, and after analyzing the code, the error was caused by incorrect formatting when generating the dot code. You can print out the value of the variable 'graph' and paste it into this URL(http://dreampuf.github.io/GraphvizOnline) to verify that the generated dot code is correct, If the format is wrong, you'll see that the error output is the same as your stderr output. image

The location of the code causing the error is on line 127, the program will take the host's type inventory field and look for the icon file from the current folder based on the mapping relationship in the configuration file, so you need to check whether the type field of the host is filled in. image