VMware Cloud Community
brothertertle
Contributor
Contributor
Jump to solution

SNMP Trap Parse

Hello

I have a trap coming in from VROPS with no issues

I am able to get the trap output in the Logs tab of the workflow

But the workflow that accepts the trap is not passing the trapData to the next workflow to Parse it

var snmpResult = SnmpService.retrieveTriggerData(trigger);

var data = System.getModule("com.vmware.library.snmp").processSnmpResult(snmpResult);

trapData = data;

//System.log("Enterprise: " + snmpResult.enterprise);

System.getModule("com.vmware.library.snmp").logResult(trapData);

var wfId = "30c94852-008d-40ee-a31c-ac13e67289a4"

//Function to set variables to pass to workflow and start workflow

//Define variables early or set them here

// function to launch WF

function runWF(wfId,trapData)

{

var workflowToLaunch = Server.getWorkflowWithId(wfId);

if (workflowToLaunch == null)

{

throw "Workflow not found";

}

var workflowParameters = new Properties();

workflowParameters.put(trapData);

System.log("Launching Auto Grow VM Drives Workflow. Please refer to that workflow for specific logs.");

var wfToken = workflowToLaunch.execute(workflowParameters);

return wfToken;

}




I set the parameters like this

Attributes

trigger

device

MessageOID

wfId



Outputs

trapData

Looks like the trapData never gets any data
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Properties#put() method accepts two inputs - key and value. You are passing only one (trapData).

View solution in original post

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Properties#put() method accepts two inputs - key and value. You are passing only one (trapData).

0 Kudos
brothertertle
Contributor
Contributor
Jump to solution

Thanks

I added the key and call the Function with no Issues

0 Kudos