logstash-plugins / logstash-integration-snmp

Logstash Integration Plugin for SNMP, including SNMP input and SNMP Trap Plugins
Apache License 2.0
0 stars 3 forks source link

Config option for non-standard host defaults #27

Open axrayn opened 5 years ago

axrayn commented 5 years ago

@colinsurprenant Could we do a config option so that users could specify the 'default' options that are the defaults for their environment without having to list them in every host entry?

e.g. instead of the plugin defaults for community, version, retries, and timeout (public, 2c, 2, 1000 respectively) and needing to use the config:

input {
  snmp {
    get => ["1.3.6.1.2.1.1.1.0"]
    hosts => [
        {host => "udp:127.0.0.1/161" community => "notpublic" retries => 1 timeout => 2000},
        {host => "udp:192.168.0.1/161" community => "notpublic" retries => 1 timeout => 2000}
    ]
  }
}

having a 'host_defaults' options so that users can specify their defaults:

input {
  snmp {
    get => ["1.3.6.1.2.1.1.1.0"]
    host_defaults => {community => "notpublic" retries => 1 timeout => 2000}
    hosts => [
        {host => "udp:127.0.0.1/161"},
        {host => "udp:192.168.0.1/161"}
    ]
  }
}

host parameters would then be checked in the order of hosts entry, host defaults, plugin defaults.

colinsurprenant commented 5 years ago

@axrayn +1 good idea.