MàJ exemple plugin SNMP
This commit is contained in:
parent
cb3f92fe76
commit
39dec74b2b
|
@ -155,7 +155,12 @@ PUTVAL $(hostname)/bgp_prefixes/count-${PEER} N:${CURRENT_PREFIXES}
|
||||||
Le plugin [snmp](https://collectd.org/documentation/manpages/collectd-snmp.5.shtml) permet de faire des requêtes SNMP à des machines spécifiques.
|
Le plugin [snmp](https://collectd.org/documentation/manpages/collectd-snmp.5.shtml) permet de faire des requêtes SNMP à des machines spécifiques.
|
||||||
Un block `Data` définit l'OID et sous quel format stocker les valeurs récupérées, et un block `Host` définit quelles machines interroger ainsi que la configuration SNMP.
|
Un block `Data` définit l'OID et sous quel format stocker les valeurs récupérées, et un block `Host` définit quelles machines interroger ainsi que la configuration SNMP.
|
||||||
|
|
||||||
Exemple pour récupérer le débit et le nombre de paquets unicast d'un switch, la charge d'un APC, et la fréquence, la tension, l'intensité, la source préférée et le statut d'un ATS.
|
Exemple pour récupérer :
|
||||||
|
|
||||||
|
* Pour un switch : le débit, le nombre de paquets unicast/multicast/broadcast, le nombre d'erreurs, les données des capteurs des SFP, la charge CPU, la RAM utilisée, l'uptime
|
||||||
|
* Pour un APC : la charge
|
||||||
|
* Pour un ATS : la fréquence, la tension, l'intensité, la source préférée et le statut
|
||||||
|
|
||||||
Sous debian, le paquet `snmp` est nécessaire.
|
Sous debian, le paquet `snmp` est nécessaire.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
|
@ -170,62 +175,84 @@ LoadPlugin snmp
|
||||||
<Data "ifmib_if_octets64">
|
<Data "ifmib_if_octets64">
|
||||||
Type "if_octets"
|
Type "if_octets"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.2.1.31.1.1.1.18"
|
TypeInstanceOID "1.3.6.1.2.1.31.1.1.1.18"
|
||||||
Values "1.3.6.1.2.1.31.1.1.1.6" "1.3.6.1.2.1.31.1.1.1.10"
|
Values "1.3.6.1.2.1.31.1.1.1.6" "1.3.6.1.2.1.31.1.1.1.10"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ifmib_if_packets64">
|
<Data "ifmib_if_packets64">
|
||||||
Type "if_packets"
|
Type "if_packets"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.2.1.31.1.1.1.18"
|
TypeInstanceOID "1.3.6.1.2.1.31.1.1.1.1"
|
||||||
Values "1.3.6.1.2.1.31.1.1.1.7" "1.3.6.1.2.1.31.1.1.1.11"
|
Values "1.3.6.1.2.1.31.1.1.1.7" "1.3.6.1.2.1.31.1.1.1.11"
|
||||||
</Data>
|
</Data>
|
||||||
|
<Data "ifmib_if_multicast_packets64">
|
||||||
|
Type "if_packets"
|
||||||
|
Table true
|
||||||
|
TypeInstanceOID "1.3.6.1.2.1.31.1.1.1.18"
|
||||||
|
TypeInstancePrefix "multicast-"
|
||||||
|
Values "1.3.6.1.2.1.31.1.1.1.8" "1.3.6.1.2.1.31.1.1.1.12"
|
||||||
|
</Data>
|
||||||
|
<Data "ifmib_if_broadcast_packets64">
|
||||||
|
Type "if_packets"
|
||||||
|
Table true
|
||||||
|
TypeInstanceOID "IF-MIB::ifAlias"
|
||||||
|
TypeInstancePrefix "broadcast-"
|
||||||
|
Values "1.3.6.1.2.1.31.1.1.1.9" "1.3.6.1.2.1.31.1.1.1.13"
|
||||||
|
</Data>
|
||||||
<Data "ifmib_if_errors">
|
<Data "ifmib_if_errors">
|
||||||
Type "if_errors"
|
Type "if_errors"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.2.1.31.1.1.1.18"
|
TypeInstanceOID "1.3.6.1.2.1.31.1.1.1.1"
|
||||||
Values "1.3.6.1.2.1.2.2.1.14" "1.3.6.1.2.1.2.2.1.20"
|
Values "1.3.6.1.2.1.2.2.1.14" "1.3.6.1.2.1.2.2.1.20"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ifmib_if_dropped">
|
<Data "ifmib_if_dropped">
|
||||||
Type "if_dropped"
|
Type "if_dropped"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.2.1.31.1.1.1.18"
|
TypeInstanceOID "1.3.6.1.2.1.31.1.1.1.1"
|
||||||
Values "1.3.6.1.2.1.2.2.1.13" "1.3.6.1.2.1.2.2.1.19"
|
Values "1.3.6.1.2.1.2.2.1.13" "1.3.6.1.2.1.2.2.1.19"
|
||||||
</Data>
|
</Data>
|
||||||
|
# Capteurs des SFP fibre pour Cisco Nexus
|
||||||
|
<Data "sfp_sensors">
|
||||||
|
Type "gauge"
|
||||||
|
Scale 0.001
|
||||||
|
Table true
|
||||||
|
TypeInstanceOID ".1.3.6.1.2.1.47.1.1.1.1.2"
|
||||||
|
Values ".1.3.6.1.4.1.9.9.91.1.1.1.1.4"
|
||||||
|
</Data>
|
||||||
# https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15215-collect-cpu-util-snmp.html
|
# https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15215-collect-cpu-util-snmp.html
|
||||||
<Data "cpu_5s">
|
<Data "cpu_5s">
|
||||||
Type "cpufreq"
|
Type "cpufreq"
|
||||||
Instance "cpu_5s"
|
TypeInstance "cpu_5s"
|
||||||
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.6.1"
|
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.6.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "cpu_1m">
|
<Data "cpu_1m">
|
||||||
Type "cpufreq"
|
Type "cpufreq"
|
||||||
Instance "cpu_1m"
|
TypeInstance "cpu_1m"
|
||||||
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.7.1"
|
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.7.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "cpu_5m">
|
<Data "cpu_5m">
|
||||||
Type "cpufreq"
|
Type "cpufreq"
|
||||||
Instance "cpu_5m"
|
TypeInstance "cpu_5m"
|
||||||
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.8.1"
|
Values "1.3.6.1.4.1.9.9.109.1.1.1.1.8.1"
|
||||||
</Data>
|
</Data>
|
||||||
# https://community.ipswitch.com/s/article/What-SNMP-OID-does-WhatsUp-Use-for-Cisco-Memory-and-CPU
|
# https://community.ipswitch.com/s/article/What-SNMP-OID-does-WhatsUp-Use-for-Cisco-Memory-and-CPU
|
||||||
<Data "memory_used">
|
<Data "memory_used">
|
||||||
Type "memory"
|
Type "memory"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.4.1.9.9.48.1.1.1.2"
|
TypeInstanceOID "1.3.6.1.4.1.9.9.48.1.1.1.2"
|
||||||
InstancePrefix "Used - "
|
TypeInstancePrefix "Used - "
|
||||||
Values "1.3.6.1.4.1.9.9.48.1.1.1.5"
|
Values "1.3.6.1.4.1.9.9.48.1.1.1.5"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "memory_free">
|
<Data "memory_free">
|
||||||
Type "memory"
|
Type "memory"
|
||||||
Table true
|
Table true
|
||||||
Instance "1.3.6.1.4.1.9.9.48.1.1.1.2"
|
TypeInstanceOID "1.3.6.1.4.1.9.9.48.1.1.1.2"
|
||||||
InstancePrefix "Free - "
|
Type InstancePrefix "Free - "
|
||||||
Values "1.3.6.1.4.1.9.9.48.1.1.1.6"
|
Values "1.3.6.1.4.1.9.9.48.1.1.1.6"
|
||||||
</Data>
|
</Data>
|
||||||
# https://community.cisco.com/t5/switching/snmp-uptime/td-p/939932
|
# https://community.cisco.com/t5/switching/snmp-uptime/td-p/939932
|
||||||
<Data "uptime">
|
<Data "uptime">
|
||||||
Type "uptime"
|
Type "uptime"
|
||||||
Instance "uptime"
|
TypeInstance "uptime"
|
||||||
Values ".1.3.6.1.6.3.10.2.1.3.0"
|
Values ".1.3.6.1.6.3.10.2.1.3.0"
|
||||||
</Data>
|
</Data>
|
||||||
|
|
||||||
|
@ -233,49 +260,49 @@ LoadPlugin snmp
|
||||||
Address "192.0.2.1"
|
Address "192.0.2.1"
|
||||||
Version 2
|
Version 2
|
||||||
Community "public"
|
Community "public"
|
||||||
Collect "ifmib_if_octets64" "ifmib_if_packets64" "ifmib_if_errors" "ifmib_if_dropped" "memory_used" "memory_free" "uptime"
|
Collect "ifmib_if_octets64" "ifmib_if_packets64" "ifmib_if_multicast_packets64" "ifmib_if_broadcast_packets64" "ifmib_if_errors" "ifmib_if_dropped" "sfp_sensors" "cpu_5s" "cpu_1m" "cpu_5m" "memory_used" "memory_free" "uptime"
|
||||||
</Host>
|
</Host>
|
||||||
|
|
||||||
# APC
|
# APC
|
||||||
<Data "apc_current_load">
|
<Data "apc_current_load">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "apc_current_load"
|
TypeInstance "apc_current_load"
|
||||||
Scale 0.1
|
Scale 0.1
|
||||||
Values ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1"
|
Values ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "apc_current_low">
|
<Data "apc_current_low">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "apc_current_low"
|
TypeInstance "apc_current_low"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.1"
|
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "apc_current_near">
|
<Data "apc_current_near">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "apc_current_near"
|
TypeInstance "apc_current_near"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.1"
|
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "apc_current_overload">
|
<Data "apc_current_overload">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "apc_current_overload"
|
TypeInstance "apc_current_overload"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.1"
|
Values ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.1"
|
||||||
</Data>
|
</Data>
|
||||||
# Pour les APCs avec compteurs par prises
|
# Pour les APCs avec compteurs par prises
|
||||||
<Data "apc_outlet_current">
|
<Data "apc_outlet_current">
|
||||||
Type "current"
|
Type "current"
|
||||||
Table true
|
Table true
|
||||||
Instance ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
TypeInstanceOID ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
||||||
Scale 0.1
|
Scale 0.1
|
||||||
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.6"
|
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.6"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "apc_outlet_watt">
|
<Data "apc_outlet_watt">
|
||||||
Type "energy"
|
Type "energy"
|
||||||
Table true
|
Table true
|
||||||
Instance ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
TypeInstanceOID ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.7"
|
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.7"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "apc_outlet_total_energy">
|
<Data "apc_outlet_total_energy">
|
||||||
Type "energy_wh"
|
Type "energy_wh"
|
||||||
Table true
|
Table true
|
||||||
Instance ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
TypeInstanceOID ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.1"
|
||||||
Scale 0.1
|
Scale 0.1
|
||||||
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.11"
|
Values ".1.3.6.1.4.1.318.1.1.26.9.4.3.1.11"
|
||||||
</Data>
|
</Data>
|
||||||
|
@ -299,66 +326,66 @@ LoadPlugin snmp
|
||||||
# ATS
|
# ATS
|
||||||
<Data "ats_input_freq_a">
|
<Data "ats_input_freq_a">
|
||||||
Type "frequency"
|
Type "frequency"
|
||||||
Instance "ats_input_freq_a"
|
TypeInstance "ats_input_freq_a"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_input_volt_a">
|
<Data "ats_input_volt_a">
|
||||||
Type "voltage"
|
Type "voltage"
|
||||||
Instance "ats_input_volt_a"
|
TypeInstance "ats_input_volt_a"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.1.1.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.1.1.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_input_freq_b">
|
<Data "ats_input_freq_b">
|
||||||
Type "frequency"
|
Type "frequency"
|
||||||
Instance "ats_input_freq_b"
|
TypeInstance "ats_input_freq_b"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.2"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.2"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_input_volt_b">
|
<Data "ats_input_volt_b">
|
||||||
Type "voltage"
|
Type "voltage"
|
||||||
Instance "ats_input_volt_b"
|
TypeInstance "ats_input_volt_b"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.2.1.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.2.1.1"
|
||||||
</Data>
|
</Data>
|
||||||
|
|
||||||
<Data "ats_output_volt">
|
<Data "ats_output_volt">
|
||||||
Type "voltage"
|
Type "voltage"
|
||||||
Instance "ats_output_volt"
|
TypeInstance "ats_output_volt"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.4.3.1.3.1.1.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.4.3.1.3.1.1.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_output_current">
|
<Data "ats_output_current">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "ats_output_current"
|
TypeInstance "ats_output_current"
|
||||||
Scale 0.1
|
Scale 0.1
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_output_freq">
|
<Data "ats_output_freq">
|
||||||
Type "frequency"
|
Type "frequency"
|
||||||
Instance "ats_output_freq"
|
TypeInstance "ats_output_freq"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.1"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.1"
|
||||||
</Data>
|
</Data>
|
||||||
|
|
||||||
<Data "ats_source_preferred">
|
<Data "ats_source_preferred">
|
||||||
Type "count"
|
Type "count"
|
||||||
Instance "ats_source_preferred"
|
TypeInstance "ats_source_preferred"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.4.2.0"
|
Values ".1.3.6.1.4.1.318.1.1.8.4.2.0"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_source_status">
|
<Data "ats_source_status">
|
||||||
Type "count"
|
Type "count"
|
||||||
Instance "ats_source_status"
|
TypeInstance "ats_source_status"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.1.2.0"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.1.2.0"
|
||||||
</Data>
|
</Data>
|
||||||
|
|
||||||
<Data "ats_status_redundancy">
|
<Data "ats_status_redundancy">
|
||||||
Type "count"
|
Type "count"
|
||||||
Instance "ats_status_redundancy"
|
TypeInstance "ats_status_redundancy"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.1.3.0"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.1.3.0"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_status_current_state">
|
<Data "ats_status_current_state">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "ats_status_current_state"
|
TypeInstance "ats_status_current_state"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.5.1.4.0"
|
Values ".1.3.6.1.4.1.318.1.1.8.5.1.4.0"
|
||||||
</Data>
|
</Data>
|
||||||
<Data "ats_status_current_limit">
|
<Data "ats_status_current_limit">
|
||||||
Type "current"
|
Type "current"
|
||||||
Instance "ats_status_current_limit"
|
TypeInstance "ats_status_current_limit"
|
||||||
Values ".1.3.6.1.4.1.318.1.1.8.4.6.0"
|
Values ".1.3.6.1.4.1.318.1.1.8.4.6.0"
|
||||||
</Data>
|
</Data>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue