Log That Tracks Which Deices are Offline

How would I setup a log that only logs when a device goes offline and comes back online?
Basically the equivalent of what is displayed by the “users online” in the graph, but I want to know which devices went offline.

Its pulled from asterisk CLI with sip show peers command

So is the graph just pulling that information on a regular interval and saving it to be graphed?

Yes, it just looks at the numbers, not the individual devices. Sorry!

it looks every minute and uses that command

Awesome thanks

A quick solution might be to add :-

tail -F /var/log/asterisk/full | while read LOGLINE; do [[ "${LOGLINE^^}" =~ "REACHABLE" ]] && echo ${LOGLINE} >> /your/log/file ; done &

to your /etc/rc.local file

1 Like