The
Mitel 3300 has the ability to generate traffic files that can give
you a lot of information about what's going on with your trunks.
There is a problem, however. They system will only keep ten
files and then it will overwrite the oldest one. That
means you have no ability to go back more than a day to see what was
happening on the trunks then. One of the things I've always
wanted to do was to capture the traffic files produced by the 3300
and save them long term. Thanks to a lot of
help by member
bajangerry who provided the
following script we can now do that.
To do this I used a Ubuntu Linux on a virtual
machine.
The script will create a new file everyday to save
the traffic information in. Be aware that over the course of a
year it will generate 365 files. Since this file is not
compressed it can take up quite a bit of space so be sure to keep an
eye on your available hard drive space.
Setting Up the Mitel 3300
Turn On Traffic Reporting In Mitel
Edit the form "Traffic Reporting Options".
Set your active time slot. I have always set this to be active
during normal business hours. The reason I don't normally run
it 24 hours is because the system will produce a lot of data and I
don't like the idea of wading through all that when off hours isn't
interesting to me.
Set the "Period Length" to 60 minutes.
Set the "Usage Units" to Erlangs.
I prefer Erlangs here because to me it's easier to read than CCS.
Set "Autoprint" to Yes.
Set "Maximum Number of Traffic Files" to
10. This is the number of files that the 3300 keeps on its own
hard drive. It over writes the oldest when producing reports.
Set the
following fields to Yes.
Routes
Trunk
Groups
Trunks
Routes
will show you if specific ARS routes in your system is being used.
Trunk
Groups will show you if specific Trunk Groups are being used.
Trunks
will show you what Trunks are being used.
With the exception of Attendant information, I
have not found the other options to be of any value but feel free to
experiment.
Set Up the Output Printer
Edit the form "Application Logical Ports".
Set the field for "Traffic Report Port" to
be LPR3. Note that the "LPR3" may be case sensitive.
Setting Up Linux Script
Create a directory for storage of the files.
I used "/home/mitel/traffic/".
Upload the following script to the "/home/mitel/"
directory. I used the name "script.pl"
#!/usr/bin/perl
#script by Mitelforums.com member
bajangerry
# usage: perl script.pl <ip> <port> <directory>
use strict;
use IO::Socket;
use POSIX;
my $host = shift || $ARGV[0];
my $port = shift || $ARGV[1];
my $dir = shift || $ARGV[2];
my $proto = getprotobyname('tcp');
my $iaddr = inet_aton($host);
my $paddr = sockaddr_in($port, $iaddr);
for(;; ){
my $sock = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port,Proto
=> "tcp",)
or die "Cannot connect to PBX at address: $host port: $port:
$!";
while (<$sock>) {
s/^\0+//; # Remove leading null characters
print $_;
chomp ($_);
#my $file = strftime("%B%d%Y",localtime(time));
my $file = $dir.strftime '%Y-%m-%d', localtime;
#print $file;
if (-f $file){
open (my $fh,'>>', $file);
print $fh "$_";
close $file;
}
else {
open (my $fh,'>', $file);
print $fh "$_";
close $file;
}
}
}
|
The usage
of this script is "perl script.pl <3300 IP Address> <port>
<path>"
An example
of usage is "perl script.pl 192.168.1.2 1754 ./traffic/"
Note the
trailing '/' for the path.
You can
enter the above command from the user interface but it will stop
when you log out.
Begin
Script At Linux Start Up.
To start
the script automatically at reboot you'll need to edit the cron
file.
You can do
that by entering "crontab -e".
Add the
following line towards the beginning of the file:
@reboot
perl /home/mitel/scritp.pl <IP Address> <port> <path>
Example:
@reboot perl /home/mitel/scritp.pl
192.168.1.2 1754 /home/mitel/traffic/
Once
you reboot you can check to see if it's running by entering the
command "pgrep perl". This should show you the number of
the PID.
A Note About Ports
The Mitel 3300 uses some specific IP
ports or sockets that will allow you to connect the script to
it.
Log Output |
Socket |
Software Logs |
1750 |
Maintenance Logs |
1751 |
SMDR Logs |
1752 |
Hotel/Motel Logs |
1753 |
LPR1 Printer Port |
1754 |
ACD Real Time Event |
15373 |
IP PMS (3300 Release 6.0) |
15374 |
PMS Voice Mail Integration |
6830 |
|
Click Here For the Mitel Forum
Related Forum Post
Please join our forum and follow our
newsletter. Your participation may help others. If you've
found this article useful please
|