If you can use Node-RED that would be the better way. Node-RED has SNMP nodes and PAC Controller nodes, so it is pretty straight forward to get the data and send it to the controller.
Otherwise, this sample code here might help;
If you can use Node-RED that would be the better way. Node-RED has SNMP nodes and PAC Controller nodes, so it is pretty straight forward to get the data and send it to the controller.
Otherwise, this sample code here might help;