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
On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:> 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
Gordon Henderson wrote:> 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
On Wed, 23 Jan 2008, Drew Gibson wrote:> Gordon Henderson wrote: >> 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=54Or, 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
Gordon Henderson wrote:>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>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 > > >
On Jan 23, 2008 2:06 PM, Steve Edwards <asterisk.org at sedwards.com> wrote:> On Wed, 23 Jan 2008, Drew Gibson wrote: > > > Gordon Henderson wrote: > >> 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
On Wed, 23 Jan 2008, Andres wrote:> Gordon Henderson wrote: > >> 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
On Wed, 2008-01-23 at 18:23 +0000, Gordon Henderson wrote:> 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
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...> > 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