QUESTION Monitoring Asterisk with Zabbix

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
70
Hi,

I have installed zabbix directly on PIAF, I know it's not really how it would be in a real zabbix setup but I didn't want to expose zabbix externally and whitelist just yet, it's a proof of concept. It's a self-monitoring PBX for now.

With that said I was wondering if any of you is using Zabbix to monitor asterisk? If you do, would you be willing to share your userparameters from your agent config file? I found a couple of them in zabbix asterisk cookbook but maybe some of you have added your own? We could accumulate and share a list of checks people could pick and choose from.

For now I use active checks with userparameters in the agent, but if you have scripts that send stuff to zabbix or any other custom stuff, we could put it in common.

If nobody has messed with that yet, I will continue to search online and consolidate what I find.

So far I have taken from the zabbix forum:
Code:
UserParameter=ast.pid,sudo -u zabbix sudo cat /var/run/asterisk/asterisk.pid
UserParameter=ast.uptime,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'core show uptime' | grep uptime | cut -f2 -d: | sed 's/ //g'
UserParameter=ast.reloadtime,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'core show uptime' | grep reload | cut -f2 -d: | sed 's/ //g'
UserParameter=ast.version,sudo -u zabbix sudo /usr/sbin/asterisk -V | cut -f2 -d' '
 
# Core Stats
# INFO: Active Calls is Buggy yet.
UserParameter=ast.callsdone,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'core show calls'| grep -i 'processed' | awk '{print $1}'
 
# IAX2 Stats
 
UserParameter=iax.status,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'iax2 show registry'|grep Registered |wc -l
UserParameter=iax.channels,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'iax2 show channels'|grep --text -i 'active IAX channel'|awk '{print $1}'
 
# SIP Stats
 
UserParameter=sip.status,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'sip show registry'|grep Registered |wc -l
UserParameter=sip.peersonline,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'sip show peers'|grep --text -i 'sip peers'|awk '{print $5}'
UserParameter=sip.peersoffline,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'sip show peers'|grep --text -i 'sip peers'|awk '{print $7}'
UserParameter=sip.peers,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'sip show peers'|grep --text -i 'sip peers'|awk '{print $1}'
 
 
# DNS Manager
 
UserParameter=dns.status,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'dnsmgr status' | grep 'DNS Manager' | awk '{print $NF}'
UserParameter=dns.entries,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'dnsmgr status' | grep 'Number of entries' | awk '{print $NF}'
 
 
# FAX Stats
 
UserParameter=fax.sessions,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'fax show stats' | grep 'Current Sessions' | awk '{print $NF}'
UserParameter=fax.transmits,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'fax show stats' | grep 'Transmit Attempts' | awk '{print $NF}'
UserParameter=fax.receive,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'fax show stats' | grep 'Receive Attempts' | awk '{print $NF}'
UserParameter=fax.done,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'fax show stats' | grep 'Completed' | awk '{print $NF}'
UserParameter=fax.fail,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'fax show stats' | grep 'Failed' | awk '{print $NF}'
 
# Parked Calls
 
UserParameter=ast.parkedcalls,sudo -u zabbix sudo /usr/sbin/asterisk -rvvvvvx 'parkedcalls show' | grep 'parked calls in total' | awk '{print $1}'

Trying to build as many useful data points and triggers/alarms as I can.
 

Attachments

  • zab.png
    zab.png
    18.1 KB · Views: 12
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top