Highlighted
Contributor.. Contributor..
Contributor..
351 views

Create a custom SNMPv3 Mapping from a Cisco Device to uCMDB

Hi all,  I'm a new uCMDB admin. We recently implemented uCMDB. Our Network admins have filled the

MIB2-DAN-MIB-ADMIN

1.3.6.1.2.1.1.4.0

sysContact.0

DisplayString

 

 

with the asset tag of the device. I would like to map this to

BiosAssetTag

I understand the concept. This would be a custom discovery based on SNMP. I would probably modify an existing SNMP discovery to do it. but I don't understand Jython enough to have a starting point. This seems to me like it would be quick and dirty mod, can anyone assist?

 

0 Likes
4 Replies
Highlighted
Contributor.. Contributor..
Contributor..

Re: Create a custom SNMPv3 Mapping from a Cisco Device to uCMDB

So I've found this in SNMP_Networking_Utils. py

def discoverSysTableData(client):

snmpAgent = snmputils.SnmpAgent(None, client)

queryBuilder = snmputils.SnmpQueryBuilder(BASE_SYSTABLE_OID)

queryBuilder.addQueryElement(1, 'sysDescr')

queryBuilder.addQueryElement(2, 'sysObjectID')

queryBuilder.addQueryElement(4, 'sysContact')

queryBuilder.addQueryElement(5, 'sysName')

queryBuilder.addQueryElement(6, 'sysLocation')

queryBuilder.addQueryElement(7, 'sysServices')

 

sysTable = snmpAgent.getSnmpData(queryBuilder)

 

for data in sysTable:

classVendorOsAndModel = SnmpQueries.getClassVendorOsAndModelByOid(data.sysObjectID, data.sysDescr)

setattr(data, 'sysClass', classVendorOsAndModel[0])

setattr(data, 'sysVendor', classVendorOsAndModel[1])

setattr(data, 'sysOs', classVendorOsAndModel[2])

setattr(data, 'sysModel', classVendorOsAndModel[3])

 

 

match = re.search("Nodename:\s*(\w+)", data.sysDescr)

setattr(data, 'sysNodeName', None)

if match:

setattr(data, 'sysNodeName', match.group(1))

 

if data.sysServices and (int(data.sysServices) & 2) > 0:

setattr(data, 'isBridge', 1)

else:

setattr(data, 'isBridge', 0)

if sysTable:

return sysTable[0]

else:

raise ValueError, "Query for System Table returned empty result"

 

But they don't do anything with the data,  would it be simply adding following ?

setattr(data, 'sysContact', classBiosAssetTag[4])

 

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Re: Create a custom SNMPv3 Mapping from a Cisco Device to uCMDB

Hei Jim,

Did you manage to get an answer on this ? We have a similar situation in that SysLocation from the same OID group is not populated for Switches and Routers (we also have Cisco Switches).

Thanks,

Dorin

0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

Re: Create a custom SNMPv3 Mapping from a Cisco Device to uCMDB

No. I've got an SR opened on it. When I get a resolution to it, I'll post it here.

 

0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

Re: Create a custom SNMPv3 Mapping from a Cisco Device to uCMDB

Dorin,

I got an answer back from HPE. They basically say that the OOB is set and the OID mappings are hard coded. If you change them it voids the warrenty and any tech support agreement you might have. 

The suggested work around is to move the data to the field that is mapped. Don't alter the mappings.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.