Step 1 - Installing Logstash

Follow this article to setup Logstash on the designated server.
Next, open the configuration file (logstash.conf) and add another input  clause, as follows:

SNMP Polling

Add an snmp input. For example:

input {
  snmp {
    get => ["1.3.6.1.2.1.1.1.0", "1.3.6.1.2.1.1.3.0", "1.3.6.1.2.1.1.5.0"]
    hosts => [{host => "udp:127.0.0.1/161" community => "public"}]
  }
}

The input plugin is highly configurable. Refer to the plugin documentation for more configuration options.

SNMP Traps

Add an snmptrap input. For example:

snmptrap {
  port => 1062
}

This plugin can handle SNMPv1, SNMPv2c and Informs (SNMPv3).

Note - if you use custom MIBs in your environment, you will have to import them to Logstash. See the official documentation on how to do this for polling and traps.

That's it. Restart Logstash to start seeing events showing up in Sophie.

Did this answer your question?