Skip to content

Receiving Custom Key Value Events via SNMP


This application demonstrates how to configure WSO2 Streaming Integrator Tooling to resive snmp source via SNMP in keyvalue using custom mapping.


  1. Save this sample.
  2. Install snmp agent on your network node.
    • for linux can install snmpd / for windows it can be configured by 'windows features'.
    • configure snmp agent ex:- community string, port, user access.
  3. If there is no syntax error, the following message is shown on the console:
      • SNMP-get-request-app successfully deployed.

Executing the Sample:

  1. Start the Siddhi application by clicking on 'Run'.
  2. If the Siddhi application starts successfully, the following messages are shown on the console:
    • SNMP-set-request-app - Started Successfully!

Viewing the Results:

See the output. Following message would be shown on the console.

INFO {} - SNMP-get-request-app : logStream : Event{timestamp=1************, data=[1:28:33.05, [email protected]], isExpired=false}
INFO {} - SNMP-get-request-app : logStream : Event{timestamp=1************, data=[1:28:38.05, [email protected]], isExpired=false}

@App:description('listening oid status from agent')

@source(type ='snmp',
    @map(type='keyvalue',    @attributes(sysUpTime= '', sysContact = '') ),
    host ='',
    version = 'v1',
    request.interval = '5000',
    community = 'public',
    agent.port = '2019',
define stream inputStream(sysUpTime string, sysContact string);

define stream logStream (sysUpTime string, sysContact string);

-- passthrough data in the inputStream to logStream
from inputStream
select *
insert into logStream;