« Observium : Configuration SNMPD client » : différence entre les versions
De www.yakakliker.org
Aucun résumé des modifications |
Aucun résumé des modifications |
||
(5 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 9 : | Ligne 9 : | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo nano /etc/snmp/snmp.conf | sudo nano /etc/snmp/snmp.conf | ||
</syntaxhighlight>Commenter ''mibs:''<syntaxhighlight lang="bash"> | </syntaxhighlight> | ||
* Commenter ''mibs:''<syntaxhighlight lang="bash"> | |||
# As the snmp packages come without MIB files due to license reasons, loading | # As the snmp packages come without MIB files due to license reasons, loading | ||
# of MIBs is disabled by default. If you added the MIBs you can reenable | # of MIBs is disabled by default. If you added the MIBs you can reenable | ||
Ligne 26 : | Ligne 28 : | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Listen for connections on all interfaces (both IPv4 *and* IPv6) | # Listen for connections on all interfaces (both IPv4 *and* IPv6) | ||
agentAddress udp:161,udp6:[::1]:161 | #agentAddress udp:161,udp6:[::1]:161 | ||
agentAddress udp:161,tcp:161 | |||
# Full view access | # Full view access | ||
Ligne 72 : | Ligne 76 : | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo service snmpd restart | sudo service snmpd restart | ||
</syntaxhighlight> | |||
==== Petit test ==== | |||
* Depuis Observium | |||
<syntaxhighlight lang="bash"> | |||
snmpwalk -v 2c -c public IP 1 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Ligne 79 : | Ligne 91 : | ||
[[Catégorie:SNMP]] | [[Catégorie:SNMP]] | ||
[[Catégorie:Linux]] | [[Catégorie:Linux]] | ||
<html> | |||
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script> | |||
<script> | |||
kofiWidgetOverlay.draw('yakakliker', { | |||
'type': 'floating-chat', | |||
'floating-chat.donateButton.text': 'Café', | |||
'floating-chat.donateButton.background-color': '#00b9fe', | |||
'floating-chat.donateButton.text-color': '#fff' | |||
}); | |||
</script> | |||
</html> | |||
<html> | |||
<a href="https://www.compteurdevisite.com" title="compteur web gratuit sans pub"><img src="https://counter6.optistats.ovh/private/compteurdevisite.php?c=b4epghealnwlf7wuq7gn3ygll9aywrfx" border="0" title="compteur web gratuit sans pub" alt="compteur web gratuit sans pub"></a> | |||
</html> |
Dernière version du 17 février 2025 à 17:59
Installation du client
sudo apt-get install snmp snmp-mibs-downloader
sudo apt-get install snmpd
Edition du fichier conf /etc/snmp/snmp.conf
sudo nano /etc/snmp/snmp.conf
- Commenter mibs:
# As the snmp packages come without MIB files due to license reasons, loading # of MIBs is disabled by default. If you added the MIBs you can reenable # loading them by commenting out the following line. #mibs : # If you want to globally change where snmp libraries, commands and daemons # look for MIBS, change the line below. Note you can set this for individual # tools with the -M option or MIBDIRS environment variable. # #mibdirs /usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf
Edition du fichier conf /etc/snmp/snmpd.conf
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161
agentAddress udp:161,tcp:161
# Full view access
view all included .1
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# Default access to full view
rocommunity public default -V all
# Default access to basic system info
#rocommunity public default -V systemonly
# System contact and location
syslocation Rack/Room/Building, Street, City, Country [GPSX,Y]
syscontact Contact Person <your@email.address>
# Disk Monitoring
disk / 10000
disk /var 5%
includeAllDisks 10%
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro
# This lines allows Observium to detect hardware, vendor and serial
extend .1.3.6.1.4.1.2021.7890.2 hardware /bin/cat /sys/devices/virtual/dmi/id/product_name
extend .1.3.6.1.4.1.2021.7890.3 vendor /bin/cat /sys/devices/virtual/dmi/id/sys_vendor
extend .1.3.6.1.4.1.2021.7890.4 serial /bin/cat /sys/devices/virtual/dmi/id/product_serial
# This line allows Observium to collect an accurate uptime
extend uptime /bin/cat /proc/uptime
# This line enables Observium's ifAlias description injection
#pass_persist .1.3.6.1.2.1.31.1.1.1.18 /usr/local/bin/ifAlias_persist
Redémarrage du service
sudo service snmpd restart
Petit test
- Depuis Observium
snmpwalk -v 2c -c public IP 1