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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -