Hello,
I am using telegraf influx grafana for monitoring the network devices.
I have been using inputs.snmp with multiple tables for interface, bgp and fru.
In one of the table I need to filter the metrics based on value, if I use tagpass it does the job and filters only those metrics but then its drops all other tables. Is there a way to apply tagpass only to a table. I am very new to influx and telegraf, please help. Here is my telegraf config
[[inputs.snmp]]
agents = [ “device1:161”,
“device2:161”,
]
name_prefix = “snmp_”
interval = “10000ms”
version = 2
community = “public”
#################################### SYSTEM FIELDS ##########################################
[[inputs.snmp.field]]
name = “hostname”
oid = “SNMPv2-MIB::sysName.0”
is_tag = true
[[inputs.snmp.field]]
name = “uptime”
oid = “SNMPv2-MIB::sysUpTime.0”
[[inputs.snmp.field]]
name = “jnxBoxSerialNo”
oid=“JUNIPER-MIB::jnxBoxSerialNo.0”
[[inputs.snmp.field]]
name = “jnxBoxDescr”
oid=“JUNIPER-MIB::jnxBoxDescr.0”
[[inputs.snmp.field]]
name = “jnxBoxInstalled”
oid=“JUNIPER-MIB::jnxBoxInstalled.0”
[[inputs.snmp.field]]
name = “sysApplInstallPkgVersion”
oid = “SYSAPPL-MIB::sysApplInstallPkgVersion.2”
#################################### SYSTEM Operating table ##########################################
[[inputs.snmp.table]]
name = “sys”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “OperatingDescr”
oid=“JUNIPER-MIB::jnxOperatingDescr”
is_tag = true
[[inputs.snmp.table.field]]
name = “OperatingState”
oid=“JUNIPER-MIB::jnxOperatingState”
[[inputs.snmp.table.field]]
name = “FpcOperatingTemp”
oid=“JUNIPER-MIB::jnxOperatingTemp”
[[inputs.snmp.table.field]]
name = “OperatingCPU”
oid=“JUNIPER-MIB::jnxOperatingCPU”
[[inputs.snmp.table.field]]
name = “OperatingMemory”
oid=“JUNIPER-MIB::jnxOperatingMemory”
[[inputs.snmp.table.field]]
name = “OperatingBuffer”
oid = “JUNIPER-MIB::jnxOperatingBuffer”
#################################### BGP table ##########################################
[[inputs.snmp.table]]
name = “BGP”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “bgpPeerState”
oid = “BGP4-MIB::bgpPeerState”
[[inputs.snmp.table.field]]
name = “bgpPeerRemoteAddr”
oid = “BGP4-MIB::bgpPeerRemoteAddr”
is_tag = true
[[inputs.snmp.table.field]]
name = “bgpPeerRemoteAs”
oid = “BGP4-MIB::bgpPeerRemoteAs”
[[inputs.snmp.table.field]]
name = “bgpPeerFsmEstablishedTransitions”
oid = “BGP4-MIB::bgpPeerFsmEstablishedTransitions”
#################################### Interface table ##########################################
[[inputs.snmp.table]]
name = “interfaces_statistics”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “ifName”
oid = “IF-MIB::ifName”
is_tag = true
[[inputs.snmp.table.field]]
name = “ifHCInOctets”
oid = “IF-MIB::ifHCInOctets”
[[inputs.snmp.table.field]]
name = “ifHCOutOctets”
oid = “IF-MIB::ifHCOutOctets”
[[inputs.snmp.table.field]]
name = “ifHCOutUcastPkts”
oid = “IF-MIB::ifHCOutUcastPkts”
[[inputs.snmp.table.field]]
name = “ifHCInUcastPkts”
oid = “IF-MIB::ifHCInUcastPkts”
[[inputs.snmp.table.field]]
name = “ifOperStatus”
oid = “IF-MIB::ifOperStatus”
[[inputs.snmp.table.field]]
name = “ifAdminStatus”
oid = “IF-MIB::ifAdminStatus”
[[inputs.snmp.table.field]]
name = “ifLastChange”
oid = “IF-MIB::ifLastChange”
#################################### Power Supply ##########################################
[[inputs.snmp.table]]
name = “fru”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “jnxFruState”
oid=“JUNIPER-MIB::jnxFruState”
[[inputs.snmp.table.field]]
name = “jnxFruType”
oid=“JUNIPER-MIB::jnxFruType”
is_tag = true
[[inputs.snmp.table.field]]
name = “jnxFruName”
oid=“JUNIPER-MIB::jnxFruName”
is_tag = true
this line
[inputs.snmp.tagpass]
jnxFruType = [“7”]
#################################### Ping ##########################################
[[inputs.ping]]
urls = [ “device1”,
“device2”
]
count = 1
method = “native”
[[outputs.influxdb]]
urls = [“http://influxdb:8086”]
database = “juniper”
timeout = “15s”
username = “myuser”
password = “mypass”
[agent]
quiet = false
debug = true
This is the influxdb
Connected to http://localhost:8086 version 1.7.2
InfluxDB shell version: 1.7.2
Enter an InfluxQL query
use juniper
Using database juniper
show measurements
name: measurements
name
ping
snmp_fru
Only the table with tag pass is present and other tables are gone.
Without tagpass I could get all the other tables.
Thanks.