fix: removed snmptranslate from readme and fix default path (#10136)
This commit is contained in:
parent
ba8c29acb0
commit
2b43934174
|
|
@ -6,21 +6,8 @@ notifications (traps and inform requests).
|
||||||
Notifications are received on plain UDP. The port to listen is
|
Notifications are received on plain UDP. The port to listen is
|
||||||
configurable.
|
configurable.
|
||||||
|
|
||||||
### Prerequisites
|
## Configuration
|
||||||
|
|
||||||
This plugin uses the `snmptranslate` programs from the
|
|
||||||
[net-snmp][] project. These tools will need to be installed into the `PATH` in
|
|
||||||
order to be located. Other utilities from the net-snmp project may be useful
|
|
||||||
for troubleshooting, but are not directly used by the plugin.
|
|
||||||
|
|
||||||
These programs will load available MIBs on the system. Typically the default
|
|
||||||
directory for MIBs is `/usr/share/snmp/mibs`, but if your MIBs are in a
|
|
||||||
different location you may need to make the paths known to net-snmp. The
|
|
||||||
location of these files can be configured in the `snmp.conf` or via the
|
|
||||||
`MIBDIRS` environment variable. See [`man 1 snmpcmd`][man snmpcmd] for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
```toml
|
```toml
|
||||||
[[inputs.snmp_trap]]
|
[[inputs.snmp_trap]]
|
||||||
## Transport, local address, and port to listen on. Transport must
|
## Transport, local address, and port to listen on. Transport must
|
||||||
|
|
@ -55,7 +42,7 @@ information.
|
||||||
# priv_password = ""
|
# priv_password = ""
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using a Privileged Port
|
### Using a Privileged Port
|
||||||
|
|
||||||
On many operating systems, listening on a privileged port (a port
|
On many operating systems, listening on a privileged port (a port
|
||||||
number less than 1024) requires extra permission. Since the default
|
number less than 1024) requires extra permission. Since the default
|
||||||
|
|
@ -73,7 +60,7 @@ the privileged port.
|
||||||
To use a privileged port on Linux, you can use setcap to enable the
|
To use a privileged port on Linux, you can use setcap to enable the
|
||||||
CAP_NET_BIND_SERVICE capability on the telegraf binary:
|
CAP_NET_BIND_SERVICE capability on the telegraf binary:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
setcap cap_net_bind_service=+ep /usr/bin/telegraf
|
setcap cap_net_bind_service=+ep /usr/bin/telegraf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -84,21 +71,22 @@ On Mac OS, listening on privileged ports is unrestricted on versions
|
||||||
|
|
||||||
- snmp_trap
|
- snmp_trap
|
||||||
- tags:
|
- tags:
|
||||||
- source (string, IP address of trap source)
|
- source (string, IP address of trap source)
|
||||||
- name (string, value from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
- name (string, value from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
||||||
- mib (string, MIB from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
- mib (string, MIB from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
||||||
- oid (string, OID string from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
- oid (string, OID string from SNMPv2-MIB::snmpTrapOID.0 PDU)
|
||||||
- version (string, "1" or "2c" or "3")
|
- version (string, "1" or "2c" or "3")
|
||||||
- context_name (string, value from v3 trap)
|
- context_name (string, value from v3 trap)
|
||||||
- engine_id (string, value from v3 trap)
|
- engine_id (string, value from v3 trap)
|
||||||
- community (string, value from 1 or 2c trap)
|
- community (string, value from 1 or 2c trap)
|
||||||
- fields:
|
- fields:
|
||||||
- Fields are mapped from variables in the trap. Field names are
|
- Fields are mapped from variables in the trap. Field names are
|
||||||
the trap variable names after MIB lookup. Field values are trap
|
the trap variable names after MIB lookup. Field values are trap
|
||||||
variable values.
|
variable values.
|
||||||
|
|
||||||
### Example Output
|
### Example Output
|
||||||
```
|
|
||||||
|
```shell
|
||||||
snmp_trap,mib=SNMPv2-MIB,name=coldStart,oid=.1.3.6.1.6.3.1.1.5.1,source=192.168.122.102,version=2c,community=public snmpTrapEnterprise.0="linux",sysUpTimeInstance=1i 1574109187723429814
|
snmp_trap,mib=SNMPv2-MIB,name=coldStart,oid=.1.3.6.1.6.3.1.1.5.1,source=192.168.122.102,version=2c,community=public snmpTrapEnterprise.0="linux",sysUpTimeInstance=1i 1574109187723429814
|
||||||
snmp_trap,mib=NET-SNMP-AGENT-MIB,name=nsNotifyShutdown,oid=.1.3.6.1.4.1.8072.4.0.2,source=192.168.122.102,version=2c,community=public sysUpTimeInstance=5803i,snmpTrapEnterprise.0="netSnmpNotificationPrefix" 1574109186555115459
|
snmp_trap,mib=NET-SNMP-AGENT-MIB,name=nsNotifyShutdown,oid=.1.3.6.1.4.1.8072.4.0.2,source=192.168.122.102,version=2c,community=public sysUpTimeInstance=5803i,snmpTrapEnterprise.0="netSnmpNotificationPrefix" 1574109186555115459
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ func init() {
|
||||||
lookupFunc: lookup,
|
lookupFunc: lookup,
|
||||||
ServiceAddress: "udp://:162",
|
ServiceAddress: "udp://:162",
|
||||||
Timeout: defaultTimeout,
|
Timeout: defaultTimeout,
|
||||||
|
Path: []string{"/usr/share/snmp/mibs"},
|
||||||
Version: "2c",
|
Version: "2c",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue