[App_rpt-users] Show link topology from cli?

k5tra k5tra at austin.rr.com
Mon Nov 17 06:37:51 UTC 2014


I'll share a couple of shell scripts that I use from CLI to monitor what's
connected and the key/unkey status or all connected nodes.

The main function is monitor.sh:

 

#! /bin/bash

if [ -e /var/run/asterisk.ctl ]

then

                clear

                echo "Type CTL-C to exit"

                echo ""

                KEY=`/usr/local/sbin/vars29521.sh | grep --color=always TK`

                UNKEY=`/usr/local/sbin/vars29521.sh | grep --color=always
TU`

                if [ -n $KEY ] 

                then

                                echo $KEY

                fi

                if [ -z $KEY ]

                then

                                echo $UNKEY

        fi

                count=1

                until [ $count = "10000" ]

                do

                                ##  echo "Argument number $count"

                        count=`expr $count + 1`

                                TMP1=`/usr/local/sbin/vars29521.sh | grep
RPT_ALINKS`

                                TMP2=`/usr/local/sbin/vars29521.sh | grep
RPT_ALINKS`

                                while [ $TMP1 == $TMP2 ]

                                do

 
TMP1=`/usr/local/sbin/vars29521.sh | grep RPT_ALINKS`

                                done

                                clear

                        echo "Type CTL-C to exit"

                                echo ""

                                KEY=`/usr/local/sbin/vars29521.sh | grep
--color=always TK`

                                UNKEY=`/usr/local/sbin/vars29521.sh | grep
--color=always TU`

                                if [ -n $KEY ] 

                                then

                                                echo $KEY

                                fi

                                if [ -z $KEY ]

                                then

                                                echo $UNKEY

                        fi

                done     

                echo ""

                echo ""

else

                echo "Asterisk is not running!"

fi

 

The scipt that is called internally is vars29521.sh:

 

#! /bin/bash

if [ -e /var/run/asterisk.ctl ]

then

                asterisk -rx "rpt showvars 29521"

                echo ""

else

                echo "Asterisk is not running!"

fi

 

 

You will have to replace 29521 with your node number of course.

 

Tom / K5TRA

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20141117/ea4b1dbd/attachment.html>


More information about the App_rpt-users mailing list