Guest

Cisco Embedded Automation Systems

Cisco Embedded Automation Systems (EASy): Test Network Management Notifications

  • Viewing Options

  • PDF (364.8 KB)
  • Feedback

What You Will Learn

This Embedded Automation Systems (EASy) package helps enable network administrators and operators to test network management system (NMS) notification protocols such as syslog, Simple Network Management Protocol (SNMP) traps, email, and Smart Call Home. The package will verify that the configuration is in place to send these notifications and to generate test messages, which users can then confirm are received by network management servers.

Challenge

It is important to configure devices to send notifications to alert administrators and operators to events occurring on the devices. These notifications may be syslog messages, SNMP traps, email messages, or Smart Call Home updates. During the initial deployment, it is important that you make sure that the device can send these notifications and that the management stations can receive them.

Figure 1. EASy Can Help Simplify Network Management Deployments

Solution: The EASy NMS Tester

The Embedded Event Manager (EEM) can be used to generate test messages to make sure that the device is first properly configured to send these various notifications and that the notifications are received by the network management station. Even after initial deployment, administrators and operators can continue to test these network management notifications to make sure configuration or network changes do not interrupt the ability to properly manage the device.
See Table 1 for an overview of the aspects of the EASy NMS Tester solution.

Table 1. NMS Tester Solution Overview

Application or Service

Network management

Technology

Syslog, SNMP, email, Smart Call Home

Problem

At the time a device is deployed, one wants to test to make sure the device can send notifications to a network management server. Additionally, if notifications stop coming from a device for any reason, configuration auditing and testing must be performed to determine why the notifications have stopped.

Impact

If these notifications cannot be received, then administrators and operators may be unaware of a network problem until it affects business. Being able to get timely notifications will speed understanding and recovery of network problems.

Non-EASy Solution

A manual audit of the configuration would first need to be performed to make sure the proper commands are in place to allow certain notifications to be sent. After that, some kind of event would need to be simulated to trigger a desired notification to be sent.

Benefit of EASy Solution

The EASy package will check the configuration to make sure it has the basic requirements for sending syslog, SNMP trap, email, and Smart Call Home notifications. It will also generate some test messages and give administrators something to check on their network management servers to make sure the notifications were received properly.

Category

Network Management-Diagnostics

Background

The following are the operational steps involved in running the EASy NMS Tester solution. Figure 2 gives a graphical representation of the NMS Tester solution operations.

• The EEM policy is run manually from the device's command line.

• EEM checks to see what notification types need to be tested.

• EEM checks to make sure the configuration is present in order to send the requested notifications.

• EEM generates test notifications and notifies users as to what they should see on the machine that receives the notifications.

• In the case of Smart Call Home, EEM will attempt to confirm whether or not the test was successful and display the results.

Figure 2. NMS Tester Operations

Operational Flow

Figure 3 outlines the specific steps the NMS Tester package will take based on the tests that are configured to run.

Figure 3. Operational flow diagram

Package Components

The EASy NMS Tester package includes only one EEM Tool Command Language (Tcl) policy, no_easy_nmstest.tcl. This policy is run manually from ENABLE mode on a Cisco IOS ® Software device.

Preparing for Installation

Before installing, verify that the following prerequisites are met:

• You have a Cisco IOS Software-based hardware platform with support for EEM 2.1 or higher.

• The easy-installer.tcl script should be copied to the device's flash memory or be available on a network server that the device can reach.

• Create a directory on the device's local flash memory in which EASy packages can be stored (for example, flash:/easy).

• Make the easy-nmstest.tar package available either on the device's flash memory or on a network server that is reachable by the device.

• Optionally, you can create an EXEC alias for the EASy Installer command. For example:

Router#show run | include easy
alias exec easy_installer tclsh flash:/easy-installer.tcl

Installing the Package

Start the EASy Installer either by running the full tclsh command, or by using the EXEC alias (as was listed in the "Preparing for Installation" section). Once the package is loaded, the license verification screen will appear.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Cisco, the name of the copyright holder nor the
names of their respective contributors may be used to endorse or
promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Hit enter to continue...
TECHNICAL ASSISTANCE CENTER (TAC) SUPPORT IS NOT AVAILABLE FOR THIS SCRIPT.
For questions or help, send email to ask-easy@cisco.com.
Hit enter to continue...
Do you agree to this license? (y/n) [n]
You must agree to this license before proceeding. Once you have agreed to the license, the EASy Installer menu will appear.
--------------------------------------------------------------------------------
Configure and Install EASy Package 'easy-nmstest-1.0'
--------------------------------------------------------------------------------
1. Display Package Description
2. Configure Package Parameters
3. Deploy Package Policies
4. Exit
Enter option:
If you enter Option 1, the package description appears.
This package allows one to test various network management notification
protocols on a device. This package can be used to test syslog messages, SNMP traps, email capabilities, and Smart Call Home.
Hit enter to continue...
If you enter Option 2, you will be given a chance to configure the various options of the EASy NMS Tester package. The first thing to configure is whether you want to use command-line interface (CLI) arguments or environment variables to configure the tests. Command-line options are easier to work with, as they do not require any additional device configuration to change the tests to be run or the configuration of those tests. However, if the device does not support EEM 2.4 or later, you must use environment variables to configure the NMS Tester.
Enter option: 2
This device supports EEM 2.4, so command line options can be used. Would
you rather use environment variables? (y/n) [n]:
If you choose to (or you must) use environment variables, you will be prompted to specify the values for each variable depending on what tests you choose to run.

Configuring the Syslog Test

The first question you will see is whether or not you want to run the syslog test. The syslog test will send syslog messages to each configured syslog host based on the severities specified. The syslog facility and severities can be configured, but the mnemonic will always be "LOG". The body of the message is also statically coded to be "This is a test syslog brought to you by the EASy NMS Tester". You can choose to test a range of syslog severities. To do that, specify each severity number separated by a comma. By default, all severities between 0 (emergencies) and 6 (informational) will be tested.
Do you want to run the syslog test (y/n) [y]:
Enter facility to use for syslog test [HA_EM]:
Enter severity or severities for syslog test (separate severities with
commas) [0,1,2,3,4,5,6]:

Configuring the SNMP Trap Test

You do not need to specify any additional parameters for the SNMP trap test. The test will send a cEventMgrPolicyEvent trap (defined in the CISCO-EMBEDDED-EVENT-MGR-MIB) to all trap hosts that are configured to receive such traps. The NMS Tester will check to make sure that event manager traps are enabled and that there is at least one host that can receive them. The trap will contain three customized varbinds. The ceemHistoryPolicyIntData1 varbind will contain the value 3; the ceemHistoryPolicyIntData2 varbind will contain the value 42; and the ceemHistoryPolicyStrData varbind will contain the string, "This is a test trap brought to you by the EASy NMS Tester".

Configuring the Email Test

The email test requires quite a few environment variables to be set. You can choose to specify environment variables specific to the NMS Tester, or you can use systemwide EEM environment variables for the required email attributes. If you already have defined systemwide environment variables to enable EEM policies to send mail, then that option is probably the best. However, if you want to create a set of parameters that will only be used by the NMS Tester, you can. The EASy Installer will allow you to specify the systemwide variables if you choose that path, and those variables do not already exist. Note that when you uninstall the NMS Tester package, these systemwide variables will not be removed. Following is an example of configuring the NMS Tester-specific email variables. The systemwide variable configuration works in a similar fashion.
Enter IP address of SMTP server []: 10.1.1.1
Enter FROM: email address [router@company.com]:
Enter TO: email address(es) (separate addresses with commas)
[noc@company.com]:
Enter CC: email address(es) (optional; separate addresses with commas) []:
Enter username for SMTP server (leave blank if SMTP authentication is not
being used) []:
Enter password for SMTP server (leave blank if SMTP authentication is not
being used) []:
Enter source interface to use for SMTP communication (if left blank,
routing table will select source interface) []:
Enter source IP address to use for SMTP communication (if left blank,
routing table will select source address) []:
Note that the options to specify an SMTP username and password will be shown only if the device supports EEM 2.4 or higher. The options to specify a source IP address or interface will be shown only if the device supports EEM 3.0 or higher.

Configuring the Smart Call Home Test

Smart Call Home, a feature built in to many Cisco IOS Software platforms, allows the device to communicate back to Cisco. The device can share configuration, inventory, environment, and syslog data to help provide you with areas for optimization, field notice and security vulnerability information, and proactive alert monitoring. Smart Call Home forms the foundation of Cisco's Smart Services offerings.
Unlike the syslog, SNMP trap, and email tests, the Smart Call Home test sends a message directly to Cisco.com. However, you can configure it to use a customized profile that could send messages to an email account or web server in your organization. The default profile that is included with Smart Call Home-capable devices, CiscoTAC-1, will send an email to Cisco.com. The profile name is the only parameter that needs to be configured when the Smart Call Home test is enabled.
Enter Smart Call Home profile to test []: CiscoTAC-1

Configuring an Alias for the NMS Tester

The last thing to configure is an optional EXEC alias for the event manager run no_easy_nmstest.tcl command. Creating an alias can greatly reduce the amount of typing needed to start the NMS Tester.
Do you want to create an EXEC alias for the ``event manager run
no_easy_nmstest.tcl'' command? (y/n) [y]:
What do you want the alias command to be? [easy_nmstest]:

Deploying the NMS Test Script

After configuration is complete, the NMS Tester Tcl policy can be deployed to the device. Select Option 3 from the EASy Installer menu. If an EEM user policy directory has not been set up on the device, you will be prompted to specify that directory. The user policy directory should be different from the EASy package directory (for example, flash:/policies).
--------------------------------------------------------------------------------
Configure and Install EASy Package 'easy-nmstest-1.0'
--------------------------------------------------------------------------------
1. Display Package Description
2. Configure Package Parameters
3. Deploy Package Policies
4. Exit
Enter option: 3
Copy in progress...CCC
10343 bytes copied in 0.588 secs (17590 bytes/sec)
Copy in progress...C
199 bytes copied in 0.576 secs (345 bytes/sec)
Copy in progress...C
1166 bytes copied in 0.576 secs (2024 bytes/sec)
Copy in progress...C
268 bytes copied in 0.576 secs (465 bytes/sec)
Copy in progress...C
130 bytes copied in 0.580 secs (224 bytes/sec)
The EASy NMS Tester has been installed. Run the following command to get
help on using the EASy NMS Tester:
easy_nmstest --help
Hit enter to continue...

Verifying the Package Installation

Once the package is installed, you can select Option 4 from the menu to verify that it is installed properly.
--------------------------------------------------------------------------------
Configure and Install EASy Package 'easy-nmstest-1.0'
--------------------------------------------------------------------------------
1. Display Package Description
2. Configure Package Parameters
3. Deploy Package Policies
4. Verify Installed Package
5. Exit
Enter option: 4
INFO: Package easy-nmstest-1.0 is properly installed.
Hit enter to continue...
You can also check the output of the show event manager policy registered command. The output should show that the no_easy_nmstest.tcl script is registered.
Router#show event manager policy registered
No. Class Type Event Type Trap Time Registered Secu Name
1 script user none Off Wed Mar 10 17:07:34 2010 2048 no_easy_nmstest.tcl
policyname {no_easy_nmstest.tcl} sync {yes}
nice 0 queue-priority normal maxrun 60.000 scheduler rp_primary

Uninstalling the Package

The EASy Installer script can be used to uninstall the package as well.
Router#easy_installer --uninstall --pkgname easy-nmstest
Uninstalling easy-nmstest...DONE!
INFO: Uninstall of easy-nmstest completed successfully.
Configuration was changed, do you want to save the running config to
startup? (y/n) [y]

Running the NMS Tester

The NMS Tester is run manually from ENABLE mode on the device. After the package is installed, the EASy Installer will indicate the command that needs to be run. If no alias was configured, the command will be event manager run no_easy_nmstest.tcl. If you chose to use environment variables to configure the NMS Tester, then no additional arguments need to be passed when running the script.
Router#event manager run no_easy_nmstest.tcl
If, however, command-line arguments are being used, each test will require its own specific arguments. Multiple tests can be run at one time as well by specifying a comma-separated list of tests to the --tests command line argument.

Running the Syslog Test

The only argument that is required to run the syslog test is --tests syslog. This will start a test using the default syslog facility of "HA_EM" and test each severity from 0 to 6.
Router#easy_nmstest --tests syslog
INFO: Starting syslog test...
INFO: The following syslog message was just sent:
%HA_EM-0-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-1-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-2-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-3-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-4-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-5-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: The following syslog message was just sent:
%HA_EM-6-LOG: no_easy_nmstest.tcl: This is a test syslog brought to you by the EASy NMS Tester
INFO: The following syslog hosts should have received it:
10.1.1.1
INFO: Syslog test complete.
Optionally, the --facility argument can be used to specify the customized facility to use when sending test messages. The --severities argument can be used to specify a list of severities (or simply one severity) to test.

Running the SNMP Trap Test

The only argument available for the SNMP trap test is --tests trap. All of the trap-specific options are statically coded.
Router#easy_nmstest --tests trap
INFO: Starting SNMP trap test...
INFO: A cEventMgrPolicyEvent (1.3.6.1.4.1.9.10.91.0.2) trap was sent with
INFO: the following varbinds:
ceemHistoryPolicyIntData1 (1.3.6.1.4.1.9.10.91.1.2.3.1.9) : 3
ceemHistoryPolicyIntData2 (1.3.6.1.4.1.9.10.91.1.2.3.1.10) : 42
ceemHistoryPolicyStrData (1.3.6.1.4.1.9.10.91.1.2.3.1.11) : This is a test trap brought to you by the EASy NMS Tester
INFO: The trap was sent to the following trap receiver(s):
10.1.1.1
INFO: SNMP trap test complete.

Running the Email Test

The email test requires quite a few command-line arguments. Besides the argument to enable the test ( --tests email), the SMTP server, FROM address, and TO address or addresses need to be specified. Optionally, you can specify a list of CC addresses, the SMTP server username and password, and the source IP or source interface for the SMTP connection. The SMTP username and password options are only applicable for devices running EEM 2.4 and higher. The source IP and source interface options are only applicable to devices running EEM 3.0 and higher.
To specify the SMTP server, use the --server <SERVER IP> option. To specify the FROM address, use the --from <EMAIL ADDRESS> option. To specify the TO addresses, use the --to <EMAIL ADDRESS LIST> option (note: multiple addresses can be specified separated by commas). To specify an optional CC list, use the --cc <EMAIL ADDRESS LIST> option. To specify an SMTP username, use the --username <USERNAME> option. To specify the SMTP server password, use the --password <PASSWORD> option. To specify the source IP address or interface for the SMTP connection, use the --source <IP OR INTERFACE> option.
Router#easy_nmstest --tests email --server 10.1.1.1 --from router@company.com --to noc@company.com
INFO: Starting email test...
INFO: Email was successfully sent to the following recipients:
noc@company.com
INFO: The email will appear with subject: 'EASy NMS Tester [Router]'
INFO: Email test complete.

Running the Smart Call Home Test

Smart Call Home, a feature built in to many Cisco IOS platforms, allows the device to communicate back to Cisco. The device can share configuration, inventory, environment, and syslog data to help provide you with areas for optimization, field notice and security vulnerability information, and proactive alert monitoring. Smart Call Home forms the foundation of Cisco's Smart Services offerings.
The Smart Call Home test is enabled by specifying the --tests callhome argument. It also requires the argument --profile <PROFILE NAME> to be specified. The profile name must be an existing Smart Call Home profile. By default, all devices that support Smart Call Home have a built-in profile called CiscoTAC-1.
Router#easy_nmstest --tests callhome --profile CiscoTAC-1
INFO: Starting Smart Call Home test...
INFO: Smart Call Home test completed successfully.
INFO: Smart Call Home test complete.

Understanding the Code

When the NMS Tester script is run, it first checks to see which of the notifications protocols need to be tested. This is done by processing command-line arguments on devices that support EEM 2.4 or higher. The code to do that is as follows:
array set arr_einfo [event_reqinfo]
set argc 0
set arg {}
if { [info exists arr_einfo(argc)] } {
set has_eem_2_4 1
set argc $arr_einfo(argc)
for { set i 1 } { $i <= $argc } { incr i } {
append arg "$arr_einfo(arg$i) "
}
}
set arg [string trim $arg]
For devices that support EEM 2.1 through 2.3, environment variables are used to specify which tests to run and the parameters for those tests. The environment variables can be set either using the EASy Installer or manually in configuration mode. The code to process the environment variables for the syslog test is as follows. Other tests behave in a similar fashion.
if { [info exists easy_nmstest_syslog] && $easy_nmstest_syslog != 0 } {
set facility $DEF_SYSLOG_FACILITY
set severities [list 0 1 2 3 4 5 6]
if { [info exists easy_nmstest_syslog_fac] } {
set facility $easy_nmstest_syslog_fac
}
if { [info exists easy_nmstest_syslog_sevs] } {
set severities [split $easy_nmstest_syslog_sevs ","]
}
In this case, the environment variables are easy_nmstest_syslog, easy_nmstest_syslog_fac, and easy_nmstest_syslog_sevs. They specify whether or not to run the syslog test, what syslog facility to use, and what syslog message severities to test, respectively. By default, NMS Tester will use "HA_EM" as the syslog facility and will test each syslog facility from 0 (emergency-level messages) to 6 (informational messages).
After the command-line arguments or environment variables are processed, NMS Tester confirms whether or not the configuration meets the minimum requirements in order to send the desired notification. The code to test the configuration for the syslog test is as follows. Other tests behave in a similar fashion.
proc check_syslog { facility severities } {
global syslog_facility
global syslog_severities
global syslog_hosts
global LEVEL_TO_INT
global DEF_SYSLOG_FACILITY
set output [run_cli [list "show logging | begin Trap logging:"]]
if { ! [regexp {level ([^,]+),} $output -> level] } {
puts "ERROR: Syslog logging is not enabled."
return 0
}
set trapsev $LEVEL_TO_INT($level)
set willsend 0
foreach severity $severities {
if { ! [string is integer $severity] || $severity < 0 || $severity > 7 } {
puts "WARNING: Specified severity $severity is not a valid syslog severity."
puts "WARNING: Severities must be integers between 0 and 7."
} elseif { $trapsev >= $severity } {
set willsend 1
lappend syslog_severities $severity
} else {
puts "WARNING: The configured syslog trap level $level ($trapsev) will not allow"
puts "WARNING: a message with severity $severity to be sent."
puts "WARNING: To allow a message with severity $severity to be sent, configure:"
puts " logging trap $severity"
}
}
if { ! $willsend } {
puts "ERROR: No messages will be sent given the current syslog trap configuration."
return 0
}
set tmphost ""
set syslog_hosts [list]
set found_host 0
foreach line [split $output "\n"] {
if { [regexp {Logging to ([\d\.]+)\s} $line -> host] } {
if { $tmphost != "" } {
lappend syslog_hosts $tmphost
}
set tmphost $host
set found_host 1
}
if { $found_host && [regexp {\s\sfiltering enabled} $line] } {
set tmphost ""
set found_host 0
}
}
if { $tmphost != "" } {
lappend syslog_hosts $tmphost
}
if { [llength $syslog_hosts] == 0 } {
puts "ERROR: There are no syslog hosts configured which can receive EEM syslog messages."
return 0
}
if { $facility != "" } {
set syslog_facility $facility
} else {
set syslog_facility $DEF_SYSLOG_FACILITY
}
return 1
}
This code will check the configuration to make sure that at least one logging host is configured that can receive messages for the specified severity. If the syslog host has filtering enabled (that is, the Embedded Syslog Manager [ESM] is enabled for that host), then that host will not be considered eligible because EEM will use the buginf method of sending syslog messages, which ESM does not understand. If anything is missing from the configuration, then users will be prompted with what they would need to configure to allow the test to work.
If there are tests that passed the configuration check, NMS Tester will then run those tests and report its results back to the user. The NMS Tester script cannot directly verify the results of the tests except for the Smart Call Home test. Therefore, users will be told what they need to do externally to verify whether or not the tests worked. In the case of Smart Call Home, NMS Tester will attempt to confirm whether the test worked and report that information to the user. The code for performing the syslog test is as follows. The SNMP trap and email tests behave in a similar fashion.
if { $test == "syslog" } {
puts "INFO: Starting syslog test..."
puts ""
foreach severity $syslog_severities {
if { [catch {open "syslog:" "w"} result] } {
if { $has_eem_3_1 } {
action_syslog priority [lindex $INT_TO_PRIO $severity] facility $syslog_facility msg $SYSLOG_MSG
} else {
if { $syslog_facility != $DEF_SYSLOG_FACILITY } {
puts "WARNING: Cannot send a message with $syslog_facility as this device does not support EEM 3.1 or the 'syslog:' file system."
set syslog_facility $DEF_SYSLOG_FACILITY
}
action_syslog priority [lindex $INT_TO_PRIO $severity] msg $SYSLOG_MSG
}
} else {
set fd $result
puts -nonewline $fd "%${syslog_facility}-$severity-LOG: $policy_name: $SYSLOG_MSG"
flush $fd
close $fd
}
puts "INFO: The following syslog message was just sent:"
puts ""
puts " %${syslog_facility}-$severity-LOG: $policy_name: $SYSLOG_MSG"
puts ""
puts "INFO: The following syslog hosts should have received it:"
puts ""
foreach host $syslog_hosts {
puts " $host"
}
puts ""
}
puts ""
puts "INFO: Syslog test complete."
puts ""
}
NMS Tester will first try to send the message through the special "syslog:" file system. This file system allows you to send arbitrary data through the buginf logging channel. If that does not work, then the built-in EEM syslog action will be used to send the test message. Prior to EEM 3.1, this action did not support sending a message with a customized facility. Therefore, if the "syslog:" file system approach does not work and the device is running a version of Cisco IOS Software that supports EEM 3.0 or earlier, then a message will be sent with the default "HA_EM" facility (even if a custom facility was requested). Once the test has been run, users will be notified as to what the message will look like on their syslog servers.
The Smart Call Home test can be verified to some extent. The Smart Call Home feature maintains a set of statistics, which will indicate how many Smart Call Home tests were run, how many succeeded, and how many failed. This data is used by NMS Tester to verify whether or not the Smart Call Home test was successful. The code that runs the Smart Call Home test is as follows:
if { $test == "callhome" } {
puts "INFO: Starting Smart Call Home test..."
puts ""
set output [run_cli [list "show call-home statistics"]]
get_sch_counters $output pre_fails pre_successes
if { [catch {run_cli [list "call-home test profile $profile"]} result] } {
puts "ERROR: Failed to initiate Smart Call Home test: '$result'"
incr errors
} else {
if { [regexp {Call Home needs the following.*\n(.*)} $result -> sch_errors] } {
puts "ERROR: Smart Call Home test failed due to the following error(s):"
set elst [split $sch_errors "\n"]
foreach e $elst {
puts "ERROR:\t$e"
}
incr errors
}
after 7500
set output [run_cli [list "show call-home statistics"]]
get_sch_counters $output post_fails post_successes
if { $post_fails > $pre_fails } {
puts "ERROR: There was a failure in generating the Smart Call Home Test."
incr errors
} elseif { $post_successes > $pre_successes } {
puts "INFO: Smart Call Home test completed successfully."
} else {
puts "WARNING: Unable to determine if the Smart Call Home test was successful or not."
}
}
puts ""
puts "INFO: Smart Call Home test complete."
puts ""
}
If the results of the test can be determined (that is, if either the failed or successful counters increment), then NMS Tester will present that information to the user.

For More Information

Future updates to this EASy package will be posted to the EASy website at http://www.cisco.com/go/easy.
For more information on configuring syslog on a Cisco IOS Software device, see http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf013.html#wp1001168.
For more information on configuring a device to send SNMP traps, see http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf014.html#wp1001347.
For more information on enabling and using Smart Call Home, as well as its benefits, see http://www.cisco.com/go/smartcall.
If you have any questions or comments on this package, contact ask-easy@cisco.com.