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.

8 Responses to “Monitoring Asterisk Peers with Munin”

  1. 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

    November 3rd, 2009 | 10:58 pm
  2. Hi,

    You should see something like this:

    paul@server1:/etc/munin/plugins$ ./asterisk_sippeers
    peers_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.

    November 4th, 2009 | 8:36 am
  3. 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

    November 4th, 2009 | 10:39 am
  4. When I put your output through the script, I get the following:

    paul@server1:~$ ./asterisk_sippeers_test
    peers_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_sippeers script and provide the output?

    November 4th, 2009 | 11:26 am
  5. 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

    November 4th, 2009 | 11:40 am
  6. 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/plugins
    sudo ln -s /usr/share/munin/plugins/asterisk_sippeers .
    sudo /etc/init.d/munin-node restart

    Regards,

    Paul

    November 4th, 2009 | 11:47 am
  7. Please also check permissions. It could be that your munin user is not permitted to run the asterisk command.

    I have the following in my /etc/munin/plugin-conf.d/munin-node file:
    [asterisk*]
    user asterisk

    November 4th, 2009 | 12:02 pm
  8. Hi,Paul

    I fixed it add follow lines !!!!
    [asterisk*]
    user asterisk

    Thank you for all of your support !

    Best Regards.

    kenichi fukaumi

    November 4th, 2009 | 12:21 pm

Leave a Reply