doc:appunti:linux:sa:snmp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:sa:snmp [2011/05/18 12:13] – [Aggiunta di sensori SNMP] niccolo | doc:appunti:linux:sa:snmp [2020/04/01 11:40] (current) – [SNMP con systemd su Debian 9 e seguenti] niccolo | ||
---|---|---|---|
Line 21: | Line 21: | ||
.1.3.6.1.2.1.31.1.1.1.1.2 | .1.3.6.1.2.1.31.1.1.1.1.2 | ||
- | # snmptranslate .1.3.6.1.2.1.31.1.1.1.1.2 | + | # snmptranslate |
IF-MIB:: | IF-MIB:: | ||
Line 82: | Line 82: | ||
La versione più recente del pacchetto Debian binda il demone solo sull' | La versione più recente del pacchetto Debian binda il demone solo sull' | ||
+ | ==== Controllo del log ==== | ||
+ | L' | ||
+ | |||
+ | < | ||
+ | SNMPDOPTS=' | ||
+ | </ | ||
+ | |||
+ | In questo caso **S0-5** significa loggare su syslog da '' | ||
===== Aggiunta di sensori SNMP ===== | ===== Aggiunta di sensori SNMP ===== | ||
Line 101: | Line 109: | ||
Come si vede il valore è disponibile sotto un MIB differente, la radice in questo caso è .1.3.6.1.4.1.2021.8.1. (UCD-SNMP-MIB:: | Come si vede il valore è disponibile sotto un MIB differente, la radice in questo caso è .1.3.6.1.4.1.2021.8.1. (UCD-SNMP-MIB:: | ||
- | Con la nuova sintassi di **'' | + | Con la nuova sintassi di **'' |
< | < | ||
Line 287: | Line 295: | ||
</ | </ | ||
- | ===== MIBs e Debian Squeeze ===== | + | Temperature graph using **lmsensors**. Verify that the version of Net-SNMP on the target system was compiled with the lmSensors extension by running **'' |
+ | |||
+ | < | ||
+ | snmpwalk -v2c -c public localhost 1.3.6.1.4.1.2021.13.16 | ||
+ | </ | ||
+ | |||
+ | In my case the temperature is multiplied by 1000: | ||
+ | |||
+ | < | ||
+ | ### Sensor temp1 | ||
+ | Target[temp1]: | ||
+ | Factor[temp1]: | ||
+ | YTicsFactor[temp1]: | ||
+ | Title[temp1]: | ||
+ | PageTop[temp1]: | ||
+ | Options[temp1]: | ||
+ | Colours[temp1]: | ||
+ | MaxBytes[temp1]: | ||
+ | Unscaled[temp1]: | ||
+ | YLegend[temp1]: | ||
+ | ShortLegend[temp1]: | ||
+ | Legend1[temp1]: | ||
+ | Legend2[temp1]: | ||
+ | LegendI[temp1]: | ||
+ | LegendO[temp1]: | ||
+ | </ | ||
+ | |||
+ | It seems that MRTG does not support UTF-8 (even version 2.17.4), so the configuration file should be encoded in ISO_8859-1. Special characters used in HTML output should be encoded properly. | ||
+ | |||
+ | See this article: [[http:// | ||
+ | |||
+ | ===== MIBs e Debian | ||
+ | |||
+ | Vedere il [[https:// | ||
Tradizionalmente i file contenenti i MIBs di [[http:// | Tradizionalmente i file contenenti i MIBs di [[http:// | ||
Line 301: | Line 342: | ||
</ | </ | ||
- | Stessa cosa bisogna farla per il demone snmpd, | + | Stessa cosa bisogna farla per il demone snmpd, |
< | < | ||
- | # Don't load any MIBs by default. | + | export MIBS=UCD-SNMP-MIB |
- | # You might comment this lines once you have the MIBs downloaded. | + | |
- | #export MIBS= | + | |
</ | </ | ||
Line 352: | Line 391: | ||
NET-SNMP-EXTEND-MIB:: | NET-SNMP-EXTEND-MIB:: | ||
</ | </ | ||
+ | |||
+ | ===== SNMP su ipv6 ===== | ||
+ | |||
+ | Con Debian Wheezy sono necessarie alcune accortezze perché SNMP risponda anche su IPV6, in particolare **''/ | ||
+ | |||
+ | < | ||
+ | agentAddress | ||
+ | agentaddress | ||
+ | |||
+ | rocommunity | ||
+ | rocommunity6 public default | ||
+ | </ | ||
+ | |||
+ | ===== SNMP con systemd su Debian 9 e seguenti ===== | ||
+ | |||
+ | **Debian 9 Stretch** utilizza il sistema di init **systemd** invece del vecchio // | ||
+ | |||
+ | La risoluzione degli OIDs nella loro descrizione testuale richiede sempre l' | ||
+ | |||
+ | < | ||
+ | #mibs : | ||
+ | </ | ||
+ | |||
+ | Eventuali personalizzazioni dei parametri di snmpd non si fanno più con la variabile d' | ||
+ | |||
+ | Ecco ad esempio come modificare la riga **ExecStart** per diminuire il logging e sopprimere tutte le righe **Connection from UDP** che riempiono il syslog (nota: si modifica **%%-Lsd%%** in **%%-LSwd%%**): | ||
+ | |||
+ | < | ||
+ | ExecStart=/ | ||
+ | -I -smux, | ||
+ | </ | ||
+ | |||
+ | In alternativa a **sostituire completamente il file unit** (cioè il file / | ||
+ | |||
+ | < | ||
+ | [Service] | ||
+ | Environment=" | ||
+ | ExecStart= | ||
+ | ExecStart=/ | ||
+ | -I -smux, | ||
+ | </ | ||
+ |
doc/appunti/linux/sa/snmp.1305713614.txt.gz · Last modified: 2011/05/18 12:13 by niccolo