[Asterisk-Users] service scan

Chris Stone cstone at axint.net
Mon Jun 20 17:20:03 MST 2005


On Monday 20 June 2005 05:37 pm, Moises Silva wrote:
> i want to make  script in bash to determine whether or not a server is
> up and running with asterisk, so i tought i could use someting like
>
> # nmap -p 5060 host.server.com
>
> but it does not matter if asterisk is down or up, it keeps saying
>
> PORT     STATE  SERVICE
> 5060/tcp closed unknown
>
> why does it says closed? any other ideas?

Take a look at the Nagios plugin (www.nagios.org) for Asterisk - 
check_asterisk. You could plagerize that code or write your own script. 
Basically what it does is log into the server via the manager telnet, and 
runs the manager ping command, looking for the pong reply. Would be easy to 
write a little script to do that in perl, php, or whatever.

Chris



More information about the asterisk-users mailing list