FortiSIEM Get CMDB Device Info

API Parameters for Multitenant Deployments

The device information APIs for multitenant deployments are essentially the same as the ones you would use for enterprise deployments, except you must specify an organization for the input URL and credentials. In the API samples in this section, ACME is used as the name of an example organization.

Get Short Description of All Devices for an Organization

Methodology REST API based: make an HTTP(S) request with an input XML (optional). An output XML is returned.
Input URL  https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/devices&organization=ACME
Input Credentials  Username and password of any AccelOps account for the Acme organization
Output An XML that contains a short set of attributes for each device, including:

Host Name

Access IP

Creation Method

Description

Vendor, Model, version

Contact info

Location

Uptime

Hardware Model

Serial Number

Business Service Groups to which the device belongs

Sample XML Output

AllDevicesShortInfo.xml

Sample Python Script

getCMDBinfoSP.py Script Usage
python getCMDBInfoSP.py <AccelOpsSuperIp>

ACME/<user> <password>

Get Short Description of All Devices in an Address Range for an Organization

Methodology REST API based: make an HTTP(S) request with an input XML (optional). An output XML is returned.
Input URL  https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/devices?includeIps=<includeIpSet>&excludeIps

E

Input

Credentials

 Username and password of any AccelOps account in the Acme organization
Output An XML that contains a short description of devices with access IPs in the specified address range for the Acme organization

192.168.20.25, then issue the API https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/devices?include

Ips=192.168.20.1-192.168.20.100&excludeIps=192.168.20.20,192.168.20.25

If you want all devices in the range 192.168.20.1-192.168.20.100, but want to exclude 192.168.20.20-192.168.20

.25, then issue the API https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/devices?includeIps=192.16

8.20.1-192.168.20.100&excludeIps=192.168.20.20-192.168.20.25

Sample XML Output

Query: https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/devices?includeIps=192.168.20.1-192.168.20.40

Output: AllDeviceInRangeShortDescription.xml

Sample Python Code

 

Methodology REST API based: make an HTTP(S) request with an input XML (optional). An output XML is returned.
Input URL  https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/device?ip=<deviceIp>&loadDepend=true&organiz
Input

Credentials

 Username and password of any AccelOps account for the Acme organization
Output An XML that contains full information AccelOps has discovered about a device

Sample XML Output

Query: https://<AccelOps_IP>/phoenix/rest/cmdbDeviceInfo/device?ip=192.168.1.12&loadDepend=true&organization

=ACME

Output: oneWindowsServerFullInfo.xml

Sample Python Code

getCMDBinfoSP.py Script Usage
import base64 import urllib2

from xml.dom.minidom import Node, Document, parseString

 

def GetCMDBInfo(appServer, user, password):

encodePassword = base64.encodestring(user + “:” + password)     auth = “Basic %s” % encodePassword     org = user.split(‘/’)[0]     restURL = “https://” + appServer + “/phoenix/rest/cmdbDeviceInf o/device?ip=192.168.1.12&organization=” + org     req = urllib2.Request(restURL, None, {“Authorization”: auth })     handle = urllib2.urlopen(req)     outXML = handle.read()     print outXML

 

if __name__==’__main__’:

import sys     if len(sys.argv)!=4:

print “Usage: GetCMDBInfo.py appServer user password”         exit()

 

param=GetCMDBInfo(sys.argv[1], sys.argv[2], sys.argv[3])

python getCMDBInfoSP.py <AccelOpsSuperIp> ACME/<user>

<password>

 


Having trouble configuring your Fortinet hardware or have some questions you need answered? Check Out The Fortinet Guru Youtube Channel! Want someone else to deal with it for you? Get some consulting from Fortinet GURU!

This entry was posted in Administration Guides, FortiSIEM on by .

About Mike

Michael Pruett, CISSP has a wide range of cyber-security and network engineering expertise. The plethora of vendors that resell hardware but have zero engineering knowledge resulting in the wrong hardware or configuration being deployed is a major pet peeve of Michael's. This site was started in an effort to spread information while providing the option of quality consulting services at a much lower price than Fortinet Professional Services. Owns PacketLlama.Com (Fortinet Hardware Sales) and Office Of The CISO, LLC (Cybersecurity consulting firm).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.