To use this function add it to the class library file named OrchestratorService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorService.ts
Function SNMPSnmpResultProcess
Description: Orchestrator Function to Proccess SNMP Device Traps
publicSNMPSnmpResultProcess(objSNMPSnmpResult:SNMPSnmpResult):Properties[]{
letarrProperties:Properties[]= [];
if (objSNMPSnmpResult.type=="Array"){
letarrArrayValue:SNMPSnmpResult[]=objSNMPSnmpResult.arrayValue;
arrArrayValue.forEach((objArrayValue:SNMPSnmpResult):void=>{
letobjProperties:Properties=newProperties();
objProperties.put("oid",objArrayValue.oid);
objProperties.put("type",objArrayValue.type);
objProperties.put("snmpType",objArrayValue.snmpType);
objProperties.put("value",objArrayValue.stringValue);
arrProperties.push(objProperties);
});
}
elseif (objSNMPSnmpResult.type=="String"){
letobjProperties:Properties=newProperties();
objProperties.put("oid",objSNMPSnmpResult.oid);
objProperties.put("type",objSNMPSnmpResult.type);
objProperties.put("snmpType",objSNMPSnmpResult.snmpType);
objProperties.put("value",objSNMPSnmpResult.stringValue);
arrProperties.push(objProperties);
}
elseif (objSNMPSnmpResult.type=="Number"){
letobjProperties:Properties=newProperties();
objProperties.put("oid",objSNMPSnmpResult.oid);
objProperties.put("type",objSNMPSnmpResult.type);
objProperties.put("snmpType",objSNMPSnmpResult.snmpType);
objProperties.put("value",objSNMPSnmpResult.numberValue);
arrProperties.push(objProperties);
}
returnarrProperties;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
