Extension Monitoring?

Hello all,

Wondering if there’s a good way to monitor extensions. Everyone once in a while, one of our sites loses internet connectivity, or a phone goes offline for one reason or another, and it would be nice to be notified of and address the issue before someone tells me to. Has anyone out there put something in place for sending notifications from asterisk/FreePBX for when an extension goes unreachable for say, 30 seconds or longer?

I use Nagios for this. It’s challenging for extensions that don’t get static IP address, but it’s doable.

I don’t disagree with using monitoring software, personally I use check_mk for a general purview , but I would be intrigued to know how you specifically set up nagios to inform that an extension went unreachable, please elucidate . . .

An option would be to write a script that executes a command to asterisk, like ‘asterisk -rx “sip show peers”’ and then parse the output line by line looking for ‘Unreachable’. If ‘Unreachable’ is found, grab the line and send an email to yourself.

Same old problem , you would have to continually run that command and parse the output, why would that be better than following the log file (and parse he output) which shows the problem in real-time and why would that be less “impactful” ?

Never said it would be better… just an option. Parsing the logs would be a good way of doing it as well… same principle I guess!

With all the power of shell scripting it is always better to not complicate things, if the data is there in a raw form (and it is, just look) , don’t waste time reinventing the bicycle :slight_smile:

Just putting out the option there - trying to be helpful…

I know it is a little more impactful, but if a log was missed for whatever reason it won’t be picked up again until that extension goes online and off again, where as running the check say every 5 minutes retrieves the status of all the extensions.

I won’t argue further so please share your working solution, I would have to ask though why do you think that log line could possibly be missing?.

@dicko … I am not trying to argue! its just an OPTION. I don’t actually have a working script for this as its just a suggestion.

Then just try my script, it works and has for years,from detecting PRI failures to preemptively informing you of a 911 call. (which generally you won’t get by any other means if the E911 system “line grabs”)

Thanks dicko, I will be trying your script!

I use PRTG Network Monitor - free for up to 100 “sensors” (the most useful of which here is the Ping sensor). Everything I want to monitor on my network is on fixed IPs (either directly set or via DHCP reservation) so they all get pinged at (configurable) intervals - I get an email if anything drops off - servers, PCs, phones, wifi APs, VPN links, printers, etc. It can also be set as a syslog server with severity filtering etc.

Great piece of software - runs on Win7 or better, in my case in a VM in the rack. Access is via web GUI, of course.

Yes they all work somewhat, nagios,mon.monit.blah-blah, but when does your solution exactly indicate when a device went unreachable or do you have to relentlessly poll all your servers and presumably all your endpoints to get that info (your ping sensor probably won’t work if you have a decent set of ip restrictions in place)? True, SNMP can help and all the above does that but writing a filter to notice a missing endpoint is NOT trivial.

I just want you guys all think about it, either use a sophisticated AMI solution or simply watch the F’ing log file for obviously bad sh*t.

Seriously, a bogus 911 call that escalates to a big red truck roll will cost you 150 bucks here, my suggestion can possibly save you that cost if you have a phone in your pocket and costs absolutely nothing but a few clock cycles.

Hello Dicko, where can I get your script. I think it will be great to have on my FreePBX.
Thanks

You cant , i am a consultant, and I am not a cheap one, Private Message me, and get out your chequebook :slight_smile:

But now that he’s told you how it’s done, there’s nothing keeping you from hiring your 13-year-old grand daughter to write the script for you. You’ve seen Jurassic Park, right? :slight_smile:

2 Likes

Just look at dicko’s link 2nd from the top of this thread