Search code examples
zabbix

Zabbix 3.0 with PagerDuty not working


I have configured an Ubuntu 14.04 server on Digital Ocean with Zabbix 3.0 server. I'm now trying to integrate the PagerDuty service (www.pagerduty.com) on Zabbix. I installed the PagerDuty zabbix agent and can trigger an incident with that agent form the CLI on Ubuntu. However when there is a trigger in Zabbix the PagerDuty agent is not sending the incidents to PagerDuty. However I can see that Zabbix sent the PagerDuty alert, but apparently there is something broken.

Where do I start to debug this issue?


Solution

  • I'm assuming you followed the PagerDuty instructions for Zabbix 2.x

    1. Make sure pd-zabbix is located where Zabbix can find it, I think Zabbix 2 was looking for it at /etc/zabbix/alerts.d while Zabbix 3 seems to be looking in /usr/lib/zabbix/alertscripts

    2. Then make sure zabbix is calling pd-zabbix properly, to debug that I created a script that just logs command line arguments and stdin to a file:

    #!/usr/bin/env python
    
    from __future__ import print_function
    import sys
    
    with open('/tmp/pd-zabbix.log', 'a+') as f:
        print("args:", sys.argv, file=f)
        print(sys.stdin.read(), file=f)
        print("-----", file=f)
    

    And I've noticed that Zabbix 3.x doesn't pass any arguments. In Zabbix 3.x you can define exactly what it passed and the order. Go to Administration -> Media types -> click on the PagerDuty media you probably defined (the place where you selected type script and wrote pd-zabbix) and add the following argument (as 3 separate parameters)

    • {ALERT.SENDTO}
    • {ALERT.SUBJECT}
    • {ALERT.MESSAGE}

    Zabbix custom alert scripts

    Hope it helps.