How figure it out when a task will finish?

hi i am starting to work with python-gvm and i creat a task and start it so get this response :
<start_task_response status="202" status_text="OK, request submitted">\n <report_id>0</report_id>\n</start_task_response>

can anybody help me how to figure it out when a task will finish and i can see the result of scanning a target ?
thanks for your helping

You could set an alert which can notify you when the specific scan task has completed.

1 Like

I can also add to this answer. Going forward with the new openvas-scanner HTTP Restful scanner API, you can check the status of a scan task directly.

Here is a link to the new API swagger definition, and particularly the task status endpoint.

However, this is only available in the newest version openvas-scanner which was just released.

1 Like

I wouldn’t do that because that only means the scan is finished. It doesn’t mean that all results have been consumed by gvmd and are available via GMP.

There are two possibilities. Get notified via an alert or poll the task status via gmp.get_task. The UI also uses polling.

3 Likes

i made confused, do you mean the “status” in the Response of the Get_task has especify that the task and its results has completed? or i should always set an alert ? im so thankful if you solve my problem thnk.