For reference, here are the scripts finalised:
Host alerts:
#!/bin/bash
# FreshService Host Notification
curl -X POST -H "Authorization: auth-key <key>" -H "Content-Type: application/json" --data "{\"metric_name\": \"Availability\", \"hostname\": \"$NOTIFY_HOSTALIAS\", \"message\": \"$NOTIFY_WHAT - $NOTIFY_HOSTALIAS is $NOTIFY_HOSTSTATE\", \"ip_address\": \"$NOTIFY_HOSTADDRESS\", \"severity\": \"$NOTIFY_HOSTSTATE\", \"event_id\": \"$NOTIFY_NOTIFICATIONTYPE\", \"output\": \"$NOTIFY_HOSTOUTPUT\", \"perf_data\": \"$NOTIFY_HOSTOUTPUT\", \"action_url\": \"http://cmk.ctshirts.co.uk/ctshirts$NOTIFY_HOSTURL\", \"check_command\": \"$NOTIFY_HOSTCHECKCOMMAND\", \"problem_id\": \"$NOTIFY_HOSTPROBLEMID\" , \"long_datetime\": \"$NOTIFY_LONGDATETIME\", \"notification_comment\": \"$NOTIFY_HOSTOUTPUT\", \"notification_type\": \"$NOTIFY_NOTIFICATIONTYPE\", \"contact_name\": \"$NOTIFY_CONTACTNAME\" }" <api-url>
Service alerts:
#!/bin/bash
# FreshService Service Notification
curl -X POST -H "Authorization: auth-key <key>" -H "Content-Type: application/json" --data "{\"metric_name\": \"$NOTIFY_SERVICEDESC\", \"hostname\": \"$NOTIFY_HOSTALIAS\", \"message\": \"$NOTIFY_WHAT - $NOTIFY_HOSTALIAS - $NOTIFY_SERVICEDESC\", \"description\": \"$NOTIFY_SERVICEDISPLAYNAME\", \"ip_address\": \"$NOTIFY_HOSTADDRESS\", \"severity\": \"$NOTIFY_SERVICESTATE\", \"event_id\": \"$NOTIFY_HOSTPROBLEMID\", \"output\": \"$NOTIFY_SERVICEOUTPUT\", \"perf_data\": \"$NOTIFY_SERVICEOUTPUT\", \"action_url\": \"http://cmk.ctshirts.co.uk/ctshirts$NOTIFY_HOSTURL\", \"check_command\": \"$NOTIFY_HOSTCHECKCOMMAND\", \"problem_id\": \"$NOTIFY_SERVICEPROBLEMID\" , \"long_datetime\": \"$NOTIFY_LONGDATETIME\", \"notification_comment\": \"$NOTIFY_SERVICEOUTPUT\", \"notification_type\": \"$NOTIFY_NOTIFICATIONTYPE\", \"notification_url\": \"http://cmk.ctshirts.co.uk/ctshirts$NOTIFY_SERVICEURL\", \"contact_name\": \"$NOTIFY_CONTACTNAME\" }" <api-url>
Replace the text in <> with your API key and POST URL.
Its not perfect - e.g. some variables were used twice. I think with additional tweaking and customising the FreshService monitoring tool plugin properly this could be refined more.
I will keep refining it and eventually package this into an MKP for the exchange. I need to figure out how to make the API key and URL a text box on the notification rule first! Need to brush off my Python.