Hi, i need to check that asterisk trunk is active. I need to make 30 sensors with different trunk names. I ended up with such ssh script:
#!/bin/bash
var1=$1
if [ "$var1" == OK ]
then
echo "0:200:running"
else
echo "2:404:UNREACHABLE"
fi
and i give this parameter to prtg "/usr/sbin/asterisk -rx "sip show peers" |grep 9859204943 |awk '{print $7}'| sed 2,2d"
What am i doing wrong?
if i making script like this:
#!/bin/bash
var1=$(/usr/sbin/asterisk -rx "sip show peers" |grep 9857617234 |awk '{print $7}'| sed 2,2d)
if [ "$var1" == OK ]
then
echo "0:200:running"
else
echo "2:404:UNREACHABLE"
fi
Everything is working fine, but in this case i need 30 different scripts, i need somehow to fill "Number" 9857617234 in the sensor parameters.
Add comment