root / plugins / voip / zapchans @ c5ab6538
Historique | Voir | Annoter | Télécharger (1,37 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
# -*- sh -*- |
| 3 |
# |
| 4 |
# Plugin to monitor voip statistics. |
| 5 |
# |
| 6 |
# Parameters: |
| 7 |
# |
| 8 |
# config (required) |
| 9 |
# autoconf (optional - only used by munin-config) |
| 10 |
# |
| 11 |
# Bugs: |
| 12 |
# At least one SuSE netstat appears to report |
| 13 |
# "passive connections rejected because of time stamp" |
| 14 |
# We have never seen that, patch requested. |
| 15 |
# |
| 16 |
# Magic markers (optional - used by munin-config and some installation |
| 17 |
# scripts): |
| 18 |
#%# family=auto |
| 19 |
#%# capabilities=autoconf |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
if [ "$1" = "autoconf" ]; then |
| 24 |
echo yes |
| 25 |
exit 0 |
| 26 |
fi |
| 27 |
|
| 28 |
if [ "$1" = "config" ]; then |
| 29 |
|
| 30 |
echo 'graph_title PRI channels in use' |
| 31 |
|
| 32 |
# Most T1s have 23 channels, with one control channel. If you have more than |
| 33 |
# one T1, increase the limit here appropriately |
| 34 |
echo 'graph_args --upper-limit 22 -l 0' |
| 35 |
echo 'graph_scale no' |
| 36 |
echo 'graph_vlabel active connections' |
| 37 |
echo 'graph_category VOIP' |
| 38 |
echo 'graph_period second' |
| 39 |
echo 'graph_info This graph shows the number of PRI lines in use.' |
| 40 |
echo 'calls.label calls' |
| 41 |
echo 'calls.min 0' |
| 42 |
echo 'calls.info The number of calls per second.' |
| 43 |
exit 0 |
| 44 |
fi |
| 45 |
|
| 46 |
# it would be wise to put the following in a separate shell script that runs as root in |
| 47 |
# cron, and dumps its output to a separate file for this plugin to read later on. Letting |
| 48 |
# Munin plugins run as root is a security hole. |
| 49 |
|
| 50 |
zap=`asterisk -rx 'zap show channels' |grep -v "[[:digit:]]*[[:space:]] local" |grep -vc "Chan Extension"` |
| 51 |
|
| 52 |
echo "calls.value $zap" |
