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.
--
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.
Floimair Florian
2017-Jun-29 07:24 UTC
[asterisk-users] 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.
?
?
With best regards
Florian Floimair
COMMEND INTERNATIONAL GMBH
http://www.commend.com
Security and Communication by Commend
FN 178618z | LG Salzburg
-----Urspr?ngliche Nachricht-----
Von: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces
at lists.digium.com] Im Auftrag von Antony Stone
Gesendet: Mittwoch, 28. Juni 2017 12:59
An: asterisk-users at lists.digium.com
Betreff: [asterisk-users] PJSIP list of peers online/offline?
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.
--
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.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by
https://linkprotect.cudasvc.com/url?a=http://www.api-digital.com&c=E,1,qLqu-5o6figiWLM--g8os87LkUGeDNP10U1PZ9AcHCdxpPfolVS1TIpyvjje_lGsVSylPENMEZOlqFJcfpfJ9i5N3qhrkw5_qnRyWOEBeFrVvQ,,&typo=1
--
Check out the new Asterisk community forum at: https://community.asterisk.org/
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
https://linkprotect.cudasvc.com/url?a=http://lists.digium.com/mailman/listinfo/asterisk-users&c=E,1,hnO0US2fleV36DGE9cMn7pFY0mbQF-GmabZg5DJbSPB7f5jH_zIySFyDBwL75JrqJwifVHjHZOjKtgB9weh50LUUUeI4CNAZmAkk4uAeBdxJIms,&typo=1