Pre-Release Only
As at 2020-08-13, this is currently in selective pre-release to supported customers only. Please contact Opmantek to be involved.
All of the below is subject to change in released versions of Open-AudIT, however the functionality will remain the same.
We heavily suggest you read this entire page before running any commands.
Introduction
So you have a Cisco supplied spreadsheet in .xlsb format that contains lots of great information like serial numbers, date of purchase, warranty details and more and you want to get that information into Open-AudIT for easy reporting. Say no more...
We are developing a script to just this very thing. This is a perl script for Linux Open-AudIT servers only.
Running the Script
First thing to do is to convert the spreadsheet to something workable. That's a CSV. Open the spreadsheet in your program of choice and save the relevant tab as a CSV. Copy that file to your Open-AudIT server in to the /usr/local/omk/bin directory. Name it cisco.csv.
Next, log on to your Open-AudIT server and change into the directory /usr/local/omk/bin
Now run the script. Done. It's that easy.
cd /usr/local/omk/bin ./import_cisco_into_open-audit.pl
What is imported?
But which rows are imported? We have a few rules around this, namely:
- Product Type must equal CHASSIS
- A Serial Number must be present
- Covered Line Status must be either ACTIVE, EXPIRED or SIGNED
- The Last Date of Support must be after the configured value of 2019-01-01 (see below).
You'll not see much by default until it's complete. When it has done so, you'll see a summary like below.
mark@desktop:/usr/local/opmojo/bin$ ./import_cisco_into_open-audit.pl Start Time: Thu Aug 13 14:13:11 2020 End Time: Thu Aug 13 14:22:05 2020 Duration: 534 seconds Location Count: 32 Device Count: 896 mark@desktop:/usr/local/opmojo/bin$
Options
We have some options that you can set by directly editing the script. They are below.
name | default value | what it does |
---|---|---|
conf_file | /usr/local/omk/conf/opCommon.nmis | The full path to the Opmantek configuration file. Used to retrieve the UUID. |
debug | 0 | 0 - Summary output only 1 - Commands run 2 - Command outputs (usually file contents). |
filename | cisco.csv | The filename to be imported. If it's not in the default directory, the full path including name is OK to use. |
last_date_of_support | 2019-01-01 | The date in YYY-MM-DD format. Devices with a column value for 'Last Date of Support' that's older than this date will not be imported. |
user | admin | The name of the Open-AudIT user performing the action. Admin is the default user and fine to use. |
Errors and Warnings (oh my!)
You may see lines beginning with DEBUG, INFO, WARNING or ERROR. Generally only ERRORs are bad and will immediately halt the script execution.
Sample Spreadsheet Columns
Below are the columns from our current Cisco spreadsheet. If your order of these columns differs, it shouldn't matter, however your spreadsheet should contain all the columns used in the mappings below.
Serial Number / PAK number | Coverage | Covered Line Status | Business Entity | Sub Business Entity | Product Family | Product ID | Product Description | Asset Type | Product Type | Item Quantity | Covered Line Start Date | Covered Line End Date | Covered Line End Date FY-FQ | Contract Type | Service Brand Code | Contract Number | Subscription Reference ID | Ship Date | End of Product Sale Date | End of Software Maintenance Date | Last Date of Support | LDOS FY-FQ | End Of Life Product Bulletin | Warranty Type | Warranty End Date | Install Site Customer Registry GU Name | Install Site Customer Registry Party Name | Install Site Customer Registry Party ID | Install Site Name | Install Site ID | Install Site Address 1 | Install Site City | Install Site State | Install Site Country | Install Site Postal Code | Product Bill to ID | Product Bill-to Partner Name | Product Partner BE GEO ID | POS Partner BE GEO ID | POS Partner BE GEO Name | Service Bill to ID | Service Bill-to Partner Name | Service Partner BE GEO ID | Product List Price $ | Default Service List Price $ | Default Service Level | Existing Coverage Level List Price $ | Instance ID | Parent Instance ID | Product SO | Product PO | Service SO | Service PO | Web Order ID | Mapped to SWSS (Y/N) | Mapped to C1 (Y/N) | Auto-renewal flag | Configuration |
Mapping the spreadsheet to Open-AudIT
Below are the mappings between the spreadsheet columns and those in Open-AudIT.
Cisco Spreadsheet | Open-AudIT |
---|---|
Product Family | asset_tag |
Product Description | description |
Last Date of Support | end_of_life |
End of Product Sale Date | end_of_production (new, see below) |
Covered Line End Date | end_of_service |
Serial Number / PAK number | hostname |
End of Software Maintenance Date | maintenance_expires (new, see below) |
Product ID | model |
Install Site Customer Registry GU Name | owner |
Product List Price $ | purchase_amount |
Covered Line Start Date | purchase_date |
Contract Number | purchase_service_contract_number |
Product Bill-to Partner Name | purchase_vendor |
Serial Number / PAK number | serial |
Warranty End Date | warranty_expires |
Covered Line Status | warranty_status (new, see below) |
In addition to the above we set a few other fields as below.
Field | Set to |
---|---|
last_seen_by | nmap - so we can override this by discovery, audit or the GUI. |
location_id | Calculated by inserting any missing Locations as below, then associating to the device. |
org_id | 1 - the default Org. |
type | By default, set to 'network device'. If one of the below matches, set. if ($line->{'Business Entity'} eq 'Collaboration' and CORE::index($line->{'Product Description'}, 'Phone') != -1) { $device->{'system'}->{'type'} = 'voip phone'; } if ($line->{'Business Entity'} eq 'Collaboration' and CORE::index($line->{'Product Description'}, 'Camera') != -1) { $device->{'system'}->{'type'} = 'webcam'; } if ($line->{'Business Entity'} eq 'Computing Systems') { $device->{'system'}->{'type'} = 'computer'; } if ($line->{'Business Entity'} eq 'Data Center Networking') { $device->{'system'}->{'type'} = 'switch'; } if ($line->{'Business Entity'} eq 'Enterprise Routing') { $device->{'system'}->{'type'} = 'router'; } if ($line->{'Business Entity'} eq 'Enterprise Switching') { $device->{'system'}->{'type'} = 'switch'; } if ($line->{'Business Entity'} eq 'IOT') { $device->{'system'}->{'type'} = 'network device'; } if ($line->{'Business Entity'} eq 'Other') { $device->{'system'}->{'type'} = 'network device'; } if ($line->{'Business Entity'} eq 'Security') { $device->{'system'}->{'type'} = 'firewall'; } if ($line->{'Business Entity'} eq 'Service Provider Routing') { $device->{'system'}->{'type'} = 'router'; } if ($line->{'Business Entity'} eq 'Wireless') { $device->{'system'}->{'type'} = 'wap'; } |
We also import the list of Locations mapping the fields as below. If already present, we leave the Location as is. We test for this using the spreadsheet value for Install Site ID.
Cisco Spreadsheet | Open-AudIT |
---|---|
Install Site Address 1 | address |
Install Site City | city |
Install Site Country | country |
Install Site ID | external_ident |
Install Site Name | name |
1 (the default Org) | org_id |
Install Site Postal Code | postcode |
Install Site State | state |