Telegram- 👇 😉
-
. WIKIMERIONET
Merion Mertics , ,

CRM

2

, . - :

[root@asterisk ~]# touch chektrank.sh

nano :

[root@asterisk ~]# nano chektrank.sh

:

#!/bin/bash

#  

ALLTRUNKSMINIMUM=\"`/usr/sbin/asterisk -rx \"sip show registry\"`\" #   

ALLTRUNKS=`echo \"$ALLTRUNKSMINIMUM\" |grep \"SIP registrations\" |awk \'{print $1}\'` #      

REGTRUNKS=`/usr/sbin/asterisk -rx \"sip show registry\" |grep Registered |wc -l` #    (    Registered)

#  

if [ \"$REGTRUNKS\" -lt \"$ALLTRUNKS\" ]; then #       (         Registered) 

sleep 5 #  5 

echo `/usr/sbin/asterisk -rx \"sip reload\"` #  sip reload

sleep 5 #  5 

VAR=`/usr/sbin/asterisk -rx \"sip show registry\"` #     

#          

echo \"$VAR\" | mail -s \" \" your@mail.ru

#    (..     )

else

echo ALL STATUS OK #             

fi

cron:

[root@asterisk ~]# crontab -e

λ . :

0 /120 * * * /bin/bash /root/chektrank.sh

esc :wq. verbose :)