Monitorer son serveur Linux avec MRTG
Configuration de SNMP
On va commencer par éditer le fichier de configuration SNMP :
root@localhost # nano /etc/snmp/snmpd.conf
Il faut autoriser l'accés en lecture des données SNMP.
Par
défaut, la ligne est décommentée. Entre la partie "First," et "Second"
du fichier de configuration, il faut commenter la ligne "com2sec
paranoid default public" en rajoutant un "#" puis supprimer le "#" de
la ligne "com2sec readonly default public".
####
# First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):
# sec.name source community
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private
####
# Second, map the security names into group names:
Modifier
la partie "syslocation" en mettant le pays où se trouve votre serveur,
donc "syslocation France", il faut également modifier le contact
"syscontact", j'ai mis "syscontact MonPseudo <root@localhost>".
###############################################################################
# System contact information
#
# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file. **PLEASE NOTE** that setting
# the value of these objects here makes these objects READ-ONLY
# (regardless of any access control settings). Any attempt to set the
# value of an object whose value is given here will fail with an error
# status of notWritable.
syslocation France (configure /etc/snmp/snmpd.local.conf)
syscontact Ludovic <root@localhost> (configure /etc/snmp/snmpd.local.conf)
Comme toutes les modifications, il faut redémarrer le service, on redémarre donc SNMP :
root@localhost # /etc/init.d/snmpd restart