Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Blackhawk coudl not receive the scripts via email. Posted here

...

We are developing a script to just this very thing. This is a perl script for Linux Open-AudIT servers only.

The information to be consumed relies on the Cisco Ready SMARTNET reports that can be requested from Cisco if you have SMARTNET contracts with them.

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 (usually named "Powered by Cisco Ready") as a CSV. Copy that file to your Open-AudIT server in to the /usr/local/omk/bin directory. Name it cisco.csv.

...

After import.


After Discovery.

Sample Queries

Below are some sample queries we may refine and include in newer releases of Open-AudIT. To import them, copy the JSON contents and go to menu → Manage → Queries → List Queries and click the Import button in the top right of the table panel.

Image Added


Devices Not Discovered

Code Block
{
   "name" : "Devices Not Discovered",
   "sql" : "SELECT system.id AS `system.id`, system.type AS `system.type`, system.manufacturer AS `system.manufacturer`, system.model AS `system.model`, system.serial AS `system.serial`, system.owner AS `system.owner`, locations.name AS `locations.name`, locations.id AS `locations.id` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.ip = ''",
   "description" : "Devices Imported but Never Seen by Discovery",
   "menu_display" : "y",
   "org_id" : 1,
   "menu_category" : "Device",
   "link" : ""
}


Devices Discovered Out of Contract

Code Block
{
   "org_id" : 1,
   "menu_category" : "Device",
   "menu_display" : "y",
   "link" : "",
   "sql" : "SELECT system.id AS `system.id`, system.type AS `system.type`, system.ip AS `system.ip`, system.manufacturer AS `system.manufacturer`, system.model AS `system.model`, system.serial AS `system.serial`, DATE(system.last_seen) AS `system.last_seen`, system.end_of_service AS `system.end_of_service`, system.owner AS `system.owner`, locations.name AS `locations.name`, locations.id AS `locations.id` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.ip != '' AND DATE(system.last_seen) > system.end_of_service",
   "name" : "Devices Discovered Out of Contract",
   "description" : "Devices that have been seen by discovery but whose end_of_service has expired."
}


Discovered Inventory Report

Code Block
{
   "link" : "",
   "org_id" : 1,
   "menu_category" : "Device",
   "menu_display" : "y",
   "description" : "Inventory details for discovered devices",
   "sql" : "SELECT system.id AS `system.id`, system.type AS `system.type`, system.ip AS `system.ip`, system.manufacturer AS `system.manufacturer`, system.model AS `system.model`, system.serial AS `system.serial`, DATE(system.last_seen) AS `system.last_seen`, system.end_of_service AS `system.end_of_service`, system.end_of_life AS `system.end_of_life`, system.end_of_production AS `system.end_of_production`, system.maintenance_expires AS `system.maintenance_expires`, system.warranty_expires AS `system.warranty_expires`, system.owner AS `system.owner`, locations.name AS `locations.name`, locations.id AS `locations.id` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.ip != ''",
   "name" : "Discovered Inventory Report"
}


Serial Numbers Not Found

Code Block
{
   "link" : "",
   "org_id" : 1,
   "menu_category" : "Device",
   "menu_display" : "y",
   "description" : "Devices imported with a serial number that have not been discovered",
   "sql" : "SELECT system.id AS `system.id`, system.type AS `system.type`, system.manufacturer AS `system.manufacturer`, system.model AS `system.model`, system.serial AS `system.serial`, system.end_of_service AS `system.end_of_service`, system.end_of_life AS `system.end_of_life`, system.end_of_production AS `system.end_of_production`, system.maintenance_expires AS `system.maintenance_expires`, system.warranty_expires AS `system.warranty_expires`, system.owner AS `system.owner`, locations.name AS `locations.name`, locations.id AS `locations.id` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.ip = ''",
   "name" : "Serial Numbers Not Found"
}


Devices Without Serial Numbers

Code Block
{
   "link" : "",
   "menu_category" : "Device",
   "org_id" : 1,
   "menu_display" : "y",
   "description" : "Devices discovered that have no reported serial",
   "sql" : "SELECT system.id AS `system.id`, system.icon AS `system.icon`, system.type AS `system.type`, system.ip AS `system.ip`, system.manufacturer AS `system.manufacturer`, system.model AS `system.model`, system.identification AS `identification`, locations.name AS `locations.name`, locations.id AS `locations.id` FROM `system` LEFT JOIN `locations` ON system.location_id = locations.id WHERE @filter AND system.serial = ''",
   "name" : "Devices Without Serial Numbers"

Script

View file
nameimport_cisco_into_open-audit.pl
height250