|
Table Of Contents
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
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.
The 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"> <dbtabconf> <fileversion> ... </fileversion> <application name="Engage" version="2.1"/> <dbtables> <rdr name="SUR" dbtabname="RPT_SUR" tag="4042321922" createtable="true"> <fields> <field id="1" name="TIME_STAMP" type="TIMESTAMP"> <options> <option property="source" value="timestamp"/> </options> </field> <field id="2" name="RECORD_SOURCE" type="INT32"> <options> <option property="source" value="recordsource"/> </options> </field> <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"> <options> <option property="notnull" value="true"/> </options> </field> <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"/> </fields> <indexes> <index name="RPT_SUR_I1" columns="END_TIME"> <options> <option property="clustered" value="true"/> </options> </index> </indexes> </rdr> <rdr name="LUR" dbtabname="RPT_LUR" tag="4042321925" createtable="true"> <fields> <field id="1" name="TIME_STAMP" type="TIMESTAMP"> <options> <option property="source" value="timestamp"/> </options> </field> <field id="2" name="RECORD_SOURCE" type="INT32"> <options> <option property="source" value="recordsource"/> </options> </field> <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"/> </fields> <indexes> <index name="RPT_LUR_I1" columns="END_TIME"> <options> <option property="clustered" value="true"/> <option property="allowduprow" value="true"/> </options> </index> </indexes> </rdr> <aggtable name="TOP_HOURLY" dbtabname="RPT_TOPS_PERIOD0" aggperiod="0"> <fields> <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"/> </fields> <indexes> <index name="RPT_TOPS_PERIOD0_I1" columns="TIME_STAMP"> <options> <option property="clustered" value="true"/> <option property="allowduprow" value="true"/> </options> </index> </indexes> </aggtable> <table name="TZ" dbtabname="JCONF_SE_TZ_OFFSET"> <fields> <field id="1" name="TIME_STAMP" type="TIMESTAMP"/> <field id="2" name="OFFSET_MIN" type="INT16"/> </fields> </table> </dbtables> </dbtabconf>
For each table (either an RDR table, an aggregation table, or an extra table), the fields, indexes, and so forth 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.
The 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> <!ATTLIST application name CDATA #REQUIRED version CDATA #REQUIRED > <!ELEMENT db (options)> <!ELEMENT dbtables (rdr*, aggtable*, table*)> <!ELEMENT table (options?, fields, indexes?)> <!ATTLIST table name CDATA #REQUIRED dbtabname CDATA #REQUIRED createtable (true | false) "true" inserttodb (true | false) "false" > <!ELEMENT aggtable (options?, fields, indexes?)> <!ATTLIST aggtable name CDATA #REQUIRED dbtabname CDATA #REQUIRED aggperiod CDATA #REQUIRED createtable (true | false) "true" > <!ELEMENT rdr (options?, fields, indexes?)> <!ATTLIST rdr name CDATA #REQUIRED dbtabname CDATA #REQUIRED tag 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 --> <!ATTLIST field id CDATA #REQUIRED name CDATA #REQUIRED type CDATA #REQUIRED size CDATA #IMPLIED > <!ELEMENT indexes (index+)> <!ELEMENT index (options?)> <!ATTLIST index name CDATA #REQUIRED columns CDATA #REQUIRED create (true | false) "true" > <!ELEMENT options (option+)> <!ELEMENT option EMPTY> <!ATTLIST option property CDATA #REQUIRED value CDATA #REQUIRED >
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.
The ragadapter.conf File
RAG Adapter general maintenance is performed using 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.1.0
The ragadapter.xml File
The following code is a sample of the configuration possibilities of the RAG Adapter.
<?xml version="1.0"?> <!DOCTYPE ragadapterconf [ <!ELEMENT ragadapterconf (fileversion, config)> <!ELEMENT fileversion (#PCDATA)> <!ELEMENT config (aggregations, sinks)> <!ELEMENT aggregations (aggregation+)> <!ELEMENT aggregation (bucketident, closures, accumulators, monitors)> <!ATTLIST aggregation id CDATA #REQUIRED intag CDATA #REQUIRED outtag CDATA #REQUIRED sinkid CDATA #REQUIRED > <!ELEMENT bucketident (field+)> <!ELEMENT closures (closure*)> <!ELEMENT closure (closurespec+)> <!ATTLIST closure field CDATA #REQUIRED > <!ELEMENT closurespec (equivvalue+)> <!ATTLIST closurespec type (string | int | long | double) #REQUIRED primaryvalue CDATA #REQUIRED > <!ELEMENT equivvalue EMPTY> <!ATTLIST equivvalue val CDATA #REQUIRED > <!ELEMENT accumulators (field+)> <!ELEMENT monitors (changemonitor | maxmonitor | timeoutmonitor)*> <!ELEMENT changemonitor EMPTY> <!ATTLIST changemonitor action (warn | checkpoint) #REQUIRED field CDATA #REQUIRED active (true | false) #REQUIRED > <!ELEMENT maxmonitor EMPTY> <!ATTLIST maxmonitor action (warn | checkpoint) #REQUIRED field CDATA #REQUIRED maxvalue CDATA #REQUIRED active (true | false) #REQUIRED > <!ELEMENT timeoutmonitor EMPTY> <!ATTLIST timeoutmonitor action (warn | checkpoint) #REQUIRED maxsec CDATA #REQUIRED active (true | false) #REQUIRED > <!ELEMENT field EMPTY> <!ATTLIST field index CDATA #REQUIRED type (string | int | long | double) #REQUIRED > <!ELEMENT sinks (csvsink | dbsink | generalsink)+> <!ELEMENT csvsink EMPTY> <!ATTLIST csvsink id CDATA #REQUIRED classname CDATA #REQUIRED filenameformat CDATA #REQUIRED dirname CDATA #REQUIRED maxagesec CDATA #REQUIRED maxlines CDATA #REQUIRED usequotes (true | false) #REQUIRED active (true | false) #REQUIRED > <!ELEMENT dbsink EMPTY> <!ATTLIST dbsink id CDATA #REQUIRED classname CDATA #REQUIRED active (true | false) #REQUIRED > <!ELEMENT generalsink EMPTY> <!ATTLIST generalsink id CDATA #REQUIRED classname CDATA #REQUIRED active (true | false) #REQUIRED > ]> <ragadapterconf> <fileversion> $File: ragadapter.xml $ $Revision: #3 $ $Author: ronv $ $DateTime: 2005/08/15 15:48:23 $ </fileversion> <config> <aggregations> <aggregation id="NUR's by subscriber and subs usage counter" intag="4042321920" outtag="71070" sinkid="csv1"> <bucketident> <!-- SUBSCRIBER_ID=0, SUBS_USG_CNT_ID=2 --> <field index="0" type="string"/> <field index="2" type="int"/> </bucketident> <closures> <closure field="0"> <closurespec type="string" primaryvalue="GuyM"> <equivvalue val="RonK"/> <equivvalue val="OmerT"/> <equivvalue val="GuyM"/> </closurespec> <closurespec type="string" primaryvalue="OdedE"> <equivvalue val="NimrodR"/> <equivvalue val="YossiO"/> <equivvalue val="LironL"/> </closurespec> </closure> <closure field="2"> <closurespec type="int" primaryvalue="15"> <equivvalue val="5"/> <equivvalue val="6"/> <equivvalue val="7"/> </closurespec> </closure> </closures> <accumulators> <!-- up=8, down=9, sessions=10 --> <field index="8" type="long"/> <field index="9" type="long"/> <field index="10" type="long"/> </accumulators> <!-- nothing to monitor for change in NUR really. For sake of testing, let's warn if DURATION changes. --> <monitors> <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"/> </monitors> </aggregation> <aggregation id="NUR's by subscriber only" intag="4042321920" outtag="71071" sinkid="dbsink1"> <bucketident> <field index="0" type="string"/> </bucketident> <closures/> <accumulators> <field index="8" type="long"/> <field index="9" type="long"/> <field index="10" type="long"/> </accumulators> <monitors> <timeoutmonitor action="checkpoint" maxsec="60" active="true"/> </monitors> </aggregation> </aggregations> <sinks> <csvsink id="csv1" 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"/> <dbsink id="dbsink1" classname="com.cisco.scmscm.adapters.rag.sinks.JDBCSink" active="false"/> </sinks> </config> </ragadapterconf>
Posted: Wed May 30 11:59:22 PDT 2007
All contents are Copyright © 1992--2007 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.