Creating tasks with gvm-tools does not work

gvm-9
gvm-tools
gmp

#1

I am trying to create a task using the terminal. So far I created a target successfully. When I am trying to create a task I do create an entity but it is a container instead a task.
I am using the following:

 gvm-cli tls --gmp-username admin --gmp-password admin --xml "<create_task><name>3000</name>
> <target target_id="714f2ad0-e345-4984-922d-54065f796ea2"></target><scanner id='08b69003-5fc2-4037-a479-93b440211c73'><name>OpenVAS Default</name><type>2</type></create_task>" --host 127.0.0.1

When the command is being executed I do not get a 200-ok but " Remote connection closed". I still get a container created but this is not what I want.

What could be the issue?:slight_smile:
Kind Regards,
Vanina


#2

I suppose it should be id and not target_id:

<target id="714f2ad0-e345-4984-922d-54065f796ea2"/>

Looking at the code it seems if the <target id="..."/> element is missing or it’s id value is 0 a container task is created.


#3

When choosing the category for a topic please try to have a look at the category description for each category first:

The current used category is/was https://community.greenbone.net/c/vulnerability-tests (Description: About the Vulnerability Tests category) which is about vulnerability tests (the so called “NASL scripts”).

Based on your questions it seems to be relevant to the use of the GMP API/Protocol where the https://community.greenbone.net/c/gmp (Description: About the Greenbone Management Protocol (GMP) category) is fitting.

I have moved the topic to the correct category for now.