Managing the Collection Manager
Introduction
This chapter explains how to use utility scripts to view and update Collection Manager (CM) parameters.
Any machine connected to the Collection Manager through, for example, Telnet or SSH, can use utility scripts to monitor and manage the Collection Manager. The utility scripts are located in the installation directory of the Collection Manager.
For information on managing the database and the CSV repository, see Chapter 5 "Managing Databases and the Comma Separated Value Repository."
•
Using Utility Scripts
•
Collection Manager Support Information
•
Configuring the Collection Manager
•
Monitoring System Health
•
Monitoring the Collection Manager
Using Utility Scripts
General instructions for using utility scripts include:
•
To invoke any script, log in as the scmscm user, except where otherwise noted. If you attempt to run these scripts as the root user, the script generates an error.
•
To display a description of the script, with an explanation of all flags and parameters, invoke the script with the help flag.
Note
Specify the help flag differently depending on the script. To manage the Collection manager, specify -help. To manage the database, specify -h. See the definition for each script.
The following example shows how to display a description of the dbperiodic.sh script:
>~scmscm/scripts/dbperiodic.sh --help
Usage:
~scmscm/scripts/dbperiodic.sh --nf --load
load configuration from
/export/home/scmscm/db_maint/nf-dbperiodic.conf
~scmscm/scripts/dbperiodic.sh --nf --loadfile=FILE
load configuration from FILE
~scmscm/scripts/dbperiodic.sh --dump
print the current configuration in INI format to standard output
~scmscm/scripts/dbperiodic.sh --help
print this help message
Collection Manager Support Information
If you are experiencing difficulties with the Collection Manager installation, you might need to provide the Cisco Technical Assistance Center (TAC) with information about the current system setup. The Collection Manager can create the required support information or files for TAC by running one of the following scripts:
•
~scmscm/unsupported/getinfo/get_cm_info.sh—This script creates the Collection Manager support information.
•
~scmscm/unsupported/getinfo/get_support_files.sh—This script creates a support file.
The output is a zip file with the investigation supporting files. The following example shows the output that results from running this script:
bash-2.05$ ~scmscm/unsupported/getinfo/get_support_files.sh
Gathering support files into Sun_14_Oct_2007_06-05-03_PM_JST.zip, please
wait................done.
The generated support file contains the output of
~scmscm/unsupported/getinfo/get_cm_info.sh
Configuring the Collection Manager
Use utility scripts to:
•
Specify which servers to activate at startup.
•
Start or stop the database.
•
Start or stop an adapter.
•
Drop a Cisco ASR 1000 Series connection.
Use the following scripts to configure the Collection Manager:
•
~scmscm/setup/on-boot.sh
•
~scmscm/scripts/nf-adapterconf.sh
•
~scmscm/scripts/dbconf.sh
For information about scripts for managing the database and the CSV repository, see Chapter 5 "Managing Databases and the Comma Separated Value Repository."
Use the following files to configure the Collection Manager:
•
nf.conf—General configuration of the Collection Manager, including the adapters to turn on when the Collection Manager starts. See the "Enabling Adapters" section.
•
nf-queue.conf—Configuration of the adapter queues, including the tags that are associated with a specific adapter. See the "Monitoring System Health" section.
•
Activating Servers
•
Controlling Adapters
•
Enabling Adapters
•
Configuring Databases
•
Managing INI values for NetFlow
Activating Servers
To specify the servers (Collection Manager or Sybase) that are activated at startup, use the on-boot.sh script:
~scmscm/setup/on-boot.sh --cm=flag --sybase=flag
Changes take effect the next time the system restarts.
Note
To view the current startup status of each component, run the script with no parameters.
To restart the Collection Manager, run the following script as the scmscm user:
~scmscm/cm/bin/cm restart_nf
Table 4-1 on-boot.sh Options
|
Activate or do not activate the Collection Manager at startup. |
|
Activate or do not activate the Sybase server at startup. |
The following example shows how to set the Collection Manager and Sybase servers to run at startup. (This setting is the default setting of the script.)
>~scmscm/setup/on-boot.sh --cm=on --sybase=on
Controlling Adapters
To shut down or activate a configured adapter, use the adapterconf.sh script. You can use the adapterconf.sh script to list the Collection Manager adapters that are currently running:
~scmscm/scripts/nf-adapterconf.sh --op=action [ --adapter=adapter name ]
Table 4-2 adapterconf.sh Options
|
Activate the adapter specified by the adapter parameter. |
|
Shut down the adapter specified by the adapter parameter. |
|
List the Collection Manager adapters that are currently running. |
|
Identify the adapter you want to control. Use only with the start and stop options. |
|
Display these options. |
To shut down an adapter, as the scmscm user, run the following script:
~scmscm/scripts/nf-adapterconf.sh --op=stop --adapter=adapter name
To activate an adapter, as the scmscm user, run the following script:
~scmscm/scripts/nf-adapterconf.sh --op=start --adapter=adapter name
Enabling Adapters
To configure an adapter to turn on when the Collection Manager starts, remove the remark character at the start of the appropriate line in the cm.conf file.
The following example shows how to configure the CSV adapter to remain off when the Collection Manager starts.
#adapter.2 = com.cisco.scmscm.netflow.adapters.CSVAdapter
Note
The value of the adapter.<number> must match the adapter_id parameter value configured in the queue.conf file for the corresponding adapter.
Configuring Databases
To configure a database, run the dbconf.sh script:
~scmscm/scripts/dbconf.sh --nf
The script prompts you to choose the database type and the corresponding database configuration parameters.
The following example shows how to run the dbconf.sh script to configure the Collection Manager.
$ ~scmscm/scripts/dbconf.sh --nf
3 - Sybase (external not bundled)
Enter Oracle server host (current is localhost) :10.56.216.80
Enter Oracle server listening port (current is 1521) :
Enter Oracle server instance id (current is avocado) :
Enter CM schema user name (current is pqb_admin) :
Enter CM schema user password (current is pqb_admin) :
Do you want to test the DB connection? (yes/no): yes
Note
Restart the Cisco Collection Manager for the change to take place.
Note
By default, the Collection Manager handles database related transactions in uppercase table names. However, in a Windows based MySql server, table names are stored in lowercase and name comparisons are not case-sensitive; and, it automatically converts all table names to lowercase. If you are using a Windows based database server, you need to modify the lower_case_table_names server configuration entry.
Managing INI values for NetFlow
The Cisco Collection Manager automatically updates the INI_VALUES for a specific Cisco ASR 1000 Series Router with the option template values received from that Cisco ASR 1000 Series Router. A script is included in the Cisco Collection Manager distribution that enables you to manage INI_VALUES for a specific Cisco ASR 1000 Series Router.
In Cisco Collection Manager 3.7.0, the application attributes mapping in NF_INI_VALUES table is populated as y or n format. This format is changed to Yes or No in Cisco IOS XE 3.5 version onwards. While upgrading the Cisco Collection Manager 3.7.0 to later versions along with Cisco IOS XE 3.5, the NF_INI_VALUES will contain both the y/n and Yes/No format data for the Cisco ASR 1000 Series router. This results in duplication while generating reports.
The duplicate entries with (y/n) format needs to be removed from NF_INI_VALUES table by using the below option.
~scmscm/cm/bin/updateNetFlowMap.sh --nf=<< ASR1K IP >> --rem=[value_type]
Example:
~scmscm/cm/bin/updateNetFlowMap.sh --nf=1.1.1.1 --rem=114
This will remove the entries with the value_type as 114 and ip as 1.1.1.1 and value_key as either y or n
~scmscm/cm/bin/updateNetFlowMap.sh --nf=1.1.1.1 --rem=114-119
This will remove the entries with the value_type from 114 to 119 and ip as 1.1.1.1 and value_key as either y or n
Monitoring System Health
The Collection Manager contains a small, expandable framework that monitors the system and issues alerts for predefined, potentially problematic conditions.
Use the following scripts to monitor the Collection Manager:
•
~scmscm/setup/monitor/setup-monitor.sh
•
~scmscm/setup/monitor/monitor.sh
Installing the Periodic Checker
To insert (or remove) an entry for monitor.sh, the periodic checker script, in the cron (periodic scheduler) subsystem, run the setup-monitor.sh script:
~scmscm/setup/monitor/setup-monitor.sh -a flag [ -i flag ]
Table 4-3 setup-monitor.sh Options
-a { install | uninstall }
|
Insert or remove an entry for monitor.sh in the cron. |
-I { 30m | 1h | 12h | 24h }
|
Run monitor.sh every 30 minutes, 1 hour, 12 hours, or 24 hours. |
The following example shows how to install monitor.sh so that it runs every 30 minutes.
$ ./setup-monitor.sh -a install -I 30m
The following example shows how to uninstall monitor.sh.
$ ./setup-monitor.sh -a uninstall
Periodic Checker Script
The following sections provide information on the periodic checker script:
•
Periodic Checker Script
•
Tests
Periodic Checker Script
The periodic checker script, monitor.sh, calls a series of subscripts that monitor different aspects of a running system:
~scmscm/setup/monitor/monitor.sh { -a | TEST NAME } [ -v ] [ -d ]
The script is not intended to be run from the command line, although you can do so. The script sends test results to the syslog subsystem and logs the results in the file /var/log/messages.
Table 4-4 monitor.sh Options
|
Run all tests. |
|
The names of one or more tests. A test name is the test filename, without the leading digits and trailing .sh. |
|
Output results in verbose mode. (Log successful tests.) |
|
Print results to window. (By default, results are sent to syslog.) |
Any test returns a result in the following format:
•
STATUS—PASS or FAIL
•
Message—A short informative status message
For example, FAIL: db "avocado" has only 1523 free blocks
The following example shows how to run all available tests and print system output to the window:
Test: 01free_db.sh. Status: PASS. Message: db avocado has 1532 free blocks
Test: 02cm_is_up.sh. Status: FAIL. Message: cm process is not running
The following example shows how to run one test to check that the installed database has sufficient free space:
$ ./monitor.sh -d free_db
Test: 01free_db.sh. Status: PASS. Message: db avocado has 1532 free blocks
Tests
You can run the following tests using monitor.sh:
•
db_up—Checks that the Collection Manager database is running.
•
cm_up—Checks that the Collection Manager application is running.
•
free_db—Checks that the bundled Sybase database has at least 10-percent free space.
•
free_log—Checks that the bundled Sybase database transaction log has at least 70-percent free space.
•
cm_persistent_buffers—Checks that the persistent buffer of each Collection Manager adapter contains less than 500 files.
The scripts for all these tests are located in the ~/setup/monitor/tests directory.
When calling a test called test_name, the script expects to find a file called NNtest_name.sh, where NN is a number that denotes script priority. For example, the test free_db is mapped to the file 01free_db.sh.
Monitoring the Collection Manager
You can use scripts to monitor system statistics that are relevant to the Collection Manager, such as:
•
Percentage of free space in the database
•
Cisco ASR 1000 Series platform connection data
•
Viewing database insertion rate statistics per table
•
Viewing version information
Use the following scripts to monitor the Collection Manager:
•
~scmscm/scripts/dbfree.sh
•
~scmscm/scripts/nf-rate.sh
•
~scmscm/setup/alive.sh
•
~scmscm/cm/bin/cm version
•
~scmscm/cm/bin/cm dbversion
Use the following scripts to configure the Collection Manager (see the "Configuring the Collection Manager" section). You can also run these scripts to display the relevant configuration:
•
~scmscm/setup/on-boot.sh
•
~scmscm/scripts/nf-adapterconf.sh
Checking the Database Capacity
To display the percentage of free space in the database report tables and the associated transaction log, run the dbfree.sh script:
~scmscm/scripts/dbfree.sh --nf
Use the script only with bundled Sybase and MySQL databases.
Step 1
Run the dbfree.sh script.
Verifying Server Operation
To verify that the server is functioning correctly, run the alive.sh script:
The script verifies that the following components are operational:
•
Collection Manager
•
Database (in the bundled database case)
•
Report tables (in the bundled database case)
If any component is down, the script issues an error message.
Step 1
As the user, run the alive.sh script
Note
It takes time for the components to initialize after a startup. After a restart, wait 5 minutes before running this script.
Viewing Version Information
The Collection Manager includes two scripts to display the current version of the Collection Manager and of the database:
•
cm version
•
cm dbversion
The following example shows how to view the current Collection Manager version:
$ ~scmscm/cm/bin/cm version
CM CD Version 3.7.5 Build 104
The following example shows how to view the current database version:
$ ~scmscm/cm/bin/cm dbversion