88 IBM Tivoli Netcool Service Quality Manager Data Mediation Gateway Development
return \@rules;
}
1;
Motorola GGSN UserConfig.pm
The complete listing of the UserConfig.pm that is used in 3.5, “Developing the
post parser configuration for Motorola GGSN” on page 58 is shown in
Example A-6.
Example: A-6 UserConfig.pm for motorola-ggsn gateway
#
#----------------------------------------------------------------------
# %A%
#----------------------------------------------------------------------
#
# This perl module contains the configuration information for this
# parser. If you don't understand the format of this configuration file
# DON'T TOUCH IT.
#
#
# Copyright (C) 2007 Vallent Software Systems UK, an IBM company.
# All rights reserved.
#
package UserConfig;
@ISA = qw(Exporter);
@EXPORT = qw(postparser_config);
use strict;
use Exporter ();
#----------------------------------------------------------------------
my @rules = (
{
RULE_TYPE => 'PERLIZE',
RULE_DESC => 'Rename APN',
INPUT_FILE_DESCRIPTION => '^*.pif$',
HEADER_COUNTERS_OP => sub {
use Date::Manip;
Appendix A. Sample data and programs listing for gateways 89
my $h_ref = shift;
# Manipulate date format
$h_ref->{"day"} = UnixDate($h_ref->{"day"},"%s");
$h_ref->{"startTime"} = $h_ref->{"day"} + $h_ref->{"startTime"};
$h_ref->{"startTime"} = localtime($h_ref->{"startTime"});
$h_ref->{"startTime"} =
UnixDate($h_ref->{"startTime"},"%Y%m%d.%H%M");
$h_ref->{"startTime"} = "A".$h_ref->{"startTime"};
$h_ref->{"endTime"} = $h_ref->{"day"} + $h_ref->{"endTime"};
$h_ref->{"endTime"} = localtime($h_ref->{"endTime"});
$h_ref->{"endTime"} = UnixDate($h_ref->{"endTime"},"%Y%m%d.%H%M");
$h_ref->{"endTime"} = "-".$h_ref->{"endTime"};
$h_ref->{"INDEX"} = "_1_";
# Renaming counter to form GGSNNAME
$h_ref->{"GGSNNAME"} = $h_ref->{"systemName"};
return 0;
},
DATA_COUNTERS_OP => sub {
my $c_ref = shift;
# Merge counters to form APN
$c_ref->{"APN"} =
$c_ref->{"systemIPAddress"}.":".$c_ref->{"index"};
# Calculate pdpCreate_successes
$c_ref->{"PDPCREATE_SUCCESSES"} =
$c_ref->{"cgprsAccPtSuccMsActivatedPdps"} +
$c_ref->{"cgprsAccPtSuccMsActivatedDynPdps"} +
$c_ref->{"cgprsAccPtSuccNetworkInitPdps"};
# Calculate pdpDelete_failures
$c_ref->{"PDPCREATE_FAILURES"} =
abs($c_ref->{"cgprsAccPtMsActivatedPdps"} +
$c_ref->{"cgprsAccPtMsActivatedDynPdps"} +
$c_ref->{"cgprsAccPtNetworkInitPdps"} -
$c_ref->{"cgprsAccPtSuccMsActivatedPdps"} -
$c_ref->{"cgprsAccPtSuccMsActivatedDynPdps"} -
$c_ref->{"cgprsAccPtSuccNetworkInitPdps"});
# Renaming counter to form msInit_pdpDelete_successes
$c_ref->{"MSINIT_PDPDELETE_SUCCESSES"} =
$c_ref->{"cgprsAccPtSuccMsDeactivatedPdps"};
# Calculate msInit_pdpDelete_failures
$c_ref->{"MSINIT_PDPDELETE_FAILURES"} =
abs($c_ref->{"cgprsAccPtMsDeactivatedPdps"} -
$c_ref->{"cgprsAccPtSuccMsDeactivatedPdps"});
# Renaming counter to form msInit_pdpDelete_successes
$c_ref->{"NWINIT_PDPDELETE_SUCCESSES"} = '';
90 IBM Tivoli Netcool Service Quality Manager Data Mediation Gateway Development
$c_ref->{"NWINIT_PDPDELETE_FAILURES"} = '';
return 0;
},
FILENAME_SUFFIX => 'PZ',
REDUNDANT_HEADER_COUNTERS => [qw(FILENAME BLOCKNAME day
systemName)],
REDUNDANT_DATA_COUNTERS => [
'',
'systemIPAddress',
'index',
'cgprsAccPtActivePdps',
'cgprsAccPtDestAddrViolTpdus',
'cgprsAccPtDhcpAddrReleases',
'cgprsAccPtDhcpAddrRequests',
'cgprsAccPtDownstreamPacketCount',
'cgprsAccPtGgsnDeactivatedPdps',
'cgprsAccPtIpv6DownstreamPackets',
'cgprsAccPtIpv6DownstreamTrafficVolume',
'cgprsAccPtIpv6GgsnDeactivatedPdps',
'cgprsAccPtIpv6GgsnSuccDeactivatedPdps',
'cgprsAccPtIpv6MsActivatedDynPdps',
'cgprsAccPtIpv6MsActivatedPdps',
'cgprsAccPtIpv6MsDeactivatedPdps',
'cgprsAccPtIpv6MsSuccActivatedDynPdps',
'cgprsAccPtIpv6MsSuccActivatedPdps',
'cgprsAccPtIpv6MsSuccDeactivatedPdps',
'cgprsAccPtIpv6NetworkInitDeactPdps',
'cgprsAccPtIpv6NetworkInitDeactSuccPdps',
'cgprsAccPtIpv6UpstreamPackets',
'cgprsAccPtIpv6UpstreamTrafficVolume',
'cgprsAccPtMsActivatedDynPdps',
'cgprsAccPtMsActivatedPdps',
'cgprsAccPtMsDeactivatedPdps',
'cgprsAccPtNetworkInitPdps',
'cgprsAccPtRedirInterMobilTraffic',
'cgprsAccPtRevDownstrTrafficVol',
'cgprsAccPtRevUpstreamTrafficVol',
'cgprsAccPtSourceAddrViolTpdus',
'cgprsAccPtSuccDhcpAddrRequests',
'cgprsAccPtSuccGgsDeactivatedPdps',
'cgprsAccPtSuccMsActivatedDynPdps',
'cgprsAccPtSuccMsActivatedPdps',
'cgprsAccPtSuccMsDeactivatedPdps',
'cgprsAccPtSuccNetworkInitPdps',
'cgprsAccPtUpstreamPacketCount',
Appendix A. Sample data and programs listing for gateways 91
],
DATA_COUNTERS_ORDER => [qw(APN
PDPCREATE_SUCCESSES
PDPCREATE_FAILURES
MSINIT_PDPDELETE_SUCCESSES
MSINIT_PDPDELETE_FAILURES
NWINIT_PDPDELETE_SUCCESSES
NWINIT_PDPDELETE_FAILURES)],
},
{
RULE_TYPE => 'PIF_2_CSV',
RULE_DESC => 'Create CSV output',
INPUT_FILE_DESCRIPTION =>
['^(PassiveCollector-IBM.pmgw_cgprsAccPtStatisticsEntry.*)-#-I-#-PZ.pif
$'],
OUTPUT_BLOCK_NAME => 'GGSN',
DEFAULT_NULL_VALUE => '',
PRODUCE_PIF => 1,
OUTPUT_FILENAME_START => 'A',
HEADER_FIELDS_FOR_OUTPUT_FILENAME => [qw(startTime endTime
SUFFIX GGSNNAME)],
REDUNDANT_HEADER_COUNTERS => [qw(startTime endTime PREFIX
SUFFIX)],
OUTPUT_FORMAT => 'CSV_Writer_ITSO',
COUNTERS_ORDER => [qw(GGSNNAME APN
PDPCREATE_SUCCESSES
PDPCREATE_FAILURES
MSINIT_PDPDELETE_SUCCESSES
MSINIT_PDPDELETE_FAILURES
NWINIT_PDPDELETE_SUCCESSES
NWINIT_PDPDELETE_FAILURES)],
},
#----------------------------------------------------------------------
);
#----------------------------------------------------------------------
sub postparser_config {
return \@rules;
}
1;

Get IBM Tivoli Netcool Service Quality Manager Data Mediation Gateway Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.