Table Of Contents
Code Samples
Application Configuration
tables.xml File
tables.dtd File
Adapter Configuration
ragadapter.conf File
ragadapter.xml File
Code Samples
This appendix contains samples of files used to configure the Cisco Service Control Management Suite (SCMS) Collection Manager (CM) and the adapters that process the data that the CM receives.
•
Application Configuration
•
Adapter Configuration
Application Configuration
The following sections list part of the XML file ( tables.xml ) used to configure the database tables, and the DTD file used to verify the structure of the XML file.
•
tables.xml File
•
tables.dtd File
tables.xml File
The following is a listing of a portion of the Cisco Service Control Application for Broadband tables.xml file:
<?xml version="1.0" encoding="ISO8859_1"?>
<!DOCTYPE dbtabconf PUBLIC "-//P-Cube//Engage DB RDR Configuration 2.1.0//EN"
"dbtables.dtd">
<application name="Engage" version="2.1"/>
<rdr name="SUR" dbtabname="RPT_SUR" tag="4042321922" createtable="true">
<field id="1" name="TIME_STAMP" type="TIMESTAMP">
<option property="source" value="timestamp"/>
<field id="2" name="RECORD_SOURCE" type="INT32">
<option property="source" value="recordsource"/>
<field id="3" name="SUBSCRIBER_ID" type="STRING" size="64"/>
<field id="4" name="PACKAGE_ID" type="INT32"/>
<field id="5" name="SERVICE_ID" type="INT32">
<option property="notnull" value="true"/>
<field id="6" name="MONITORED_OBJECT_ID" type="INT32"/>
<field id="7" name="BREACH_STATE" type="INT32"/>
<field id="8" name="REASON" type="INT32"/>
<field id="9" name="CONFIGURED_DURATION" type="INT32"/>
<field id="10" name="DURATION" type="INT32"/>
<field id="11" name="END_TIME" type="INT32"/>
<field id="12" name="UPSTREAM_VOLUME" type="UINT32"/>
<field id="13" name="DOWNSTREAM_VOLUME" type="UINT32"/>
<field id="14" name="SESSIONS" type="UINT32"/>
<index name="RPT_SUR_I1" columns="END_TIME">
<option property="clustered" value="true"/>
<rdr name="LUR" dbtabname="RPT_LUR" tag="4042321925" createtable="true">
<field id="1" name="TIME_STAMP" type="TIMESTAMP">
<option property="source" value="timestamp"/>
<field id="2" name="RECORD_SOURCE" type="INT32">
<option property="source" value="recordsource"/>
<field id="3" name="LINK_ID" type="INT32"/>
<field id="4" name="GENERATOR_ID" type="INT32"/>
<field id="5" name="SERVICE_ID" type="INT32"/>
<field id="6" name="CONFIGURED_DURATION" type="INT32"/>
<field id="7" name="DURATION" type="INT32"/>
<field id="8" name="END_TIME" type="INT32"/>
<field id="9" name="UPSTREAM_VOLUME" type="UINT32"/>
<field id="10" name="DOWNSTREAM_VOLUME" type="UINT32"/>
<field id="11" name="SESSIONS" type="UINT32"/>
<index name="RPT_LUR_I1" columns="END_TIME">
<option property="clustered" value="true"/>
<option property="allowduprow" value="true"/>
<aggtable name="TOP_HOURLY" dbtabname="RPT_TOPS_PERIOD0" aggperiod="0">
<field id="1" name="RECORD_SOURCE" type="INT32"/>
<field id="2" name="METRIC_ID" type="INT8"/>
<field id="3" name="SERVICE_ID" type="INT8"/>
<field id="4" name="TIME_STAMP" type="TIMESTAMP"/>
<field id="5" name="AGG_PERIOD" type="INT8"/>
<field id="6" name="SUBSCRIBER_ID" type="STRING" size="64"/>
<field id="7" name="CONSUMPTION" type="UINT32"/>
<index name="RPT_TOPS_PERIOD0_I1" columns="TIME_STAMP">
<option property="clustered" value="true"/>
<option property="allowduprow" value="true"/>
<table name="TZ" dbtabname="JCONF_SE_TZ_OFFSET">
<field id="1" name="TIME_STAMP" type="TIMESTAMP"/>
<field id="2" name="OFFSET_MIN" type="INT16"/>
For each table (either an RDR table, an aggregation table, or an extra table), the fields, indexes, and so on are listed.
Note
A table, an index, or fields can have arbitrary free text options that can be accessed in the templates.
The XML file is verified at runtime against a simple DTD, reproduced in the following section.
tables.dtd File
The following is a listing of the DTD file used to verify the tables.xml definition file:
<?xml version="1.0" encoding="ISO8859_1"?>
<!ELEMENT dbtabconf (fileversion, application, db?, dbtables)>
<!ELEMENT fileversion (#PCDATA)>
<!ELEMENT application EMPTY>
<!ELEMENT dbtables (rdr*, aggtable*, table*)>
<!ELEMENT table (options?, fields, indexes?)>
dbtabname CDATA #REQUIRED
createtable (true | false) "true"
inserttodb (true | false) "false"
<!ELEMENT aggtable (options?, fields, indexes?)>
dbtabname CDATA #REQUIRED
aggperiod CDATA #REQUIRED
createtable (true | false) "true"
<!ELEMENT rdr (options?, fields, indexes?)>
dbtabname CDATA #REQUIRED
createtable (true | false) "true"
inserttodb (true | false) "true"
<!ELEMENT fields (field+)>
<!ELEMENT field (options?)>
<!-- the id attribute below is presumably a numeric index, but it is for future
use, we currently don't look at it, as the order is imposed in the XML -->
<!ELEMENT indexes (index+)>
<!ELEMENT index (options?)>
create (true | false) "true"
<!ELEMENT options (option+)>
The location and name of the DTD and XML files can be set separately for each adapter in the adapter's configuration file.
Adapter Configuration
The following sections list the configuration file (ragadapter.conf) and the associated XML file (ragadapter.xml) used to configure the real-time aggregating (RAG) adapter.
The configuration files of the other adapters are similar to the RAG adapter configuration file. Only the RAG adapter has an associated XML file.
•
ragadapter.conf File
•
ragadapter.xml File
ragadapter.conf File
To perform RAG adapter general maintenance, use the file ~scmscm/cm/config/ragadapter.conf. The following is a sample of the RAG adapter configuration file:
#
# RAGAdapter main configuration file
#
[config]
xml_filename = ~/cm/config/ragadapter.xml
[housekeeper]
interval_sec = 10
[db]
operations_timeout = 60
batch_size = 10
transaction_size = 15
commit_interval = 6
blocking_connects = true
db_template_file = main.vm
db_template_dir = dbpacks/sybase/ase12.5.1
[app]
app_conf_file = dbtables.xml
app_dtd_file = dbtables.dtd
app_conf_dir = apps/scasbb/3.5.0
ragadapter.xml File
The sample ragadapter.xml file listed below defines two aggregations for the incoming NUR RDRs (intag="4042321920").
1.
Aggregates RDRs with the RDR tag 71070 (outtag="71070") and persists them into CSV files (sinkid="csv1").
The CSV file definition is located in the <sinks> section under the <csvsink id="csv1"> tag. This defines the output file name and directory. This also defines the rate at which new files are opened; either every five minutes, or when the current file reaches 1000 lines. Each field in the file is enclosed by quotes (").
The buckets aggregate the data by two NUR fields: 0 and 2. These fields correspond to the SUBSCRIBER_ID and the SUBS_USG_CNT_ID. The buckets' identifiers are similar to the fields appearing in the SQL "GROUP BY" clause.
There are two closures defined for these two fields. For field 0, if the SUBSCRIBER_ID is RonK, OmerT, or GuyM it is reported as GuyM. If the SUBSCRIBER_ID is NimrodR, YossiO, or LironL it is reported as OdedE. For field 2, if the SUBS_USG_CNT_ID is 5, 6, or 7 it is reported as 15. This functionality is similar to the Oracle SQL "DECODE" function.
Fields 8, 9, and 10, which correspond to up, down, and sessions, are accumulated inside the buckets.
Four monitors are then defined:
–
Two <maxmonitor> monitors are defined as checkpoints for the fields 8 (up) and 9 (down). When the accumulated value for either of these fields reaches 10,000, that bucket is flushed to the CSV file.
–
The third <timeoutmonitor> monitor is a checkpoint to flush all buckets to the file every 60 seconds.
–
The last <changemonitor> monitor triggers a warning to both the RAG adapter log and to the user log when an RDR arrives that contains a new value for DURATION (field 6).
2.
Aggregates RDRs with the RDR tag 71071 (outtag="71071") and persists them into a database table (sinkid="dbsink1").
The database definition is located in the <sinks> section under the <dbsink id="dbsink1"> tag.
The table definition is located in the tables configuration file: tables.xml. The definition is of the following format:
<ragtable ragsinkid="dbsink1"
dbtabname="RPT_AGG_NUR"
name="AGGNUR"
ragouttag="71071">
The following code is a sample of the configuration possibilities of the RAG adapter.
<!DOCTYPE ragadapterconf [
<!ELEMENT ragadapterconf (fileversion, config)>
<!ELEMENT fileversion (#PCDATA)>
<!ELEMENT config (aggregations, sinks)>
<!ELEMENT aggregations (aggregation+)>
<!ELEMENT aggregation (bucketident, closures, accumulators, monitors)>
<!ELEMENT bucketident (field | metafield)+>
<!ELEMENT closures (closure*)>
<!ELEMENT closure (closurespec+)>
<!ELEMENT closurespec (equivvalue+)>
type (string | int | long | double) #REQUIRED
primaryvalue CDATA #REQUIRED
<!ELEMENT equivvalue EMPTY>
<!ELEMENT accumulators (field+)>
<!ELEMENT monitors (changemonitor | maxmonitor | timeoutmonitor)*>
<!ELEMENT changemonitor EMPTY>
action (warn | checkpoint) #REQUIRED
active (true | false) #REQUIRED
<!ELEMENT maxmonitor EMPTY>
action (warn | checkpoint) #REQUIRED
active (true | false) #REQUIRED
<!ELEMENT timeoutmonitor EMPTY>
action (warn | checkpoint) #REQUIRED
active (true | false) #REQUIRED
type (string | int | long | double) #REQUIRED
<!ELEMENT sinks (csvsink | dbsink | generalsink)+>
classname CDATA #REQUIRED
filenameformat CDATA #REQUIRED
maxagesec CDATA #REQUIRED
usequotes (true | false) #REQUIRED
active (true | false) #REQUIRED
classname CDATA #REQUIRED
active (true | false) #REQUIRED
<!ELEMENT generalsink EMPTY>
classname CDATA #REQUIRED
active (true | false) #REQUIRED
$File: ragadapter.xml $ $Revision: #3 $
$DateTime: 2005/08/15 15:48:23 $
<aggregation id="NUR's by subscriber and subs usage counter"
intag="4042321920" outtag="71070" sinkid="csv1">
<!-- SUBSCRIBER_ID=0, SUBS_USG_CNT_ID=2 -->
<field index="0" type="string"/>
<field index="2" type="int"/>
<closurespec type="string" primaryvalue="GuyM">
<equivvalue val="OmerT"/>
<closurespec type="string" primaryvalue="OdedE">
<equivvalue val="NimrodR"/>
<equivvalue val="YossiO"/>
<equivvalue val="LironL"/>
<closurespec type="int" primaryvalue="15">
<!-- up=8, down=9, sessions=10 -->
<field index="8" type="long"/>
<field index="9" type="long"/>
<field index="10" type="long"/>
<!-- nothing to monitor for change in NUR really.
For sake of testing, let's warn if DURATION changes. -->
<maxmonitor action="checkpoint" field="8" maxvalue="10000" active="true"/>
<maxmonitor action="checkpoint" field="9" maxvalue="10000" active="true"/>
<changemonitor action="warn" field="6" active="true"/>
<timeoutmonitor action="checkpoint" maxsec="60" active="true"/>
<aggregation id="NUR's by subscriber only, per SCE"
intag="4042321920" outtag="71071" sinkid="dbsink1">
<field index="0" type="string"/>
<metafield source="record-source" type="int"/>
<field index="8" type="long"/>
<field index="9" type="long"/>
<field index="10" type="long"/>
<timeoutmonitor action="checkpoint" maxsec="60" active="true"/>
classname="com.cisco.scmscm.adapters.rag.sinks.CSVSink"
filenameformat="yyyy-MM-dd_HH-mm-ss-SSS'.csv'"
dirname="~/cm/adapters/RAGAdapter/csvfiles"
maxagesec="300" maxlines="1000" usequotes="true" active="true"/>
classname="com.cisco.scmscm.adapters.rag.sinks.JDBCSink" active="false"/>