Snmp & mrtg

Bonjour.

J’ai un autre problème qui suivient aujourd’hui.
Ce problème se rapporte au graphique MRTG.

J’ai cherché pendant plus de 3heures.
J’ai même utilisé la fonction rechercher du forum !
Mais je n’ai rien trouvé.

Voilà le problème que me dit ma machine :

# cfgmaker --global 'WorkDir: /home/reg-www/www/mrtg' --global 'Language: French' --output /etc/mrtg.cfg public@127.0.0.1 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.1.9.1.4.9) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868514 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 733 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.1) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868508 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.1 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 181 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.3) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868507 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.3 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 181 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.7) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868506 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.7 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 181 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.8) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868505 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 181 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.4) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868504 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.4 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 181 SNMP Error: Received SNMP response with error code error status: noSuchName index 1 (OID: 1.3.6.1.2.1.2.2.1.5) SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161) community: "public" request ID: -1662868503 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/share/perl5/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.5 on public@127.0.0.1::::::v4only at /usr/bin/cfgmaker line 220

Je ne sais pas quoi faire.

Voici mon /etc/mrtg.cfg

# Created by
# /usr/bin/cfgmaker --global 'WorkDir: /home/reg-www/www/mrtg' --global 'Language: French' --output /etc/mrtg.cfg public@127.0.0.1


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  for Debian
WorkDir: /var/www/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no
WorkDir: /home/reg-www/www/mrtg
Language: French

######################################################################
# System: ks357764.kimsufi.com
# Description: Linux ks357764.kimsufi.com 2.6.24.5-grsec-xxxx-grs-ipv4-32 #1 SMP Wed Apr 23 17:14:18 CEST 2008 i686
# Contact: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
# Location: Unknown (configure /etc/snmp/snmpd.local.conf)
######################################################################

Les lignes posant problème dans /usr/share/perl5/SNMP_util.pm :

[...]
627  while(($SNMP_util::Version ne '1' && $session->{'use_getbulk'})
    ? $session->getbulk_request_response(0,
                                          $session->default_max_repetitions(),
                                          @nnoid)
    : $session->getnext_request_response(@nnoid))
632  {
    $got = 1;
    $response = $session->pdu_buffer;
635    ($bindings) = $session->decode_get_response($response);
    $ix = 0;
    while ($bindings) {
638      ($binding, $bindings) = decode_sequence($bindings);
      unless ($nnoid[$ix]) { # IlvJa
        $ix = ++$ix % (scalar @avars);
641        next;
642      }
[...]

Je vous remercie de l’aide que vous y apporterez.

Yukiz

Salut,

A première vue je dirais que tu n’as pas les mibs qui permet la traduction des OIDs. ( /usr/share/snmp/mibs )
As-tu configurer snmp et installé net-snmp ?

Snmp vient d’être installé.
Mais pour net-snmp

# apt-get install net-snmp Lecture des listes de paquets... Fait Construction de l'arbre des dépendances... Fait E: Impossible de trouver le paquet net-snmp

Voici le code généré après SNMP installé.
Comment le configuré ?!
Mon SNMPD.CONF est configuré, oui.

SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.1.9.1.4.9)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425043
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 733
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.1)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425049
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.1 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 181
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.3)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425050
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.3 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 181
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.7)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425051
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.7 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 181
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.8)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425052
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 181
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.4)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425053
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.4 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 181
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.2.2.1.5)
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 97425054
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.5 on public@127.0.0.1::::::v4only
 at /usr/bin/cfgmaker line 220

Merci.

Oui je me suis trompé NET-SNMP c’est un paquet de chez redhat ^^

Sinon tu peut nous donner le contenu de ton fichier snmpd.conf ?

As-tu des mibs dans le fichier /usr/share/snmp/mibs ? (ou pêut être ailleurs sous debian, mais je ne pense pas )

Mon /usr/share/snmp/mibs est plein :

~# ls /usr/share/snmp/mibs
AGENTX-MIB.txt                       OSPF-MIB.txt
BGP4-MIB.txt                         OSPF-TRAP-MIB.txt
BRIDGE-MIB.txt                       RFC1155-SMI.txt
DISMAN-EVENT-MIB.txt                 RFC1213-MIB.txt
DISMAN-SCHEDULE-MIB.txt              RFC-1215.txt
DISMAN-SCRIPT-MIB.txt                RIPv2-MIB.txt
EtherLike-MIB.txt                    RMON-MIB.txt
GNOME-SMI.txt                        SMUX-MIB.txt
HCNUM-TC.txt                         SNMP-COMMUNITY-MIB.txt
HOST-RESOURCES-MIB.txt               SNMP-FRAMEWORK-MIB.txt
HOST-RESOURCES-TYPES.txt             SNMP-MPD-MIB.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt  SNMP-NOTIFICATION-MIB.txt
IANAifType-MIB.txt                   SNMP-PROXY-MIB.txt
IANA-LANGUAGE-MIB.txt                SNMP-TARGET-MIB.txt
IANA-RTPROTO-MIB.txt                 SNMP-USER-BASED-SM-MIB.txt
IF-INVERTED-STACK-MIB.txt            SNMP-USM-AES-MIB.txt
IF-MIB.txt                           SNMP-USM-DH-OBJECTS-MIB.txt
INET-ADDRESS-MIB.txt                 SNMPv2-CONF.txt
IP-FORWARD-MIB.txt                   SNMPv2-MIB.txt
IP-MIB.txt                           SNMPv2-SMI.txt
IPV6-ICMP-MIB.txt                    SNMPv2-TC.txt
IPV6-MIB.txt                         SNMPv2-TM.txt
IPV6-TCP-MIB.txt                     SNMP-VIEW-BASED-ACM-MIB.txt
IPV6-TC.txt                          SOURCE-ROUTING-MIB.txt
IPV6-UDP-MIB.txt                     TCP-MIB.txt
LM-SENSORS-MIB.txt                   TRANSPORT-ADDRESS-MIB.txt
NET-SNMP-AGENT-MIB.txt               UCD-DEMO-MIB.txt
NET-SNMP-EXAMPLES-MIB.txt            UCD-DISKIO-MIB.txt
NET-SNMP-EXTEND-MIB.txt              UCD-DLMOD-MIB.txt
NET-SNMP-MIB.txt                     UCD-IPFWACC-MIB.txt
NET-SNMP-TC.txt                      UCD-SNMP-MIB.txt
NOTIFICATION-LOG-MIB.txt             UDP-MIB.txt

Mon snmpd.conf :

http://yukserv.dnsalias.com/upload/fichiers/snmpd.conf

[quote=“Yukiz”]Mon /usr/share/snmp/mibs est plein :
Mon snmpd.conf :

http://yukserv.dnsalias.com/upload/fichiers/snmpd.conf [/quote]

Hum étrange comme fichier de conf, je te poste un fichier de conf demain quand je suis au boulot. Car j’ai jamais configuré net-snmp avec une debian mais bon un fichier de conf c’est un fichier de conf :wink:

Rectification:

net-snmp n’est pas exclusivement un paquet redhat.

packages.debian.org/source/net-snmp

Ok. Merci.
Et est ce que je dois DL le package ?

[quote=“Yukiz”]Ok. Merci.
Et est ce que je dois DL le package ?[/quote]

En tout cas installer les paquet Debian associés ( libsnmp-base, libsnmp-perl, libsnmp9, libsnmp9-dev, snmp, snmpd, tkmib )

Sinon voici la commande que j’utilise sous redhat pour configurer interactivement snmpd:

Et voici mon fichier de conf:

###########################################################################
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rocommunity  public 10.0.0.0/255.0.0.0

###########################################################################
# SECTION: System Information Setup
#
#   This section defines some of the information reported in
#   the "system" mib group in the mibII tree.

# syslocation: The [typically physical] location of the system.
#   Note that setting this value here means that when trying to
#   perform an snmp SET operation to the sysLocation.0 variable will make
#   the agent return the "notWritable" error code.  IE, including
#   this token in the snmpd.conf file will disable write access to
#   the variable.
#   arguments:  location_string

syslocation  HQ

# syscontact: The contact information for the administrator
#   Note that setting this value here means that when trying to
#   perform an snmp SET operation to the sysContact.0 variable will make
#   the agent return the "notWritable" error code.  IE, including
#   this token in the snmpd.conf file will disable write access to
#   the variable.
#   arguments:  contact_string

syscontact  ludovic.xxx@xxxx.be



###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
#   The following check up on various aspects of a host.

# disk: Check for disk space usage of a partition.
#   The agent can check the amount of available disk space, and make
#   sure it is above a set limit.
#
#    disk PATH [MIN=100000]
#
#    PATH:  mount path to the disk in question.
#    MIN:   Disks with space below this value will have the Mib's errorFlag set.
#           Can be a raw byte value or a percentage followed by the %
#           symbol.  Default value = 100000.
#
#   The results are reported in the dskTable section of the UCD-SNMP-MIB tree

disk  / 10%
disk  /var 10%


# Allow Systems Management Data Engine SNMP to connect to snm
smuxpeer .1.3.6.1.4.1.674.10892.1
smuxpeer .1.3.6.1.4.1.334.72 NotesPasswd

J’ai mis en gras l’ajout de mibs ici pour les carte Dell PERC et LotusNotes

Pour vérifier que ça passe utilise la commande:

snmpwalk -v 2c -c public <l’ip_du_serveur> .1.3.6.1.4.1

Pour plus d’info sur les options y’a superMAN