All Apps and Add-ons

get SNMP data from hosts listed in csv file

diogofgm
SplunkTrust
SplunkTrust

I want to index snmp data from a number of hosts that i have listed in a csv file. In the csv i'll have the host ip, port and the community string. The idea would be to avoid the need to create an input for each host since the kind of data i'll be using is the same from each host.

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma

Damien_Dallimor
Ultra Champion

If your CSV is a list of host, port and community string , then this is mostly what you would setup via Splunk Web that gets persisted to inputs.conf anyway.
So you may as well just create your inputs.conf file by hand and use this as your "master record"

inputs.conf

#common shared settings , just mock example data

[snmp]   
index = main
sourcetype = my_snmp_data
mib_names = IF-MIB,DNS-SERVER-MIB,BRIDGE-MIB
object_names = 1.3.6.1.2.1.1.3.0
snmp_mode = attributes
snmp_version = 2C


#each specific hosts settings , examples for 2 fictional hosts foo and goo

[snmp://foo]
communitystring = foo
destination = foohost
port = 162
disabled = 0

[snmp:/goo]
communitystring = goo
destination = goohost
port = 163
disabled = 0
0 Karma

diogofgm
SplunkTrust
SplunkTrust

Hey Damien
That's a possible solution/workaround. The main point, and i sorry for not pointing that out in the OP, is: i'm building an app for snmp monitoring and i'm also trying to build a view where the user can insert new hosts without having to edit files since most of the data/inputs will be the same for all host. There are alot of data i want to use and using your modular input i'm not being able to retrieve multiple OIDs in a single input. So i need to have multiple inputs and that might not be easy to manage if you have with hundreds of devices.

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...