Status: Resolved (View Workflow)
Security Level: Default (Default Security Scheme)
Hi team, while working on one of the customer tickets we noticed an issue with OpenNMS when using the "snmp-hardware-provisioning-adapter"
One of the customers using "opennms-plugin-provisioning-snmp-hardware-inventory" on H29.0.5 faced an issue where, post a service restart their OpenNMS was not starting up, upon checking logs and setting up DEBUG on Provisiond found out the below exceptions in manager.log/provisiond.log.
I think that during opennms startup when opennms tries to start/init Provisiond it fails because of the wrong values [mentioned below] for OID in the "hwentityattributetype" table [which got there from POST via Rest]
1. Users when POSTing "hardwareInventory" data for a node via REST API, they are able to post any-value for OID and that POST succeeds but the following service restart fails
I feel its because "attriboid" in "hwentityattributetype" table is a varchar
Below are the values from the table as we can clearly see attriboid = jygg gets successfully added via REST but the following restart fails ..
2. Also, while reproducing this found couple of other things as well.
I have reproduced this on H29.0.5 and collecting below OIDs for Linux Host, added this to "snmp-hardware-inventory-adapter-configuration.xml"
Earlier i dint know if i should have added the scalar instance "0" or not, but added them either ways
Noticed, that dint work and then removed the .0 from the end and kept the same alias
But when i tried starting OpenNMS this time it errored out saying below and then i realized that there were some database constraints for "hwentityattributetype", which is understandable.
Which got me thinking why dint the older values in this case the below values, get deleted from the DB when the XML file was changed/updated ??
Wanted to understand the reasoning behind leaving the older/stale values still in DB, say if users end up having many OIDs to collect and then remove from XML file will they still be in DB and since they are in DB will OpenNMS still try to collect those OIDs on every restart/node-rescan.
I noticed the same when I changed the "type" from "string" to "integer" for "TotalMemory" in the "snmp-hardware-inventory-adapter-configuration.xml file, it dint update the new type in the database.