PJSIP List Of Peers Online/offline?

Home » Asterisk Users » PJSIP List Of Peers Online/offline?
Asterisk Users 1 Comment

Hi.

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
offline]

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,

Antony.

One thought on - PJSIP List Of Peers Online/offline?

  • You can try:

    pjsip show endpoints

    However, there is no summary line in the end (only the total number of objects) so you will have to parse the status of each entry yourself to get these statistics.