Hi everyone,
i got gvm20.08 running on ubuntu20.04.
iI wanted to create a target via gvm-cli with gvm-cli socket --xml "<create_target><name>check_mk</name><hosts>"x.x.x.x"</hosts></create_target>" , i get the error Socket /var/run/gvmd.sock does not exist
gvmd.sock does exist, but in /opt/gvm/var/run/gvmd.sock.
this may sound dumb, but how can i tell gvm to look in another path to get this running?
i tried to change the socketpath, now i am getting a Typeerror in my cli.py gvm-cli socket --socketpath /opt/gvm/var/run/gvmd.sock Traceback (most recent call last): File "/opt/gvm/.local/bin/gvm-cli", line 8, in <module> sys.exit(main()) File "/opt/gvm/.local/lib/python3.8/site-packages/gvmtools/cli.py", line 106, in main if len(xml) == 0: TypeError: object of type 'NoneType' has no len()
is there something else i have to consider?
I used gvm-tools “dependabot/add-v2-config-file”, hope this one is correct since master branches should not be used.
i still can figure out why the python file gives me TypeError: object of type 'NoneType' has no len() , when i try to change the socketpath.
For Python the standard way to install software is using pip. You have selected a branch created from a GitHub bot for updating some dependencies. As you can image you shouldn’t do that.
Every git repository has a README.md file that contains advises for the installation. If you are not a developer please always follow these advises. See https://github.com/greenbone/gvm-tools#installation for the gvm-tools installation.
i did a new clean install of gvm-tools like its in the README.md
unfortunately i get the same error in the same line.
I installed all the GVM configuration files and libraries under /opt/gvm, so maybe i need to do a new setup of gvm20.08 without setting different paths?
Hi,
so i did a new clean setup of gvm 20.08 and it works just fine. i can create targets and tasks and run scans via webgui, but still i cant create targets via cli.
it still says gvmd.sock does not exist, so i tried to change the socketpath like in the picture, but it drops the same error.
Requesting the version gives me <get_version_response status="200" status_text="OK"><version>20.08</version>/get_version_response> everythings good here.
If i try to create a target with the added xml command, it returns me : gvm-cli socket --socketpath /opt/gvm/var/run/gvmd.sock --xml "<create_target><name>check_mk</name><hosts>"149.201.14.25"</hosts></create_target>"
Response Error 400. Only command GET_VERSION is allowed before AUTHENTICATE
from this ouput i think i need to authenticate first with --gmp-username xy --gmp-password yx .
for example i tried gvm-cli --gmp-username xxyy --gmp-password yyxx socket --socketpath /opt/gvm/var/run/gvmd.sock --xml "<create_target><name>check_mk</name><hosts>"x.x.x.x"</hosts></create_target>"
which returned me the same error like above so the syntax must be completely wrong.
so i read the docs again and found this one gvm-cli --gmp-username webadmin --gmp-password kennwort ssh \ --hostname 192.168.222.115 \ --xml "<create_target><name>Suspect Host</name>\ <hosts>$IPADDRESS</hosts></create_target>"
but it gives me SSH connection failed . Even i think SSH is working i think i still need to give the correct socket, but if i do so the syntax is incorrect.