Unable to send a POST request to pagerduty after perl nagios integration

Followed the steps defined at https://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/ for nagios perl integration.

After the integration, when i run the command manually to test, I get error as below.

Command – “/usr/local/bin/pagerduty_nagios.pl enqueue -f pd_nagios_object=host -f CONTACTPAGER=xxxxxxxxxxxxxxxxxx -f NOTIFICATIONTYPE=PROBLEM -f HOSTNAME=test-f HOSTSTATE=DOWN”

Error:
==== Now processing: /tmp/pagerduty_nagios/pd_1582627259_5306.txt
Request:
POST https://events.pagerduty.com/nagios/2010-04-15/create_event
Content-Length: 142
Content-Type: application/x-www-form-urlencoded

NOTIFICATIONTYPE=PROBLEM&pd_nagios_object=host&HOSTNAME=test&HOSTSTATE=DOWN&CONTACTPAGER=xxxxxxxxxxxxxxxxxxxxxx&pd_version=1.0

HTTP/1.1 403 Forbidden
Connection: close
Date: Tue, 25 Feb 2020 10:48:51 GMT
Via: 1.1 outbound-proxy-aconex-svc-2vgvl (squid/3.5.20)
Server: squid/3.5.20
Vary: Accept-Language
Content-Language: en
Content-Length: 3780
Content-Type: text/html;charset=utf-8
Client-Date: Tue, 25 Feb 2020 10:48:51 GMT
Client-Peer: 100.122.xx.xx:xxxx
Client-Response-Num: 1
Mime-Version: 1.0
Title: ERROR: The requested URL could not be retrieved
X-Cache: MISS from outbound-proxy-aconex-svc-2vgvl
X-Cache-Lookup: NONE from outbound-proxy-aconex-svc-2vgvl:3133
X-Squid-Error: ERR_ACCESS_DENIED 0

Can someone help on this issue? Is it a issue with the proxy or some thing wrong with the configuration?

Hi Ramesh! Can you confirm if the pagerduty_nagios.pl script is readable and executable?

Welcome @Rameshnalla!

From the looks of it, the 403 is indeed issued by a the server between Nagios and PagerDuty. Most of those headers are specific to Squid (a HTTP proxy) and are not issued by the PagerDuty Events API.

I’m guessing by the header X-Squid-Error: ERR_ACCESS_DENIED 0 that the proxy has not been configured to allow the Nagios host to access the Events API. The administrator of that service/network may be able to help you out here.

It is executable

Hello @Rameshnalla,

Just wanting to clarify if the response by @demitri?

Welcome @Rameshnalla!

From the looks of it, the 403 is indeed issued by a the server between Nagios and PagerDuty. Most of those headers are specific to Squid (a HTTP proxy) and are not issued by the PagerDuty Events API.

I’m guessing by the header X-Squid-Error: ERR_ACCESS_DENIED 0 that the proxy has not been configured to allow the Nagios host to access the Events API. The administrator of that service/network may be able to help you out here.

Thank you.