python-gvm: gvm.errors.GvmError: Could not connect to socket /tmp/storage/gvm/gvmd/gvmd.sock #274
Replies: 5 comments 7 replies
-
@flyingbot91 what is the output of |
Beta Was this translation helpful? Give feedback.
-
Additionally the `/var/log/gvm/gvmd.log` please.
Von meinem iPhone gesendet
… Am 14.09.2021 um 00:14 schrieb Austin Songer ***@***.***>:
@flyingbot91 what is the output of /var/log/gvm/gmvd.log,/var/log/supervisor/gmvd.log and /var/log/supervisor/gmvd_err.log ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Oops, I overlooked that you want to address the UnixSocket, these are not available, if you have to use them, it requires other steps. If the port of the GVMD is sufficient for you, you can release port 9390, but it should then only be released on the HOST under localhost (127.0.0.x). |
Beta Was this translation helpful? Give feedback.
-
For the example you have to use |
Beta Was this translation helpful? Give feedback.
-
If you not set the required up and port you will never get a connection 😉
Von meinem iPhone gesendet
… Am 14.09.2021 um 12:05 schrieb flyingbot91 ***@***.***>:
@Dexus Thank you for your answer.
During the past weeks I have been using the 21.4.0-v5 version with the UnixSocket and everything seemed to be working OK.
When I switched into 21.4.3-v2 (Alpine) things have started to fail (see first message).
I have spawned the container as before:
sudo docker run --detach --publish 8080:9392 --publish 5432:5432 --publish 2222:22 --env DB_PASSWORD="admin" --env PASSWORD="12345" --volume /tmp/storage/postgres-db:/opt/database --volume /tmp/storage/openvas-plugins:/var/lib/openvas/plugins --volume /tmp/storage/gvm:/var/lib/gvm --volume /tmp/storage/ssh:/etc/ssh --name gvm securecompliance/gvm
Following your advice, now the python scripts looks like this:
from gvm.connections import TLSConnection
from gvm.protocols.gmp import Gmp
from gvm.transforms import EtreeTransform
from gvm.xml import pretty_print
connection = TLSConnection()
transform = EtreeTransform()
with Gmp(connection, transform=transform) as gmp:
# Retrieve GMP version supported by the remote daemon
version = gmp.get_version()
# Prints the XML in beautiful form
pretty_print(version)
However, this is what I get:
$ python3 gvm_demo.py
Traceback (most recent call last):
File "gvm_demo.py", line 11, in <module>
with Gmp(connection, transform=transform) as gmp:
File "/home/hans/Escritorio/gvmd/env/lib/python3.8/site-packages/gvm/protocols/gmp.py", line 113, in __enter__
gmp = self.determine_supported_gmp()
File "/home/hans/Escritorio/gvmd/env/lib/python3.8/site-packages/gvm/protocols/gmp.py", line 98, in determine_supported_gmp
version = self.determine_remote_gmp_version()
File "/home/hans/Escritorio/gvmd/env/lib/python3.8/site-packages/gvm/protocols/gmp.py", line 81, in determine_remote_gmp_version
self.connect()
File "/home/hans/Escritorio/gvmd/env/lib/python3.8/site-packages/gvm/protocols/base.py", line 107, in connect
self._connection.connect()
File "/home/hans/Escritorio/gvmd/env/lib/python3.8/site-packages/gvm/connections.py", line 467, in connect
self._socket.connect((self.hostname, int(self.port)))
File "/usr/lib/python3.8/ssl.py", line 1342, in connect
self._real_connect(addr, False)
File "/usr/lib/python3.8/ssl.py", line 1329, in _real_connect
super().connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused
Any ideas?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I have downloaded the latest stable version (21.4.3-v2) and waited until the container has been set up (NVTS, roles, SCAP and CERT data, etc.).
After that I have tried to run a very simple python script in order to verify the python-gvm package.
This is what I get:
This is how I have downloaded the image:
Script used: (taken from here)
top command: (dockerized GVM)
Tools:
Host system
Thanks in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions