Folks,
Been using command line scripts for changes to basics, specifically IP address etc etc using wget formulations found around and about.
The API calls themselves are working and getting proper JSON responses and content but I'm not getting the Set-Cookie: zbx_session response headers anymore which is what I was parsing to get an authentication session.
Like I said the underlying API call is working I could parse the resulting JSON to get auth. sessionid, but would prefer to not change my approach as it is used in a number of places.
If I do the above calls manually I very clearly do not see the Set-Cookie header in the responses.
Thoughts
Been using command line scripts for changes to basics, specifically IP address etc etc using wget formulations found around and about.
The API calls themselves are working and getting proper JSON responses and content but I'm not getting the Set-Cookie: zbx_session response headers anymore which is what I was parsing to get an authentication session.
Code:
authenticate() {
$WGET -S -O/dev/null http://$ZABBIX_HOST/zabbix/api_jsonrpc.php --header 'Content-Type: application/json-rpc' --
post-data "{\"auth\":null,\"method\":\"user.authenticate\",\"id\":0,\"params\":{\"password\":\"$ZABBIX_PASS\",\"user\":\
"$ZABBIX_USER\"},\"jsonrpc\":\"2.0\"}" 2>&1 | $GREP -Eo 'Set-Cookie: zbx_sessionid=.+' | head -n 1 | cut -d '=' -f 2
}
If I do the above calls manually I very clearly do not see the Set-Cookie header in the responses.
Thoughts