Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all articles
Browse latest Browse all 227779

Run a cron job to get the user agent list and send an email alert

$
0
0

That looks familiar :slight_smile:

if you don’t have mail then install mailutils . cron uses /bin/sh whose echo can’t do -ne so a bash script would look much like

#!/usr/env/ bash
for ext in $(/usr/sbin/rasterisk -x 'sip show peers'|egrep "^[0-9]*/[0-9]*.*OK"|sed 's/^\([0-9]*\).*/\1/')
do echo -ne "$ext\t";/usr/sbin/rasterisk -x "sip show peer $ext"|grep Useragent|cut -d ":" -f2
done|mail -s "my Stuff" faisal@khan.com

and the cronjob as root
0 0 * * * /path/to/your/script.sh


Viewing all articles
Browse latest Browse all 227779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>