Unix Connections Not Always Disconnecting

Home » Asterisk Users » Unix Connections Not Always Disconnecting
Asterisk Users 4 Comments

Hi

We are using asterisk 1.8.23.1

We have a script that runs on a minute cron which polls the asterisk server for 3 bits of information by using

asterisk -rx ‘command’

which then gets pushed to a graphite server we have

99% of this runs smoothly.

Every now and again, the asterisk service will become completely unresponsive and if we look at the logs we will see the following:

[2013-11-07 00:17:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:17:01] VERBOSE[26566] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:17:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:17:01] VERBOSE[26586] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:17:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:18:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:18:01] VERBOSE[26650] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:18:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:18:01] VERBOSE[26670] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:18:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:19:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:19:01] VERBOSE[26736] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:19:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:19:01] VERBOSE[26756] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:19:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:20:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:20:01] VERBOSE[26820] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:20:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:20:01] VERBOSE[26841] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:20:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:21:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:21:01] VERBOSE[26914] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:21:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:21:01] VERBOSE[26934] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:21:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:22:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:22:01] VERBOSE[27000] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:22:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:22:01] VERBOSE[27020] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:22:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:23:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:23:01] VERBOSE[27084] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:23:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:23:01] VERBOSE[27104] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:23:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:24:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:24:01] VERBOSE[27170] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:24:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:24:01] VERBOSE[27190] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:24:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:25:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:25:01] VERBOSE[27255] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:25:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:25:01] VERBOSE[27276] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:25:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:26:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:26:01] VERBOSE[27624] asterisk.c: — Remote UNIX
connection disconnected
[2013-11-07 00:26:01] VERBOSE[25963] asterisk.c: — Remote UNIX
connection
[2013-11-07 00:26:01] VERBOSE[27644] asterisk.c: — Remote UNIX
connection disconnected

As you can see, at these times there isn’t a disconnect for every connect. I think this ends up maxing out the amount of connections the service allows and that’s what makes it unresponsive. A service restart fixes the issue at this time.

This happens completely randomly, I’ve not been able to correlate this happening with any other events that are going on at the time.

Can anyone think of any reason why doing the asterisk -rx command might not disconnect cleanly?

Thanks in Advance

Ish

4 thoughts on - Unix Connections Not Always Disconnecting

  • Out of interest what are you trying to monitor?

    We tend to use cacti for graphing and snmp provides all the information we require.

  • Active calls, sip peers connected, sip peers disconnected and then breaking all of those down by customer as we run a multi tenanted set up.

    SNMP would give us totals but I don’t think it would do the breakdown by customer.

  • You should avoid using the CLI to access that information. You’d likely getter better results using AMI or CEL.

  • Hello,

    Same issue happens on one of our Call Center installation (using Asterisk
    1.6) – random unresponsive Asterisk with “self heal” after 2-3 minutes. Because we could not find the root cause (till now – many thanks Ishfaq) we end up by nightly restart on Asterisk.

    We are using CLI commands more heavier (more than 10 commands at each 10
    seconds) and it is clear now that we have to switch to AMI.

    However it remains the question related on why the Unix connections are not disconnecting sometimes and how to force a “cleanup” if this could not be solved.

    Best regards, Ioan