[asterisk-users] PJSIP list of peers online/offline?

Antony Stone Antony.Stone at asterisk.open.source.it
Wed Jun 28 05:58:38 CDT 2017


I have some Nagios / Icinga monitoring plugins I've created for Asterisk, and 
one of them checks the percentage of SIP accounts which are currently 
registered on an Asterisk server.

It does this by running "sip show peers" via AMI and analysing the summary 
line at the end:

1066 sip peers [Monitored: 747 online, 310 offline Unmonitored: 3 online, 6 

I then calculate 747 divided by (747+310) and report the % online (because I 
know I'm not interested in the unmonitored ones).

However, a customer has upgraded one of their servers from Asterisk 11 to 
Asterisk 13, and "sip show peers" no longer works.

I can see a whole list of commands starting with "pjsip" but there's no "pjsip 
show peers", so what's the new command which will tell me how many online and 
how many offline SIP peers there are?

Thanks in advance,


Never write it in Perl if you can do it in Awk.
Never do it in Awk if sed can handle it.
Never use sed when tr can do the job.
Never invoke tr when cat is sufficient.
Avoid using cat whenever possible.

                                                   Please reply to the list;
                                                         please *don't* CC me.

More information about the asterisk-users mailing list