- About this Guide
- Cisco Service Control Overview
- Getting Started
- Using the Cisco Service Control Application Reporter
- Managing Report Instances
- Working with Reports
- The SCA Reporter Command-Line Interface
- Installing and Upgrading SCA Reporter Templates
- Troubleshooting
- SCA Reporter as a Tool in the SCA BB Console
- SCA Reporter Templates
The SCA Reporter Command-Line Interface
Introduction
This chapter describes the various ways of using the Cisco Service Control Application Reporter (SCA Reporter) Command-Line Interface (CLI) for executing the SCA Reporter features, including the syntax, switches, and options of the application.
•Command-Line Interface Overview
Command-Line Interface Overview
The SCA Reporter Command-Line Interface (CLI) is a command-line application that complements the functionality of the SCA Reporter GUI. You can integrate the CLI, which provides capabilities and flexibility beyond that of its SCA Reporter GUI counterpart, into third-party applications to generate usage-based and statistics-based output.
The CLI includes the following features:
•Runs under Windows or Linux
•Runs predefined report instances or uses report templates
•Allows prescheduling of periodic generation of reports
Prescheduled Reports
You can use the Reporter CLI to produce selected reports periodically. You must configure an external scheduling utility (for example, cron, PyCron, or Windows scheduler) to do produce selected reports periodically. You can use either an existing report instance or a report template, as explained in various sections in this chapter.
The following shows an example of a cron line to produce a "Global Bandwidth per Service" report every hour:
20 * * * * reportercmd -report "Global Bandwidth per Service #1" -params \ "numhours=24;units=Mbit/s;avgdata=true;trafficdir=Both Directions" \ -format jpeg -o GBpS1.jpeg
Syntax and Usage
You can execute the SCA Reporter as a command-line version that accepts input passed as parameters. In the Templates view, you can create a CLI command, either from a report instance or from a report template. The database information and the Cisco SCE platform IP parameters are included in the created CLI command, in addition to configured parameters.
When you create the command, it is automatically copied to the clipboard. You can now paste the command into a command file shell or a command prompt and then execute it after making any necessary changes. You must then add the file name in which to save the data and the format in which to save it. These parameters are not included when the command is created.
Not all parameters that exist in the original report instance are included in the params switch. When a parameter is not listed in the CLI invocation, and:
•If the command is based on a report instance, the value is taken from the report instance.
•If the command is based on a report template, the default value is used. (You must define the values of mandatory parameters that do not have default values.)
•How to Generate Reporter Commands for a Report Instance
•How to Generate Reporter Commands for a Report Template
Command-Line Usage
You can invoke the SCA Reporter application for a report instance using a command such as:
reportercmd -report "Global Bandwidth per Service #1" -dbdriver "com.mysql.jdbc.Driver" -dburl "jdbc:mysql://10.56.201.89:3306/apricot" -dbuser "pqb_admin" -dbpassword "pqb_admin" -policysce "10.56.201.87" -params "titleText=Global Bandwidth per Service;services=Flash Yahoo,HTTP,Google Talk File Transfer,Other Flash;numhours=24000;trafficdir=Both Directions;link=Link 0,Link 1;showSce=false;avgdata=true;units=Mbps" -o "myfile" -format "jpeg"
You can invoke the SCA Reporter application for a report template using a command such as:
reportercmd -template "Global Bandwidth per Service" -dbdriver "com.sybase.jdbc3.jdbc.SybDriver" -dburl "jdbc:sybase:Tds://10.56.99.13:4100" -dbuser "pqb_admin" -dbpassword "pqb_admin" -policysce "10.56.98.10" -params "endtime=2008-04-13 10:46:20;titleText=Global Bandwidth per Service;services=Flash Yahoo,HTTP,Google Talk File Transfer,Other Flash;numhours=24000;starttime=2008-04-12 10:46:20;trafficdir=Both Directions;seip=10.56.201.87;link=Link 0,Link 1;showSce=false;avgdata=true;units=Mbps" -hierarchy services;1 -o "myfile" -format "jpeg"
You can generate a string to serve as the basis for a CLI command from the SCA Reporter. The generated command does not include the -o
and -format
parameters, which must be added to the command. You can also modify other parameters.
Command-Line Switches
The following switches can be included in the command line when invoking the SCA Reporter application:
•-report
–-dbdriver
–-dburl
–-dbuser
–-dbpassword
–-policysce
–-params
–-o
–-format
–-show
•-template
–-dbdriver
–-dburl
–-dbuser
–-dbpassword
–-policysce
–-params
–-o
–-format
–-show
•-help
•-list
Command-Line Options
Table 6-1 describes the options of the command line for invoking the SCA Reporter application:
How to Generate Reporter Commands for a Report Instance
Step 1 Select a report instance from the Templates view.
Step 2 From the drop-down menu in the tab, select Show Cmd.
A Command line invocation dialog box appears, see Figure 6-1, displaying the generated command.
Figure 6-1 Command Line Invocation Dialog

Step 3 Click OK.
The command, with all the switches and parameters, is placed on the clipboard.
Step 4 Open a file or command prompt.
Do one of the following:
•Open a file from which to execute the command from a shell and save the file in the Reporter directory.
•Open a command prompt from which to execute the CLI command and change the directory to the Reporter directory.
Step 5 Paste the clipboard contents.
The command is pasted in the file or in the command line.
Step 6 Add the mandatory flags.
•-o "filename"
•-format "fileformat"
Step 7 (Optional) Change parameters. For example, you may want to change the numhours parameter, see Figure 6-2.
Figure 6-2 Change Parameters Example

Step 8 Execute the command.
The exported file is saved in the defined directory with a time stamp appended to the name of the report instance.
How to Generate Reporter Commands for a Report Template
Step 1 Select a report template from the Templates view.
Step 2 From the drop-down menu in the tab, select Show Cmd, see Figure 6-3.
A Command line invocation dialog box appears, displaying the generated command.
Figure 6-3 Command Line Invocation Dialog

Parameters that have default values are given the default value. A value of ___ (underscore) indicates mandatory parameters that do not have default values.
Step 3 Click OK.
The command, with all the switches and parameters, is placed on the clipboard.
Step 4 Open a file or command prompt.
Do one of the following:
•Open a file from which to execute the command from a shell and save the file in the Reporter directory.
•Open a command prompt from which to execute the CLI command and change the directory to the Reporter directory.
Step 5 Paste the clipboard contents.
The command is pasted in the file or in the command line.
Step 6 Add the mandatory flags.
•-o "filename"
•-format "fileformat"
Step 7 (Optional) Change parameters. For example, you may want to change the numhours parameter, see Figure 6-4.
Figure 6-4 Change Parameters Example

Step 8 Execute the command.
The exported file is saved in the defined directory with a time stamp appended to the name of the report instance.