Oct
27
27
I have just uploaded a modified script to the Munin Exchange web site to allow Munin to monitor the number of online and offline SIP Peers.
I hope you find it useful.
I have just uploaded a modified script to the Munin Exchange web site to allow Munin to monitor the number of online and offline SIP Peers.
I hope you find it useful.
Dear Paul.
Thank you for your writing a profitable script.
However, only 0 always returns the value though I executed this script.
Are some settings necessary?
Best Regards.
kenichi fukaumi
Hi,
You should see something like this:
paul@server1:/etc/munin/plugins$ ./asterisk_sippeerspeers_online.value 4
peers_offline.value 0
unmon_online.value 2
unmon_offline.value 3
The difference between the monitored and unmonitored is the qualify=yes/no setting of the peer.
The script uses the output of
asterisk -rx "sip show peers"What result do you get from this command?
Does this help? If not, please let me know the command and result that you are getting.
Hi, Paul
Thank you for you reply.
This is my result of asterisk -rx “sip show peers”
Name/username Host Dyn Nat ACL Port Status
VoipBuster/******* ***.***.***.*** N 5060 OK (839 ms)
from-didww5 ***.***.***.*** 5060 Unmonitored
Brastel/**** ***.***.***.*** 5060 OK (123 ms)
5***/**** (Unspecified) D N A 0 UNKNOWN
5***/**** (Unspecified) D N A 0 UNKNOWN
2***/**** (Unspecified) D N A 0 UNKNOWN
6 sip peers [Monitored: 2 online, 3 offline Unmonitored: 1 online, 0 offline]
Best Regards.
kenichi fukaumi
When I put your output through the script, I get the following:
paul@server1:~$ ./asterisk_sippeers_testpeers_online.value 2
peers_offline.value 3
unmon_online.value 1
unmon_offline.value 0
This is the result I would expect. Can you please run the
asterisk_sippeersscript and provide the output?Hi, Paul.
Thank you for your quick reply.
▽test 1 -> NG
server# munin-run asterisk_sippeers
peers_online.value 0
peers_offline.value 0
unmon_online.value 0
unmon_offline.value 0
▽test 2 -> OK
server# /usr/share/munin/plugins/asterisk_sippeers
peers_online.value 2
peers_offline.value 3
unmon_online.value 1
unmon_offline.value 0
Best Regards.
kenichi fukaumi
Running via munin-run works for me. As the script works for you when you run it directly, this suggests a problem with the config of munin-node.
Have you created the symbolic link from the file in /usr/share/munin/plugins/asterisk_sippeers to your config directory and then restarted munin-node?
For me, it is:
cd /etc/munin/pluginssudo ln -s /usr/share/munin/plugins/asterisk_sippeers .
sudo /etc/init.d/munin-node restart
Regards,
Paul
Please also check permissions. It could be that your munin user is not permitted to run the
asteriskcommand.I have the following in my
/etc/munin/plugin-conf.d/munin-nodefile:[asterisk*]user asterisk
Hi,Paul
I fixed it add follow lines !!!!
[asterisk*]
user asterisk
Thank you for all of your support !
Best Regards.
kenichi fukaumi