Cisco Cisco Firepower Management Center 4000 Guía Del Desarrollador

Descargar
Página de 102
 
2-41
FireSIGHT System Host Input API Guide
 
Chapter 2      Using the Host Input API
  Example Host Input API Scripts
Example: Adding a Host to the Network Map
After the script establishes use of the 
HostInput
 module and sets the source type and source id values, 
it can begin to import data. The first import function called is the 
AddHost
 function. 
# Add an IP host with a Primary MAC address
if ($retval = SF::SFDataCorrelator::HostInput::AddHost(
$source_type_id, $source_id, "1.2.3.4", "01:02:03:04:05:06"))
{
warn "AddHost Failed with error $retval";
exit;
}
Note that in addition to the IP address, the function sets a primary MAC address of 01:02:03:04:05:06.
Example: Setting the Operating System on the Host
After the script adds the host, it sets the operating system value for the host. To simplify the 
SetOS
 call, 
a product map called 
Asset Management App
 is created using the Defense Center web interface: