How do I check to see if Asterisk is running remotely

I want to run a bash commend from my router to a local Asterisk server. All I need to know is if the service is running or not. I have tried telnet and nc and the server doesn’t answer at all. Is there a simple way to do this?

Thanks

If Asterisk service is running on the default port this should work nc -u Asterisk-IP 5060

https://www.linuxtechi.com/nc-ncat-command-examples-linux-systems/

I’d use snmp for this personally. you could configure snmpd to monitor how many asterisk processes are running.

The version of NC on the router must be stripped down -u is unrecognized. :frowning:

Hi John,
snmp would certainly work but I need something extremely lightweight on the router and basically I need a “is asterisk running or not” type of thing. I would be running on a Edgerouter OS I want this so I can determine whether to change a DNS setting for the phones in the router.

How do you define running? Asterisk has been known to deadlock, but, as it is multithreaded, it can still appear to be alive when tested with simple tests.

Well the goal is to change the asterisk server that the phones are using to a cloud system IF they cannot connect to the local system. I can do that with using a local DNS setting in the router, I just need to be able to make the distinction. I already can do it with a ping command but that only would let me know if the server was down completely.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.