snmp-mrtg
hi, all my friends out there.
I am trying to set up mrtg.
i am using Red HAT 9. this pc is in my local lan with local ip 192.168.1.65.
it is behind a proxy.
i am using one linux box to act as proxy router . using iptables and natting.
i installed net-snmp
net-snmp-5.0.6-17
and net-snmp-utils
also
mrtg-2.9.17-13
and it works fine with my local system
when i type
#snmpwalk -v 1 -c SECRETKEY localhost system
SNMPv2-MIB::sysDescr.0 = STRING: Linux ahmed4linux 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (10028) 0:01:40.28
SNMPv2-MIB::sysContact.0 = STRING: root@localhost
SNMPv2-MIB::sysName.0 = STRING: ahmed4linux
SNMPv2-MIB::sysLocation.0 = STRING: Unknown
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.7 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (2) 0:00:00.02
______________________________________________________________
but when i try to communicate with my router or any ip outside.
# snmpwalk -v 1 -c SECRETKEY x.x.x.x
Timeout: No Response from x.x.x.x
installed mrtg its fine but when i try it on local host
#cfgmaker --output=/etc/mrtg/mrtg.cfg \
--global "workdir: /var/www/mrtg" -ifref=ip \
--global 'options[_]: growright,bits' \
SECRETKEY@localhost
_____________________________________________________
the out put is.
--base: Get Device Info on SECRETKEY@localhost:
--base: Vendor Id:
--base: Populating confcache
--snpo: confcache SECRETKEY@localhost: Descr -->
--snpo: confcache SECRETKEY@localhost: Ip 1.0 --> 2
--snpo: confcache SECRETKEY@localhost: Ip 2.0 --> 64
----
----
----
----
----
--snpo: confcache SECRETKEY@localhost: Ip 23.0 --> 0
--snpo: confcache SECRETKEY@localhost: Name -->
--snpo: confcache SECRETKEY@localhost: Type -->
--snpo: confcache SECRETKEY@localhost: Eth --> 1
--snpo: confcache SECRETKEY@localhost: Eth 00-50-da-84-4a-bf --> 2
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifSpeed
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Writing /etc/mrtg/mrtg.cfg
________________________________________________________
which i think is ok
but when i try to do same to my router
#cfgmaker --output=/etc/mrtg/x.x.x.x.cfg --global "workdir: /var/www/mrtg" -ifref=ip --global 'options[_]: growright,bits' SECRETKEY@x.x.x.x
--base: Get Device Info on SECRETKEY@62.149.67.126:
SNMP Error:
no response received
SNMPv1_Session (remote host: "62.149.67.126" [62.149.67.126].161)
community: "SECRETKEY"
request ID: 1226626036
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 450
SNMPGET Problem for sysDescr sysContact sysName sysLocation sysObjectID on SECRETKEY@62.149.67.126:
at /usr/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: confcache SECRETKEY@62.149.67.126: Descr -->
--snpo: Skipping ipAdEntIfIndex scanning because SECRETKEY@62.149.67.126: does not seem to support it
--snpo: confcache SECRETKEY@62.149.67.126: Name -->
--snpo: confcache SECRETKEY@62.149.67.126: Type -->
--snpo: Skipping ifPhysAddress scanning because SECRETKEY@62.149.67.126: does not seem to support it
--base: Get Interface Info
--base: Walking ifIndex
SNMP Error:
no response received
__________
----------
------------------
------------
SNMP Error:
no response received
SNMPv1_Session (remote host: "62.149.67.126" [62.149.67.126].161)
community: "SECRETKEY"
request ID: 1226626043
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on SECRETKEY@62.149.67.126:
at /usr/bin/cfgmaker line 107
--base: Writing /etc/mrtg/62.149.67.126.cfg
_______________________________________________________
note :::
i put only this two lines
# vi /etc/snmp/snmpd.conf
rocommunity SECRETKEY
rwcommunity SECRETKEY
:wq!
__________________________
i copied EXAMPLE.conf /usr/local/share/snmp/snmpd.conf
and added these
com2sec local localhost SECRETKEY
com2sec mynetwork NETWORK/24 SECRETKEY
______________________________________
when i run this
#env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
WARNING: Could not match host:'SECRETKEY@localhost:' ref:'Ip' key:'21.1.2.192.168.1.0'
________________________________________
#env LANG=C /usr/bin/mrtg /etc/mrtg/62.149.67.126.cfg
no errors are there.
_______________________________________________________
#indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
(or)
#indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/x.x.x.x.cfg
this is the same error as given below.
Possible precedence problem on bitwise | operator at /usr/bin/../lib/mrtg2/BER.pm line 601.
Can't locate package $VERSION for @MRTG_lib::ISA at /usr/bin/indexmaker line 49
main::BEGIN() called at /usr/bin/../lib/mrtg2/MRTG_lib.pm line 49
eval {...} called at /usr/bin/../lib/mrtg2/MRTG_lib.pm line 49
_________________________________________________________
this is all what i have done.
|