But should also work with newer versions as long as the output of 'pri show spans' and 'dahdi_scan' is consistent. I tested with icinga2 only. However, it should also work with Nagios and its forks beside icinga.

Software & Hardware Requirements

python, asterisk, libpri, DAHDI, and of course PCI cards

Usage

You will need to run these plugins remotely on your PBX eithr with ICINGA2 client or NRPE installed.
I had to change the permissions on the following Run-Control files to avoid "NRPE: Unable to read output" error:
* chmod 775 /var/run/asterisk/asterisk.ctl
* chmod 666 /dev/dahdi/ctl
These file are not present so you will need to type the full path to see the permissions on these files.
* ls -alh /var/run/asterisk/asterisk.ctl /dev/dahdi/ctl
Here is the NRPE config from /etc/nagios/nrpe.cfg for these checks:
command[check_asterisk_dahdi]=HOME=~nagios /usr/lib/nagios/plugins/check_asterisk_dahdi.py
command[check_asterisk_pri]=HOME=~nagios /usr/lib/nagios/plugins/check_asterisk_pri.py
You may also need to add these to your /etc/sudoers:
nagios ALL=(root) NOPASSWD:/usr/sbin/asterisk -x pri show spans
nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/
nagios ALL=(root) NOPASSWD:/usr/sbin/dahdi_scan
Defaults:nagios !requiretty
Finally, you may also want the NRPE user (nagios) to asterisk group if you have issues.