Icinga2 integration with pagerduty(go-pdagent)

Hi,

The previous bash script was using

/usr/local/bin/pdagent enqueue -k "$AUTH_KEY" service -t trigger -d "this is test "

This new version is using

RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -d "$PAYLOAD" "https://events.pagerduty.com/v2/enqueue")

Is there a reason for the change?

Did you successfully test the curl command from the command line for both problem and recovery?

In my previous post, I was asking you to paste here the full script and the results of a run. I meant a run from the command line, not from Icinga. So can you please paste here:

  1. The full script
  2. All outputs of a run from the command line for a PROBLEM
  3. All outputs of a run from the command line for a RECOVERY

ā€œall outputsā€ meaning: command line being entered, console output, log file (if any), return code,ā€¦

Best regards,

Jean

Hi Usmanpasha26,

I have spent quite some time in trying to help you - could you please give some feedback on your progress?

Thank you,

Jean

Hi @jeanm ,
sorry for delay responseā€¦
its working now with the script that i created and it sending both trigger and resolve to pagerdutyā€¦
thanks for all your help , without you it wont be possible.

Hi @Usmanpasha26,

Thanks a lot for the feedback! I am glad you finally got it working!

Best regards,

Jean

Hi Jean ,
just i concern i have ,
is there a way to combine multiple alert and send it as a single alert to pagerduty,
for example if we have ddos and multiple sites are down , it should give a single alert to pagerduty .

Reagrds,
Usman

You can use dependency modeling and the business process module to suppress or bundle.

More complex logic like queues and rate limiting, you need to build into your script.

hi ,
just one more question , the icinga keeps on sending the alert to pagerduty again and again despite of the same alert is not yet resolved in pagerduty. is there any metric to set that it should not repeatedly send the same alert again and againā€¦

thanks

I donā€™t thinks so, out of the box but you could set a pagerduty URL as service variable via Icinga2 REST API and in your notification script you could suppress alerts if this present.

This would maybe also allow you to build custom navigation in Icingaweb2 to deep link into pagerduty - if pagerduty has clean URLs.

Hi , can we have all the 4 master viewed in one dashboard, if yes , please help ?

thanks,

Usman

Hi Usman,

Is this still related to pagerduty?

If not, please open a new Thread.

Hi ,
want to know is there any work around for
UNKNOWN notifications ignore retry_interval and max_check_attempts, when it changes to critical.
when an unknown state is changed to critical it does not does any attempts or interval , it straight away sends notification to the pagerduty .

Regards,
Usman

Hi,
any update on this ?