SNMP sur Debian

Neslye Messages postés 109 Statut Membre -  
Neslye Messages postés 109 Statut Membre -
Bonjour,

je me permets de poster ce message pour demander de l'aide var je suis confrontée à un souci que je n'arrive pas trouver la solution malgrée mes recherches je n'ai toujours rien :(

j'ai installé Debian et je pensais que j'avais bien installé et activer le SNMP mais ce n'est pas le cas, j'ai testé avec la commande suivante mais cela ne me donne aucune réponse :

netstat -taupe | grep snmp

avez vous une idée ? je vous remercie d'avance.

Neslye

6 réponses

  1. KuKrApOk59 Messages postés 444 Date d'inscription   Statut Membre Dernière intervention   84
     
    Salut,
    Tu pourrais donner le resultat de la commande

    # netstat -taupen
    et
    # ps -ef | grep snmp

    Afin de voir si il est démarré, ou non ?
    et un

    # cat /etc/snmp/snmpd.conf

    Afin de voir ta conf
    0
  2. Neslye Messages postés 109 Statut Membre
     
    salut,

    pour netstat -taupen :

    debian:~# netstat -taupen
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 104 3509 1186/mysqld
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 3224 997/portmap
    tcp 0 0 0.0.0.0:57939 0.0.0.0:* LISTEN 0 3282 1008/rpc.statd
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 103 3937 1287/postgres
    tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 4226 1443/master
    tcp6 0 0 :::80 :::* LISTEN 0 4566 1511/apache2
    tcp6 0 0 ::1:5432 :::* LISTEN 103 3938 1287/postgres
    tcp6 0 0 192.168.0.69:80 192.168.0.52:4463 TIME_WAIT 0 0 -
    tcp6 0 0 192.168.0.69:80 192.168.0.52:4465 ESTABLISHED
    33 2784955 10908/apache2
    udp 0 0 0.0.0.0:68 0.0.0.0:* 0 3443 1262/dhclient3
    udp 0 0 0.0.0.0:50511 0.0.0.0:* 0 3269 1008/rpc.statd
    udp 0 0 127.0.0.1:36304 127.0.0.1:36304 ESTABLISHED 103 3946 1287/postgres
    udp 0 0 0.0.0.0:111 0.0.0.0:* 0 3217 997/portmap
    0 3217 997/portmap
    udp 0 0 0.0.0.0:760 0.0.0.0:* 0 3252 1008/rpc.statd
    udp 0 0 192.168.0.69:123 0.0.0.0:*
    0 4421 1461/ntpd
    udp 0 0 127.0.0.1:123 0.0.0.0:* 0 4420 1461/ntpd
    udp 0 0 0.0.0.0:123 0.0.0.0:* 0 4413 1461/ntpd
    udp6 0 0 fe80::c8e4:1eff:fe7:123 :::* 0 4419 1461/ntpd
    udp6 0 0 ::1:123 :::* 0 4418 1461/ntpd
    udp6 0 0 :::123 :::* 0 4414 1461/ntpd

    debian:~# ps -ef | grep snmp
    root 26324 1677 0 15:13 hvc0 00:00:00 grep snmp

    pour ma configuration voici mon fichier :

    /etc/snmp/snmpd.conf.orig

    # First, map the community name (COMMUNITY) into a security name
    # (local and mynetwork, depending on where the request is coming
    # from):

    #sec.name sourcecommunity
    # com2sec paranoid defaultpublic
    com2sec readonly defaultpublic
    #com2sec readwrite defaultprivate

    ####
    # Second, map the security names into group names:

    #sec.model sec.name
    group MyROSystem v2cparanoid
    group MyROSystem v2cparanoid
    group MyROSystem usmparanoid
    group MyROGroup v2creadonly
    group MyROGroup v2creadonly
    group MyROGroup usmreadonly
    group MyRWGroup v1readwrite
    group MyRWGroup v2creadwrite
    group MyRWGroup usmreadwrite

    Third, create a view for us to let the groups have rights to:

    #incl/excl subtreemask
    view all included .180
    view system included .iso.org.dod.internet.mgmt.mib-2.system

    ####
    # Finally, grant the 2 groups access to the 1 view with different
    # write permissions:

    #context sec.model sec.level match read write notif
    access MyROSystem "" anynoauth exact system none
    access MyROGroup ""anynoauth exact all none none
    access MyRWGroup ""anynoauth exact all all none

    # 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 Unknown (configure /etc/snmp/snmpd.local.conf)
    syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)

    # Example output of snmpwalk:
    # % snmpwalk -v 1 -c public localhost system
    # system.sysDescr.0 = "SunOS name sun4c"
    # system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
    # system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
    # system.sysContact.0 = "Me <me@somewhere.org>"
    # system.sysName.0 = "name"
    # system.sysLocation.0 = "Right here, right now."
    # system.sysServices.0 = 72

    # Examples:
    #

    # Make sure mountd is running
    #proc mountd

    # Make sure there are no more than 4 ntalkds running, but 0 is ok too.
    #proc ntalkd 4

    # Make sure at least one sendmail, but less than or equal to 10 are running.
    #proc sendmail 10 1

    # A snmpwalk of the prTable would look something like this:
    #
    # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2
    # enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
    # enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
    # enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
    # enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
    # enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
    # enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
    # enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
    # enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
    # enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
    # enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
    # enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
    # enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
    # enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
    # enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
    # enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
    # enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
    # enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
    # enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
    enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process run$
    # enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
    # enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
    # enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
    # enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
    # enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
    #
    # Note that the errorFlag for mountd is set to 1 because one is not
    # running (in this case an rpc.mountd is, but thats not good enough),
    and the ErrMessage tells you what's wrong. The configuration
    # imposed in the snmpd.conf file is also shown.
    #
    # Special Case: When the min and max numbers are both 0, it assumes
    # you want a max of infinity and a min of 1.

    je pense que j'ai posté le necessaire :)

    merci en tout cas
    0
  3. KuKrApOk59 Messages postés 444 Date d'inscription   Statut Membre Dernière intervention   84
     
    De mémoire, su Debian, j'avais du modifier le fichier
    /etc/default/snmpd

    J'ai modifié la ligne

    SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
    par

    SNMPDOPTS='-Lsd -Lf /dev/null -u root -I -smux -p /var/run/snmpd.pid 0.0.0.0'
    Je ne sais pas pourquoi avec l'option par défaut, le démon snmp ne se lançait pas
    Peut être est ce ton problème
    (mais dans ma lancée, je n'ai pas demandé ce que contenait ton /etc/default/snmpd)

    J'avais également été jeter un oeil sur
    http://irp.nain-t.net/doku.php/215snmp:30_install_snmp
    Quand j'avais eu besoin d'un coup de main pour faire une conf 'basique' pour éviter tout problème de mauvaise configuration de ma part ...

    Si vous avez votre réponse, pensez à spécifier : [Résolu]
    0
  4. Neslye Messages postés 109 Statut Membre
     
    Re,

    j'ai bien modifié la ligne dans le fichier /etc/default/snmpd

    ça à l'air de mieux fonctioner mais je ne suis pas sûr ...
    0
  5. Vous n’avez pas trouvé la réponse que vous recherchez ?

    Posez votre question
  6. KuKrApOk59 Messages postés 444 Date d'inscription   Statut Membre Dernière intervention   84
     
    Salut,

    Maintenant, que te donne un

    # netstat -taupen
    0
  7. Neslye Messages postés 109 Statut Membre
     
    salut,

    desolée pour le retard

    voici la réponse:

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 104 5484799 19231/mysqld
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 3224 997/portmap
    tcp 0 0 0.0.0.0:57939 0.0.0.0:* LISTEN 0 3282 1008/rpc.statd
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 103 3937 1287/postgres
    tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 4226 1443/master
    tcp6 0 0 :::80 :::* LISTEN 0 3535753 1095/apache2
    tcp6 0 0 ::1:5432 :::* LISTEN 103 3938 1287/postgres
    tcp6 0 0 192.168.0.69:80 192.168.0.52:3928 TIME_WAIT 0 0 -
    tcp6 0 0 192.168.0.69:80 192.168.0.52:3921 TIME_WAIT 0 0 -
    tcp6 0 0 192.168.0.69:80 192.168.0.52:3926 TIME_WAIT 0 0 -
    tcp6 0 0 192.168.0.69:80 192.168.0.52:4058 ESTABLISHED
    33 5533348 30787/apache2
    tcp6 0 0 192.168.0.69:80 192.168.0.52:3923 TIME_WAIT 0 0 -
    udp 0 0 0.0.0.0:68 0.0.0.0:* 0 3443 1262/dhclient3
    udp 0 0 0.0.0.0:50511 0.0.0.0:* 0 3269 1008/rpc.statd
    udp 0 0 127.0.0.1:36304 127.0.0.1:36304 ESTABLISHED 103 3946 1287/postgres
    udp 0 0 0.0.0.0:111 0.0.0.0:* 0 3217 997/portmap
    udp 0 0 0.0.0.0:760 0.0.0.0:* 0 3252 1008/rpc.statd
    udp 0 0 192.168.0.69:123 0.0.0.0:* 0 4421 1461/ntpd
    udp 0 0 127.0.0.1:123 0.0.0.0:* 0 4420 1461/ntpd
    udp 0 0 0.0.0.0:123 0.0.0.0:* 0 4413 1461/ntpd
    udp6 0 0 fe80::c8e4:1eff:fe7:123 :::* 0 4419 1461/ntpd
    udp6 0 0 ::1:123 :::* 0 4418 1461/ntpd
    udp6 0 0 :::123 :::* 0 4414 1461/ntpd
    0