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? -- "Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"
Asterisk only runs on 5060/udp. -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Moises Silva Sent: Monday, June 20, 2005 7:38 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] service scan 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? -- "Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org" _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Try "nmap -sU -p 5060 host.server.com" (has to be run as root to scan udp port). 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? >
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