Setting alive test to consider alive on target using gvm-cli

Hi, I’m having trouble trying to set a target’s alive test to consider alive (or any other custom value).

when sending:
gvm-cli --gmp-username <my_user> --gmp-password <my_pass> socket --socketpath $GVMD_SOCKET_PATH --xml “<create_target>Scan Hosts$hosts<alive_tests pattern=“Consider Alive”/></create_target>”
I’m getting:
<create_target_response status=“201” status_text=“OK, resource created” id=<some_uuid>/>

but when sending <get_targets/> request I’m getting:
<get_targets_response status=“200” status_text=“OK”>zoozscannerScan Hosts<creation_time>2019-12-19T10:28:17Z</creation_time><modification_time>2019-12-19T10:28:17Z</modification_time>1<in_use>0</in_use>Everything127.85.12.6<exclude_hosts></exclude_hosts><max_hosts>1</max_hosts><port_list id=“c7e03b6c-3bbe-11e1-a057-406186ea4fc5”>OpenVAS Default0</port_list><ssh_credential id="">00</ssh_credential><smb_credential id="">0</smb_credential><esxi_credential id="">0</esxi_credential><snmp_credential id="">0</snmp_credential><reverse_lookup_only>0</reverse_lookup_only><reverse_lookup_unify>0</reverse_lookup_unify><alive_tests>Scan Config Default</alive_tests>first=1 rows=1000 sort=namefirst=1rows=1000sort=namenameascending<target_count>111</target_count></get_targets_response>

meaning the alive test is still set to config default. (<alive_tests>Scan Config Default</alive_tests>)
this also happens when I’m trying other alive-test values (“ICMP Ping” … etc)

How can I create a target with different Alive Test using gvm-cli?

I’m using gvmd: v8.0.0 (compiled from source)
and latest gvm-cli from: pip3 install gvm-tools

Should be <create_target>...<alive_tests>Consider Alive</alive_tests>...</create_target>

4 Likes

Works perfectly. Thanks.