post curl to rest interface using a shell script -
i try create script send messages nagios servers rest api in json.
i try this:
/usr/bin/curl \ --header "content-type: application/json" \ --request post \ --data '{"u_id": "$notify_serviceproblemid", "u_date_time" : "$notify_shortdatetime", \ "u_state" : "$notify_serviceshortstate", "u_host" : "$notify_hostname", "u_address" : "$notify_hostaddress", \ "u_description" : "$notify_hostalias/$notify_servicedesc $notify_servicestate"}' \ https://my-rest_api
but not working.. variables start $notify should expand.
i wondering should end single quotes since single quotes must part of json being sent rest api.
thank you
Comments
Post a Comment