I’m using a shell command
gl_inet_token: curl 172.16.68.47/cgi-bin/api/router/login -d "pwd=MYPASS" > mdata/token.json
This works and puts the output into mdata/token.json which I then process with a file sensor. I’m not sure if a file sensor is the best method, but it kind of works.
But first I want to address the issue of hard-coding the password. I’ve also tried this (where I put the password into an input_string):
gl_inet_token: curl 172.16.68.47/cgi-bin/api/router/login -d "pwd={{states.input_text.gl_inet_password.state}}" > mdata/token.json
This doesn’t work (or at least the file isn’t created).
Is there a better way to execute a CURL command and pass in a template value? and capture the results in an input_string or file?