Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Peak number of calls?

Goto page 1, 2  Next
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
gordon+asterisk at dro...
Guest





PostPosted: Wed Jan 23, 2008 1:23 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

(I'm looking for evidence for an ISDN client who wants to know if he's
spent too much on the number of ISDN lines he has installed!)

Cheers,

Gordon
Back to top
tilghman at mail.jeffa...
Guest





PostPosted: Wed Jan 23, 2008 1:47 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

No, the CDRs would be where that information is stored, if anywhere.

--
Tilghman
Back to top
drew at oanda.com
Guest





PostPosted: Wed Jan 23, 2008 1:47 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

(I'm looking for evidence for an ISDN client who wants to know if he's
spent too much on the number of ISDN lines he has installed!)

Cheers,

Gordon


We use Asterisk-stat from Areski (GPL). It will show peak number of
calls by the hour. Select "Daily Load", scroll down and choose the hour
you want and "Fluctuation Graph". Lots of other goodies too.

http://areski.net/areski/index.php?option=com_content&task=view&id=22&Itemid=54

regards,

Drew

--
Drew Gibson

Systems Administrator
OANDA Corporation
www.oanda.com
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Wed Jan 23, 2008 2:06 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wed, 23 Jan 2008, Drew Gibson wrote:

Quote:
Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

We use Asterisk-stat from Areski (GPL). It will show peak number of
calls by the hour. Select "Daily Load", scroll down and choose the hour
you want and "Fluctuation Graph". Lots of other goodies too.

http://areski.net/areski/index.php?option=com_content&task=view&id=22&Itemid=54

Or, as a quick & dirty...

DATE=$(date +%F-%H-%M-%S)
COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
echo $DATE $COUNT >>/tmp/channel-counts

in a shell script executed every second in cron.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
Back to top
andres at telesip.net
Guest





PostPosted: Wed Jan 23, 2008 2:14 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Gordon Henderson wrote:

Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.


MRTG is very handy for this. We use the script found at:
http://karlsbakk.net/asterisk/ You can plot SIP, IAX, and ZAP Channels
over time.

Andres
http://www.neuroredes.com

Quote:
I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

(I'm looking for evidence for an ISDN client who wants to know if he's
spent too much on the number of ISDN lines he has installed!)

Cheers,

Gordon

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


Back to top
stotaro at totarotechn...
Guest





PostPosted: Wed Jan 23, 2008 4:45 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Jan 23, 2008 2:06 PM, Steve Edwards <asterisk.org at sedwards.com> wrote:
Quote:
On Wed, 23 Jan 2008, Drew Gibson wrote:

Quote:
Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

We use Asterisk-stat from Areski (GPL). It will show peak number of
calls by the hour. Select "Daily Load", scroll down and choose the hour
you want and "Fluctuation Graph". Lots of other goodies too.

http://areski.net/areski/index.php?option=com_content&task=view&id=22&Itemid=54

Or, as a quick & dirty...

DATE=$(date +%F-%H-%M-%S)
COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
echo $DATE $COUNT >>/tmp/channel-counts

in a shell script executed every second in cron.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000


I have seen Cacti used to make some *really* nice semi-realtime and
historic graphs.

Thanks,
Steve Totaro
Back to top
gordon+asterisk at dro...
Guest





PostPosted: Wed Jan 23, 2008 5:33 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wed, 23 Jan 2008, Andres wrote:

Quote:
Gordon Henderson wrote:

Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.


MRTG is very handy for this. We use the script found at:
http://karlsbakk.net/asterisk/ You can plot SIP, IAX, and ZAP Channels
over time.

Ah yes. Quite Intersting.

I use MRTG in a lot of applications, so this is worthy of a look. It only
samples every 5 minutes though, so has the potential to miss things,
although this (and the crude shell-script suggested by Steve Edwards has
presented me with an idea to use the manager interface to sample it a bit
more often and keep a count.

Thanks!

Gordon
Back to top
pdhales at optusnet.co...
Guest





PostPosted: Wed Jan 23, 2008 6:10 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wed, 2008-01-23 at 18:23 +0000, Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

(I'm looking for evidence for an ISDN client who wants to know if he's
spent too much on the number of ISDN lines he has installed!)

Munin has a nice Asterisk plugin that works reasonably well.

PaulH
Back to top
Guest






PostPosted: Wed Jan 23, 2008 6:52 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Steve Edwards wrote:
Quote:
Or, as a quick & dirty...
DATE=$(date +%F-%H-%M-%S)
COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
echo $DATE $COUNT >>/tmp/channel-counts

in a shell script executed every second in cron.

every *second* from cron? how the heck would I you do that? sub-minute
accuracy from cron is something I don't know how to do.

Maybe it's a different version of cron...?

The only way I would achieve that would be to run something every minute
that self-perpetuated for the rest of that minute...

for x in `seq 1 58`;
do
( DATE=$(date +%F-%H-%M-%S)
COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
echo $DATE $COUNT >>/tmp/channel-counts
) &
sleep 1s
done

which is honestly very messy.

I promise I'm not being sarcastic. I actually *am* curious if there are versions of cron that will go sub-minute.

Moj
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Wed Jan 23, 2008 7:02 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wed, 23 Jan 2008, Mojo with Horan & Company, LLC wrote:

Quote:
Steve Edwards wrote:
Quote:
Or, as a quick & dirty...
DATE=$(date +%F-%H-%M-%S)
COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
echo $DATE $COUNT >>/tmp/channel-counts

in a shell script executed every second in cron.

every *second* from cron? how the heck would I you do that? sub-minute
accuracy from cron is something I don't know how to do.

Sheese -- that's what I get by trying to type without putting down the
crack pipe Smile

You're right -- the "*" in the first column of your crontab means minutes,
not seconds.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
Back to top
Guest






PostPosted: Wed Jan 23, 2008 7:49 pm    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Steve Edwards wrote:
Quote:
Quote:
Quote:
in a shell script executed every second in cron.


every *second* from cron? how the heck would I you do that? sub-minute
accuracy from cron is something I don't know how to do.


Sheese -- that's what I get by trying to type without putting down the
crack pipe Smile

You're right -- the "*" in the first column of your crontab means minutes,
not seconds.

Ok, I'm NOT on the crack pipe then Wink I was wondering.....

Sticking to the slimy hack i described!
Back to top
anthonyf at rockynet.com
Guest





PostPosted: Thu Jan 24, 2008 12:23 am    Post subject: [asterisk-users] Peak number of calls? Reply with quote

Tilghman Lesher wrote:
Quote:
On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:

Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...


No, the CDRs would be where that information is stored, if anywhere.



This is actually sort of easy. You simply have every call pass through a
context in which you assign the call to a group, then either do a NoOp
echoing the group count or a user event doing the same, then either
programatically or grep search your logs for the output or have a script
monitoring the AMI watch for the user event and write the number in a
data base.

Of these two I personally do the second option because then I can just
do a max() function on that database field to get the maximum calls for
any time range I specify.

Oh and just a note, never just say no because you don't know, in this
instance you would say, "I think your best bet is the CDR's". Just a tip.

Anthony
Back to top
tilghman at mail.jeffa...
Guest





PostPosted: Thu Jan 24, 2008 12:39 am    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wednesday 23 January 2008 23:23:23 Anthony Francis wrote:
Quote:
Tilghman Lesher wrote:
Quote:
On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

No, the CDRs would be where that information is stored, if anywhere.

This is actually sort of easy. You simply have every call pass through a
context in which you assign the call to a group, then either do a NoOp
echoing the group count or a user event doing the same, then either
programatically or grep search your logs for the output or have a script
monitoring the AMI watch for the user event and write the number in a
data base.

Of these two I personally do the second option because then I can just
do a max() function on that database field to get the maximum calls for
any time range I specify.

Oh and just a note, never just say no because you don't know, in this
instance you would say, "I think your best bet is the CDR's". Just a tip.

The key phrase in the original post was "has had", indicating past behavior,
not future behavior. Yes, you can do all sorts of things in the dialplan to
get that information into a logfile, but you cannot retroactively do those
things. The only place that information can be had are the CDRs, so I will
stick with my original assessment.

--
Tilghman
Back to top
gordon+asterisk at dro...
Guest





PostPosted: Thu Jan 24, 2008 3:04 am    Post subject: [asterisk-users] Peak number of calls? Reply with quote

On Wed, 23 Jan 2008, Tilghman Lesher wrote:

Quote:
On Wednesday 23 January 2008 23:23:23 Anthony Francis wrote:
Quote:
Tilghman Lesher wrote:
Quote:
On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:
Quote:
Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

No, the CDRs would be where that information is stored, if anywhere.

This is actually sort of easy. You simply have every call pass through a
context in which you assign the call to a group, then either do a NoOp
echoing the group count or a user event doing the same, then either
programatically or grep search your logs for the output or have a script
monitoring the AMI watch for the user event and write the number in a
data base.

Of these two I personally do the second option because then I can just
do a max() function on that database field to get the maximum calls for
any time range I specify.

Oh and just a note, never just say no because you don't know, in this
instance you would say, "I think your best bet is the CDR's". Just a tip.

The key phrase in the original post was "has had", indicating past behavior,
not future behavior. Yes, you can do all sorts of things in the dialplan to
get that information into a logfile, but you cannot retroactively do those
things. The only place that information can be had are the CDRs, so I will
stick with my original assessment.

Yes, nice to know what happened in the past, but also nice to know what
happens in the future, so I'm not overly hung up about how. (And the CDRs
aren't in a database either - just flat file on my devices)

I did actually think of adding in some diaplan stuff to keep counts, but
I've now got a skeleton and a good idea if something that'll keep me
happy. Basically 2 parts - one which polls the system via the manager
inteface every few seconds to count calls, and another which interfaces to
mrtg. I didn't really think of this initially as for a long time my units
did have perl, (which mrtg needs) but I've managed to squeeze in enough
perl to run other things now, so off I go.

Thanks,

Gordon
Back to top
asterisk at tescogroup...
Guest





PostPosted: Thu Jan 24, 2008 8:12 am    Post subject: [asterisk-users] Peak number of calls? Reply with quote

I use mrtg,

I call this from MRTG: `/usr/local/groundwork/nagios/libexec/asterisk-mrtg.pl -1 Zap -2 SIP`

Here is my asterisk-mrtg.pl: (note, I have tweaked this, but I do not know where I had gotten my original reference)
-------
#!/usr/bin/perl -w

use strict;
use IO::Socket;
use Getopt::Long;
$|=1;

my $host = "172.16.200.5";
my $username = "changeduser";
my $password = "changespass";

my (
$version, $response, $message, $line, $chan1, $chan2,
$verbose, $help, $command,
$warning, $critical,
%warnval, %critval,
%channels,
$sock,
$key,
$s,
$i,
);
my $stop = 0;
my $port = 5038;
my $exitcode = 0;
my $cause = "";

sub warning {
$s = shift;
$s =~ s/[\r\n]//g;
print "WARNING: $s\n" if ($verbose);
exit(1);
}

sub error {
$s = shift;
$s =~ s/[\r\n]//g;
print "ERROR: $s\n" if ($verbose);
exit(2);
}

sub unknown {
$s = shift;
$s =~ s/[\r\n]//g;
print "UNKNOWN: $s\n" if ($verbose);
exit(3);
}

sub syntax {
$s = shift;
unless ($s =~ m/Help:/) {
$s = "Error: (".$s.")" or $s = 'Unknown';
}
print "$s\n" unless ($help);
print "Syntax: $0 -h <host> -u <username> -p <password> [-cwv]\n";
print "* --username -u Username\n";
print "* --password -p Password\n";
print "* --host -h Host\n";
print " --port -P n Port (if not using $port)\n";
print " --chan1 -1 xxx Display channel xxx as 1.\n";
print " --chan2 -2 xxx Display channel xxx as 2.\n";
print " --verbose -v Verbose\n";
print " --help -H This help\n";
exit(3);
}

Getopt::Long::Configure('bundling');
GetOptions
("p=s" => \$password, "password=s" => \$password,
"u=s" => \$username, "username=s" => \$username,
"h=s" => \$host, "host=s" => \$host,
"P=s" => \$port, "port=s" => \$port,
"H" => \$help, "help" => \$help,
"v" => \$verbose, "verbose" => \$verbose,
"chan1=s" => \$chan1, "1=s" => \$chan1,
"chan2=s" => \$chan2, "2=s" => \$chan2);

syntax("Help:") if ($help);
syntax("Missing username") unless (defined($username));
syntax("Missing password") unless (defined($password));
syntax("Missing host") unless (defined($host));
syntax("Missing channels") if (!defined($chan1) or !defined($chan2));
if (defined($warning)) {
foreach $s (split(/,/, $warning)) {
syntax("Warning value given, $s, is invalid")
unless ($s =~ /^(\w+)=(\d+)$/);
$warnval{$1} = $2;
print "Clear to give WARNING after $2 connections on $1\n" if ($verbose);
}
}
if (defined($critical)) {
foreach $s (split(/,/, $critical)) {
syntax("Critical value given, $s, is invalid")
unless ($s =~ /^(\w+)=(\d+)$/);
$critval{$1} = $2;
print "Clear to give CRITICAL after $2 connections on $1\n" if ($verbose);
}
}

unless ($sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, Proto => 'tcp')) {
print("Could not connect to asterisk server ".$host.":".$port."\n") if ($verbose);
exit(2);
}
$version = <$sock>;
print $version if ($verbose);

print $sock "Action: Login\r\nUsername: $username\r\nSecret: $password\r\nEvents: off\r\n\r\n";
print "Action: Login\r\nUsername: $username\r\nSecret: $password\r\n\r\n" if ($verbose);
$response = <$sock>;
$message = <$sock>;
$s = <$sock>;
print $response.$message if ($verbose);
print $s if ($verbose);

exit(1) unless ($response =~ m/^Response:\s+(.*)$/i);
exit(1) unless ($1 =~ m/Success/i);

print $sock "Action: Status\r\n\r\n";
print "Action: Status\r\n\r\n" if ($verbose);

$response = <$sock>;
$message = <$sock>;
print $response.$message if ($verbose);

&unknown("Unknown answer $response (wanted Response: something)") unless ($response =~ m/^Response:\s+(.*)$/i);
&unknown("$response didn't say Success") unless ($1 =~ m/Success/i);
&unknown("Unknown answer $response (wanted Message: something)") unless ($message =~ m/^Message:\s+(.*)$/i);
&unknown("didn't understand message $message") unless ($1 =~ m/Channel status will follow/i);

$stop=0;
while (($stop == 0) && ($line = <$sock>)) {
print "$line" if ($verbose);
if ($line =~ m/Channel:\s+(\w+)\//) {
$channels{$1}++;
print "Found $1 channel\n" if ($verbose);
}
if ($line =~ m/Event:\s*StatusComplete/i) {
$stop++;
}
}

# Log out
print $sock "Action: Logoff\r\n\r\n";

undef($s);

for ($i=0;$i<2;$i++) {
if (defined($channels{$chan1})) {
print $channels{$chan1} . "\n";
} else {
print "0\n";
}
if (defined($channels{$chan2})) {
print $channels{$chan2} . "\n";
} else {
print "0\n";
}
}

-----------

my $username should be a user in the asterisk management file.
my $password should be the password for that account.

This gives me this output:
`Daily' Graph (5 Minute Average)


Max
Average
Current

Zap channels
5 Zap channels in use
1 Zap channels in use
0 Zap channels in use

SIP channels
6 SIP channels in use
1 SIP channels in use
0 SIP channels in use





--
--
Steven

http://www.connectech.org/



"Gordon Henderson" <gordon+asterisk at drogon.net> wrote in message news:Pine.LNX.4.64.0801231817520.19953 at lion.drogon.net...
Quote:

Is there any way to find-out the peak number of calls that an asterisk
system has had? Not the total number of calls, but the maximum number of
simultaneous calls.

I know I can porobably go through the CDR logs and look for calls which
have overlapped in time, but I'm wondering if there's some counter
somewhere I could access...

(I'm looking for evidence for an ISDN client who wants to know if he's
spent too much on the number of ISDN lines he has installed!)

Cheers,

Gordon

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080124/f5d26bfc/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 5282 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080124/f5d26bfc/attachment-0001.png
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services