Populating End of Life data for Cisco devices
Device vendors regularly publish end of life (EOL) bulletins for an equipment they support. The bulletins indicate that you need to replace or upgrade that equipment within a reasonable time. Starting with version 8.9.02, TrueSight Network Automation can help remind you to do this by flagging such devices. You can import these EOL bulletins in advance of the EOL dates.
Different vendors publish the EOL content in different formats, such as PDF, HTML, and XML that can be accessible through various means. Starting with version 8.9.02, TrueSight Network Automation can read the EOL bulletins (XML) released by Cisco and convert this content in a form that can be used to alert customers about EOLs of various devices in the device inventory.
This topic describes the process of populating EOL data for Cisco devices and provides instructions for the same.
- Process of populating EOL data
- Populating EOL data when the application server has internet connectivity
- Populating EOL data when application server does not have internet connectivity
- Viewing EOL data using reports
Process of populating EOL data
The process of populating EOL data comprises the following steps:
- Discover and store board models IDs and serial numbers of devices: A network device can have multiple boards and each board can have a different EOL date. TrueSight Network Automation discovers and stores board models IDs and corresponding serial numbers in two multi-value device dynamic fields, Device Board Models and Device Board Serial Numbers, through a custom action, Get Board Models and their Serial Numbers.
- Fetch EOL data from Cisco Portal: Get EOL data of device board model IDs of the required Cisco devices from Cisco portal in XML format.
- Store EOL data: Store the data obtained in steps 1 and 2 in a new configuration trail, Device End of Life in JSON format.
- Populate EOL dates: Populate EOL dates for device on the Devices page through a date type dynamic field, End of Life Date.
Depending on whether the TrueSight Network Automation application server has the Internet connectivity in your network, you can choose from the following methods to populate the EOL data for your devices:
- Application server has internet connectivity: See Populating EOL data when the application server has internet connectivity.
- Application server does not have internet connectivity (air-gapped environments): See Populating EOL data when application server does not have internet connectivity.
Populating EOL data when the application server has internet connectivity
To populate EOL data, you need to run the predefined job, Populate Cisco Device Board Models and their End of Life Date on the application server. This predefined job contains a custom action, Get Board Models and their Serial Numbers and an external script action, Populate End of Life Date. By default, the custom action runs on all Cisco devices. You can modify this action to run on specific network span. The external script action contains default values for runtime parameters. Change these values as per your environment.
TrueSight Network Automation is also shipped with a canned policy, Populate Cisco Device Board Models and their End of Life Date, which you can use to schedule for capturing and populating EOL data. The out of box policy is time based, which will run once in a month. Depending on your requirements, you can schedule this operation weekly, monthly, or yearly to capture hardware changes in your data center. After replacing or upgrading your hardware, BMC recommends to run the predefined job or policy to update EOL data.
Before you begin
Before you begin populating EOL data, ensure that the following prerequisites are met:
- (This step is required only for version 8.9.02) Install Python version 3.6 or later (64-bit) on the application server.
- Obtain Client ID and Client Secret for the EoX API from the Cisco API Console.
Installing Python (Required only for version 8.9.02)
Obtaining Client ID and Client Secret for the EoX API
- Access the Cisco API console.
- Create a user account on the Cisco API console with your Support Contract ID if you do not have one.
- On the Cisco API console, click the My Applications tab.
- Click Register New Application.
- In the Application Details section, enter a name for your application (for example, BNA) and an optional description.
- Select Client Credentials as OAuth2.0 Credentials.
- In the Select APIs section, select the EOX V5 API check box.
- In the Terms of Service section, select the I agree to the terms of service check box.
- Click Register.
After the application is registered successfully, click My Applications.
You should see EoX API entry with Client ID and Client Secret.
To run the predefined job
- Navigate to Network > Actions > Predefined Jobs.
The Predefined Jobs list page appears. - For the Populate Cisco Device Board Models and their End of Life Date predefined job, in the Actions column, click Prepare Job
.
Enter information for the following runtime parameters, which are required for the Populate End of Life Date external script action:
Parameter
Description
File Path of End of Life Data
Path and name of the file in which EOL data is to be stored. Change the default location if required.
BMC Network Automation Server URL
Enter the URL of the application server in the following format: https://serverName:portNumber/bca-networks.
BMC Network Automation Server User Name
User name for the target application server
BMC Network Automation Server Password
Password for the user name
End of Life Milestone Date Name
Cisco publishes multiple EOL milestone dates such as, EndOfSaleDate, LastDateOfSupport, and EndOfSWMaintenanceReleases. Specify the one you want to be populated. TrueSight Network Automation follows that date to populate the EOL date.
Cisco EoX API Registered Client ID
Client ID that you obtained in the Obtaining Client ID and Client Secret for the EoX APIsection
Cisco EOX API Client Secret
Client Secret that you obtained in the Obtaining Client ID and Client Secret for the EoX APIsection
- Click Next.
- (Optional) In the Job Editor, edit the job.
- Click Save And Submit.
The job you have prepared is displayed on the Jobs list page. - Click
to view the Job Details page.
The following figure shows the Job Details page for a sample job. The page shows two actions, custom action (Action #1) and external script action (Action #2).
In the sample job, Action 1# was run on all Cisco devices in the Default realm. The result of this action is board models of devices. If this action fails on any of the devices, then the final job status is shown as Failed. You can click the Status link to check on the device models that were captured and on which the custom action failed.
Action #2 shows the results of the external script action. Clicking the link in the Status column displays the transcript where you can see the detailed results, as shown in the following figure:
The transcript page shows the following information:
Return Code: Shows a value of 0 if the external script action succeeded and 1 if it failed.
Output: Provides the total number of models captured of all Cisco devices.
Errors: Displays errors, warnings and INFO messages. A successful execution of the script might show warnings and INFO messages, which can be ignored. - Upon successful execution of the job, the End of Life column on the Devices page is populated with the EOL dates for the Cisco devices. If a device has multiple boards, the EOL date shown is the earliest EOL date amongst all device board models. The following figure shows the Devices page for the sample job.
- (Optional) Use the Device filter to search for the devices which has EOL dates within a specific time period.
Populating EOL data when application server does not have internet connectivity
When application server does not have internet connectivity, it means that Cisco portal is not accessible to the application server.
Before you begin
Before you begin populating EOL data, ensure that the following prerequisites are met:
(This step is required only for version 8.9.02) Install Python version 3.6 or later on a computer which has internet connectivity.
- Obtain Client ID and Client Secret for the EoX API from the Cisco API Console.
To populate EOL data in an air-gapped environment
- Run the custom action: Run the custom action, Get Board Models and their Serial Numbers for Cisco devices on the application server.
Generate XML for BMC Network Automation device board models: To generate the XML, export the dynamic field, Device Board Models on the application server using the import/export utility, as follows:
export.<bat/sh> -url <applicationServerURL> -user <userName> -password <password> -component DynamicTypes -name "Device Board Models" -file deviceBoardModel.xmlThe deviceBoardModel.xml file is generated in the BCAN_HOME\public\bmc\bca-networks\extras\bcan-import-export-8.9.02\bcan-import-export\bin directory. For information about impoert/export utility, see Exporting-and-importing-components-using-a-script.
- Generate Cisco EOL data XML as follows:
- For version 8.9.02:
- Copy the following files from the application server and paste it on the computer which has internet connectivity (Linux/Windows) and Python version 3.6 or later installed.
- deviceBoardModel.xml that you generated in step 2
- Python script located in the BCA-Networks-Data\endorsed\eol\generateCiscoEndOfLifeDataForIsolatedBNAServer.py directory
Open the generateCiscoEndOfLifeDataForIsolatedBNAServer.py file with a Python editor, and specify values for the parameters, as shown below:
CiscoEoxClientID = "<Client ID of Cisco EoX API>"
CiscoEoxClientSecret = "<Client Secret of Cisco EoX API>"
inputXMLFileName ="deviceBoardModel.xml”- Save the changes.
- Execute the Python script, generateCiscoEndOfLifeDataForIsolatedBNAServer.py.
The output is an XML file, CiscoEol.xml, generated in the directory from where you ran the Python script.
- Copy the following files from the application server and paste it on the computer which has internet connectivity (Linux/Windows) and Python version 3.6 or later installed.
- For versions 8.9.03 and later:
- Copy the following files from the application server and paste it on the computer which has internet connectivity (Linux/Windows):
- deviceBoardModel.xml that you generated in step 2
- BCA-Networks\public\bmc\bca-networks\extras\bcan-eol-external-utility-8.9.03.zip
- Extract the zip file that you copied in step a.
- Run the FetchCiscoEolData.bat script from the command line, as follows:
FetchCiscoEolData.bat -ciscoClientID "<Cisco_Client_ID>" -ciscoClientSecret "<Cisco_Client_Secret>" -ciscoBoardModelInputFilePath "C:\deviceBoardModel.xml" -eolDataOutputFilePath "C:\EOL\CiscoEoL.xml"
The output is an XML file, CiscoEol.xml, generated in the directory that you provided in the eolDataOutputFilePath argument.
- Copy the following files from the application server and paste it on the computer which has internet connectivity (Linux/Windows):
- For version 8.9.02:
- Populate EOL data on the application server, as follows:
- Copy the XML file generated in step 3 and paste it into the BCA-Networks-Data\endorsed directory.
- (This step is required only for version 8.9.02) Open the BCA-Networks-Data/endorsed/eol/PopulateEndOfLife file with a text editor, as follows:
(Windows) Comment the lines in the PopulateEndOfLife.bat file, as follows:
REM "%ENA_DATA_DIR%\endorsed\eol\ciscoEolDataQueryForBMC Network AutomationServer.py" %*
REM set exit_code=%ERRORLEVEL%
REM if %exit_code% NEQ 0 (
REM echo Error running python script, return code = %exit_code%
REM exit /b %exit_code%
REM )(Linux) Comment the lines in the PopulateEndOfLife.sh file, as follows:
#fi
#python3.6
$ENA_DATA_DIR/endorsed/eol/ciscoEolDataQueryForBMC Network AutomationServer.py "$@"
#EXIT_CODE=$?
#if [ $EXIT_CODE -ne 0 ]; then
#echo Error running python script, return code = $EXIT_CODE
#exit $EXIT_CODE
Run the external script action, Populate Cisco End of Life Date on the application server with the following parameters:
Parameter
Description
File Path of End of Life Data
Path and name of the file (CiscoEol.xml) in which EOL data is to be stored. Change the default location if required.
BMC Network Automation Server URL
Enter the URL of the application server in the following format: https://serverName:portNumber/bca-networks.
BMC Network Automation Server User Name
User name for the target application server
BMC Network Automation Server Password
Password for the user name
End of Life Milestone Date Name
Cisco publishes multiple EOL milestone dates such as, EndOfSaleDate, LastDateOfSupport, and EndOfSWMaintenanceReleases. Specify the one you want to be populated. BMC Network Automation follows that date to populate the EOL date.
Cisco EoX API Registered Client ID
Client ID that you obtained in the Obtaining Client ID and Client Secret for the EoX APIsection
Cisco EOX API Client Secret
Client Secret that you obtained in the Obtaining Client ID and Client Secret for the EoX APIsection
- Upon successful execution of the preceding steps, the End of Life column on the Devices page is populated with the EOL dates for the Cisco devices. If a device has multiple boards, the EOL date shown is the earliest EOL date amongst all device board models. To see the Devices page, navigate to Network > Spans > Devices.
- (Optional) Use the Device filter to search for the devices which has EOL dates within a specific time period.
Viewing EOL data using reports
You can generate various reports such as Device Inventory report and Configuration Search report to obtain the list of devices that are reaching their EOL.
To generate the Device Inventory report
- Open the Device Inventory Report wizard page by navigating to Reports > Status Reports > Device Inventory.
- Under User Assigned Dynamic Fields, select End of Life Date.
- Click Filter Devices to display the Device Filter dialog box.
- Click the Dynamic Fields tab.
- In End of Life Date, specify the date before which if a device EOL occurs that device should appear in the report, and click OK.
- Click Next to begin the report generation and to display its progress on the Report Activity page.
- Click Refresh until the report is completed, or wait until you receive the notification email. If the report is aborted, the Progress column indicates so, to alert you that the report data is partial. You can view the partial report, but be aware it is partial. You should refine your selections (if you asked for too-large a report) or re-generate the report (if it was aborted due to a system shutdown) in order to obtain a complete report. Then delete the aborted report as soon as possible. For more information about the Report Activity page, see Viewing-report-activity.
- Click the Device Inventory link in the Report column to display the report.
You can also generate the Configuration Search report to view a complete list of board model ID’s of Cisco devices and their EOL dates.
To generate the Configuration Search report
- Open the Configuration Search wizard page by navigating to Reports > Search Reports > Configuration Search.
- From Configuration, select Other Current or Other Historical.
- Select Device End of Life from the drop down list.
- If you have chosen Other Historical in the previous step, specify the date before which historical trails need to be considered for generating EOL data.
- From Subject, select Pattern.
- In Pattern, enter .* as the pattern.
- Click Filter Devices to display the Device Filter dialog box.
- Click the Dynamic Fields tab.
- In End of Life Date, choose the time period before which if a device EOL occurs that device should appear in the report, and click OK.
- Click Next to begin the report generation and to display its progress on the Report Activity page.
- Click Refresh until the report is completed, or wait until you receive the notification email. If the report is aborted, the Progress column indicates so, to alert you that the report data is partial. You can view the partial report, but be aware it is partial. You should refine your selections (if you asked for too-large a report) or re-generate the report (if it was aborted due to a system shutdown) in order to obtain a complete report. Then delete the aborted report as soon as possible. For more information about the Report Activity page, see Viewing-report-activity.
- Click the Configuration Search link in the Report column to display the report.
The following figure shows a sample report.
.