I believe what is happening here is that the CGI script is encountering a JSON format that is not of the expected type, vis-à-vis that first error. The format of JSON that gets delivered by a webhook depends on the type of the webhook selected when creating it, i.e. Slack, Mattermost, v1 generic, v2 generic, etc.
For that matter, I believe the key to getting around this easily is selecting the “Nagios” type of webhook object and configuring it to deliver webhooks to the CGI script on your Nagios instance’s HTTP service.
I have concluded this because the CGI script depends on the property
trigger_summary_data of the webhook payload, which is present in generic v1 webhooks and the newer Nagios-style webhooks (which allows more secure storage of HTTP Basic Auth credentials, if applicable). However, it’s not present in many other types of webhooks. The uninitialized value errors are thus probably caused by the issue of that property being missing from the webhook message.
Hopefully that helps!