Table Of Contents
Info Gateway Command Reference
Reader Commands
START READER
Syntax
Usage
Example
STOP READER
Syntax
Usage
Example
SHOW READERS
Syntax
Usage
Example
ORDER BY
Syntax
Usage
Example
AFTER IDUC DO
Syntax
Usage
Example
Writer Commands
START WRITER
Syntax
Usage
Example
STOP WRITER
Syntax
Usage
Example
SHOW WRITERS
Syntax
Usage
Example
SHOW WRITER TYPES
Syntax
Usage
Example
SHOW WRITER ATTRIBUTES
Syntax
Usage
Example
Mapping Commands
CREATE MAPPING
Syntax
Usage
Example
DROP MAPPING
Syntax
Usage
Example
SHOW MAPPINGS
Syntax
Usage
Example
SHOW MAPPING ATTRIBUTES
Syntax
Usage
Example
Filter Commands
CREATE FILTER
Syntax
Usage
Example
LOAD FILTER
Syntax
Usage
Example
DROP FILTER
Syntax
Usage
Example
Route Commands
ADD ROUTE
Syntax
Usage
Example
REMOVE ROUTE
Syntax
Usage
Example
SHOW ROUTES
Syntax
Usage
Example
Resynchronization Commands
RESYNC
Syntax
Usage
Example
UNIRESYNC
Syntax
Usage
Example
Configuration Commands
LOAD CONFIG
Syntax
Usage
Example
SAVE CONFIG
Syntax
Usage
Example
DUMP CONFIG
Syntax
Usage
Example
General Commands
SHUTDOWN
Syntax
Usage
Example
SET CONNECTIONS
Syntax
Usage
Example
SHOW SYSTEM
Syntax
Usage
Example
SET DEBUG MODE
Syntax
Usage
Example
TRANSFER
Syntax
Usage
Example
Info Gateway Command Reference
This appendix lists all of the Info Gateway commands. It contains the following sections:
•
"Reader Commands"
•
"Writer Commands"
•
"Mapping Commands"
•
"Filter Commands"
•
"Route Commands"
•
"Resynchronization Commands"
•
"Configuration Commands"
•
"General Commands"
Reader Commands
This section describes the Reader related commands.
START READER
Syntax
START READER <reader_name> CONNECT TO <server_name> [USING FILTER <filter_name>];
Usage
Starts a Reader to be named <reader_name> that connects to a Cisco Info Server named <server_name>.
An optional filter may be applied by specifying USING FILTER followed by the name of a filter (<filter_name>).
Example
START READER NCOMS_READ CONNECT TO NCOMS USING FILTER CRIT_ONLY;
STOP READER
Syntax
STOP READER <reader_name>;
Usage
Stops the Reader named <reader_name>. This command stops the Reader when the Reader is in use with any routes.
Example
SHOW READERS
Syntax
Usage
Lists all the current Readers running on the Info Gateway. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
ORDER BY
Syntax
ORDER BY [,'criteria']...;
Usage
Changes the order of events read from the Cisco Info Server. The events are ordered according to the criteria supplied.
Example
START READER SERVER_READER CONNECT TO NAME
ORDER BY 'Severity Desc';
AFTER IDUC DO
Syntax
Usage
Forces the Info Gateway to perform an update in the Cisco Info Server when it places events in the Writer queue. This is used to provide feedback when events pass through an Info Gateway.
Example
START READER NCOMS_READER CONNECT TO NCOMS USING FILTER MY_FILTER
ORDER BY 'SERIAL ASC' AFTER IDUC DO 'update alerts.status set Grade=2';
This example uses the Grade field as a state field. Initially, all Info Mediators set this field to Grade=0. The Info Gateway filters any events that have a Grade=1. After the events have passed through the Info Gateway, the IDUC command provides event state feedback by changing the Grade field to Grade=2.
Note, you need not use a WHERE clause as the Info Gateway only updates the rows selected by the filter.
Writer Commands
This section describes the Writer related commands.
START WRITER
Syntax
START WRITER writer_name (TYPE=writer_type, REVISION=number [ , keyword_setting
[ , keyword_setting]... ]);
Usage
Starts a Writer to be named writer_name. This is followed by a set of comma separated keyword settings. The keyword settings must start with a TYPE setting followed by a writer_type. This should be followed by a comma. Following this should be a REVISION setting (which is currently 1). For more information about the Writer types currently available, see "Using Info Gateways."
Example
The example shown starts a Writer for Remedy ARS (Action Request System):
FEEDBACK_FIELD = 'Location'
STOP WRITER
Syntax
STOP WRITER <writer_name>;
Usage
Stops a Writer called <writer_name>. When any route is using this Writer, the Writer is not stopped.
Example
SHOW WRITERS
Syntax
Usage
Lists all current Writers in the Info Gateway. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
Name Type Routes Msgq Id Mutex Id Thread
----------- ---- ------ ------- -------- ------
SNMP_WRITER SNMP 1 15 0 0x001b8cd0
SHOW WRITER TYPES
Syntax
Usage
Lists all the currently known types of Writers supported by the Info Gateway. This command is for interactive use only and returns an error when used in any other circumstances.
Example
Type Revision Description
------ --------- -----------------------
ARS 1 Action Request System V2.0
INFO_SERVER 1 Cisco Info Center ObjectServerV3.3
SYBASE 1 Sybase SQL Server 10.0 RDBMS
SNMP 1 SNMP Trap forwarder
SERVICE_VIEW 1 Service View
SHOW WRITER ATTRIBUTES
Syntax
SHOW WRITER [ATTRIBUTES | ATTR] FOR <writer_name>;
Usage
Shows all the settings (attributes) of the Writer named <writer_name>. The ATTRIBUTES keyword is interchangeable with the shorter ATTR keyword. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
1> SHOW WRITER ATTR FOR SNMP_WRITER;
----------- ------------------
Mapping Commands
This section describes the Mapping related commands.
CREATE MAPPING
Syntax
CREATE MAPPING <mapping_name> (mapping [ , mapping ]);
Usage
Creates a mapping file to be named <mapping_name> for use by a Writer.
Mapping lines have the following syntax:
[string | integer] = [string | integer | name | real | boolean] [ON INSERT
ONLY] [CONVERT TO [INT | STRING | DATE]
where the first argument is an identifier for the destination field and the second argument is an identifier for the source field (or some preset value).
The right hand side of the mapping is dependent on the Writer the mapping is to be used with. See the appropriate Writer section in this manual.
ON INSERT ONLY adjusts the update behavior of the mapping. Without the ON INSERT ONLY tag, the field is updated every time a change is registered on an alert. With the ON INSERT ONLY tag, the field is written to at creation time (that is, when the alert appears for the first time), however, it is not updated on subsequent updates of the alert even when the field referred to is changed.
The optional CONVERT TO type allows the mapping to define a forced conversion for situations where a source field may not match the type of the destination field. Type can be INTEGER, STRING, or DATE to force the source field to be converted to an integer, string, or date type.
Example
CREATE MAPPING SYBASE_MAP
'Node'='@Node' ON INSERT ONLY,
'Summary'='@Summary' ON INSERT ONLY,
DROP MAPPING
Syntax
DROP MAPPING <mapping_name>;
Usage
Removes the mapping named <mapping_name> from the Info Gateway. This command does not drop the map when it is being used by a Writer.
Example
SHOW MAPPINGS
Syntax
Usage
Lists all the mappings currently created within the Info Gateway. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
----------------------------
SHOW MAPPING ATTRIBUTES
Syntax
SHOW MAPPING [ATTRIBUTES | ATTR] FOR <mapping_name>;
Usage
Shows the mappings (attributes) of the mapping named <mapping_name>. The ATTRIBUTES keyword is interchangeable with the shorter ATTR keyword. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
SHOW MAPPING ATTR FOR SYBASE_MAP;
Filter Commands
This section describes the Filter related commands.
CREATE FILTER
Syntax
CREATE FILTER <filter_name> AS <filename>;
Usage
Creates a filter for use by a Reader that is named <filter_name>. The filter uses <filename> as its filter specification. The <filename> should be the expression part of a Cisco Info Server SQL statement.
Example
CREATE FILTER HIGH_TALLY_LOG AS 'Tally > 100';
LOAD FILTER
Syntax
LOAD FILTER FROM 'filename';
Usage
Loads a filter (a .elf file as created by the Filter Builder) from a file. The name of the filter is the name specified in the Filter Builder field.
Example
LOAD FILTER FROM '/disk/filters/newfilter.elf';
DROP FILTER
Syntax
DROP FILTER <filter_name>;
Usage
Removes the filter named <filter_name> from the Info Gateway. The filter is not dropped when it is being used by a Reader.
Example
DROP FILTER HIGH_TALLY_LOG;
Route Commands
This section describes the Route related commands.
ADD ROUTE
Syntax
ADD ROUTE FROM <reader_name> TO <writer_name>;
Usage
Adds a route between a Reader named <reader_name> to a Writer named <writer_name> to allow alerts to pass through the Info Gateway.
Example
ADD ROUTE FROM NCOMS_READER TO ARS_WRITER;
REMOVE ROUTE
Syntax
REMOVE ROUTE FROM <reader_name> TO <writer_name>;
Usage
Removes an existing route between a Reader named <reader_name> and a Writer named <writer_name>.
Example
REMOVE ROUTE FROM NCOMS_READER TO ARS_WRITER;
SHOW ROUTES
Syntax
Usage
Shows all currently configured routes within the Info Gateway. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
---------------- ---------------------
Resynchronization Commands
This section describes the Resynchronization related commands.
RESYNC
Syntax
RESYNC <WRITERNAME>, <WRITERNAME> [MASTER=<WRITERNAME>] [PREFER=<WRITERNAME>];
Usage
Resynchronizes a bidirectional Info Gateway. You must supply the names of the two Cisco Info Server Writers in your bidirectional Info Gateway, however, the MASTER and PREFER parameters are optional.
When you do not specify a MASTER or PREFER parameter, the RESYNC command checks the two Cisco Info Servers and works out which has been running for the longest. This Cisco Info Server becomes the master, the other becomes the slave. The command then deletes the contents of the slave Cisco Info Server and populates it with the contents of the master Cisco Info Server.
When you know which Cisco Info Server has been running for the longest, you can use the optional MASTER parameter to specify it as the master server.
Example
RESYNC DENCO_WRITER, NCOMS_WRITER MASTER=NCOMS_WRITER;
UNIRESYNC
Syntax
UNIRESYNC <READERNAME> <WRITERNAME>;
Usage
UNIRESYNC checks the contents of the two Cisco Info Servers connected through the Reader and Writer specified and, when necessary, re-synchronizes them.
Example
UNIRESYNC DENCO_READER NCOMS_WRITER;
Configuration Commands
This section describes the Configuration related commands.
LOAD CONFIG
Syntax
LOAD CONFIG FROM '<filename>' ;
Usage
Loads an Info Gateway configuration file from a file named in <filename>.
Example
LOAD CONFIG FROM '/disk/config/gateconf.conf';
SAVE CONFIG
Syntax
SAVE CONFIG TO '<filename>';
Usage
Saves the current configuration of the Info Gateway into a file named in <filename>.
Example
SAVE CONFIG TO '/disk/config/newgate.conf';
DUMP CONFIG
Syntax
Usage
Clears the current configuration. When the Info Gateway is active and transferring alerts, this command does not clear the configuration unless the optional keyword FORCE is used.
Example
General Commands
This section describes the general use commands.
SHUTDOWN
Syntax
Usage
Sets the Info Gateway to shutdown; all Readers and Writers are stopped. This command does not shut down the Info Gateway when interactive changes to the configuration have not been saved. See "SHOW SYSTEM" section for details on how to determine when the configuration has been changed interactively). The optional FORCE keyword overrides that behavior and shuts down the Info Gateway, even when the configuration has been changed interactively.
Example
SET CONNECTIONS
Syntax
SET CONNECTIONS [TRUE | FALSE | YES | NO];
Usage
Sets the availability of interactive connections to the Info Gateway. Setting to FALSE or NO disables the facility to log in to the Info Gateway with nco_sql. Setting to TRUE or YES enables that facility. This command is provided to allow a configuration file to lock the Info Gateway from interactive reconfiguration.
Example
SHOW SYSTEM
Syntax
Usage
Displays information about the current Info Gateway settings. The parameters returned are shown in Table H-1.
Table H-1 Show Info Gateway System Parameters
System Parameter
|
Description
|
Version
|
Version number of the Info Gateway.
|
Server Type
|
Type of server - should be Info Gateway.
|
Connections
|
Status of the SET CONNECTIONS flag (see "SET CONNECTIONS" section).
|
Debug Mode
|
Status of the SET DEBUG MODE flag (see the "SET DEBUG MODE" section).
|
Multi User
|
Info Gateway multi-user mode - should be YES.
|
Configuration Changed
|
When the configuration has been changed interactively, this is YES.
|
More parameters may be returned when in debug mode. This command is designed for interactive use only and returns an error when used in any other circumstances.
Example
---------------- -------------------------------
SET DEBUG MODE
Syntax
SET DEBUG MODE [TRUE | FALSE | YES | NO];
Usage
Sets the debugging mode of the Info Gateway. Setting to TRUE or YES enables debugging messages to be sent to the log file. Default setting for this is NO or FALSE. This command should only be used under the advice of technical support for problem determination.
Example
TRANSFER
Syntax
TRANSFER '<tablename>' FROM <readername> TO <writername> [AS '<tableformat>'] [DO NOT
DELETE | DELETE | DELETE condition];
Usage
Transfers the contents of one database table to another database table. You can use this command to transfer tables between Sybase, Oracle, Informix, and Cisco Info Server tables.
The tableformat variable specifies the format of the destination table when it is different from the source table format. The optional DO NOT DELETE and DELETE parameters define how the destination table is processed. When DELETE is specified, the contents of the destination table is deleted before the contents of the source table are transferred. When DO NOT DELETE is specified, the contents of the destination server are not deleted before the contents of the source table are transferred.
Example
TRANSFER 'alerts.conversions' FROM NCO_READER TO SYBASE_WRITER AS 'alerts.conversions'
DELETE;