Consider alive issue

Hi all,

I am using python-gvm in order to create my targets via script.
Until now I used code:
alive = gvm.protocols.gmpv208.AliveTest(‘Consider Alive’)
comment = f"Created: {time.strftime(‘%Y/%m/%d-%H:%M:%S’)}"
response = gmp.create_target(name=host_name, comment=comment, hosts=host_ip, port_range=ports, alive_test=alive)

But now, in a fresh installation of GVM, I get error:
module ‘gvm.protocols’ has no attribute ‘gmpv208’

I also tried “gmpv224” and “gmpv225” and these attributes could not be found either.
Could you please help me on which attribute to use?

Thank you,
Ioannis

The python-gvm usage guide provides a clear description of how to import the GMP protocols module and get a connection. Does this not work for you?

1 Like

Hi rippledj,

I used this guide and found my supported gmpv version, it is 22.5:
<get_version_response status=“200” status_text=“OK”>22.5</get_version_response>

But still, if I use code:
alive = gvm.protocols.gmpv225.AliveTest(‘Consider Alive’)
I get error:
AttributeError: module ‘gvm.protocols’ has no attribute ‘gmpv225’

and I already import library:
from gvm.protocols.gmp import Gmp

Can you understand what I am doing wrong?