LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problem with MRTG and SNMP (https://www.linuxquestions.org/questions/linux-networking-3/problem-with-mrtg-and-snmp-733188/)

wooonix 06-15-2009 07:02 PM

Problem with MRTG and SNMP
 
Hello, currently I am a little confused about how to get MRTG working, been at it all day because the boss wants it done, any help would be greatly appreciated. Anywho.. this is where I am at.

the MRTG website says to start out with Cfgmaker and do this..so I put this into a script and ran it
Code:

cfgmaker --global 'WorkDir: /home/httpd/mrtg'  \
          --global 'Options[_]: bits,growright' \
          --output /home/mrtg/cfg/mrtg.cfg    \
          community@router.abc.xyz

my current stats as ifconfig are:

Code:

ifconfig wlan0
wlan0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx 
          inet addr:10.13.31.49  Bcast:10.13.31.255  Mask:255.255.255.0
          inet6 addr: fe80::222:43ff:fe71:4b77/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13035 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7606 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17569654 (16.7 MiB)  TX bytes:665099 (649.5 KiB)

so I modified what the website gave me and did it as:
Code:

#!/bin/sh


cfgmaker --global 'WorkDir: /home/woo/mrtg' \
  --global 'Options[_]: bits,growright' \
  --output /home/woo/project/cfg/mrtg.cfg \
  community@10.13.31.49


the error i get when running this script is:
Code:

SNMP Error:
no response received
SNMPv1_Session (remote host: "10.13.31.49" [10.13.31.49].161)
                  community: "community"
                request ID: 1558582216
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 629
SNMPWALK Problem for 1.3.6.1.2.1.1 on community@10.13.31.49::::::v4only
 at /usr/bin/cfgmaker line 950
WARNING: Skipping community@10.13.31.49: as no info could be retrieved


I did a px ax | grep snmpd ...and it was running....

snmpwalk -v 1 -c public localhost gave me this..

Code:

snmpwalk -v 1 -c public localhost
SNMPv2-MIB::sysDescr.0 = STRING: Linux mobilez 2.6.27.19-170.2.35.fc10.i686 #1 SMP Mon Feb 23 13:21:22 EST 2009 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (226535) 0:37:45.35
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: mobilez
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.3 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (41) 0:00:00.41
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (41) 0:00:00.41
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (41) 0:00:00.41
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (42) 0:00:00.42
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (258797) 0:43:07.97
End of MIB


Any help is hugely appreciated!!

GlennsPref 06-15-2009 08:08 PM

Hi, Try not to display your hardware addresses in public, they may be tracked by malicious hackers.
Code:

Link encap:Ethernet  HWaddr 00:xx:xx:xx:xx:xx
(Yes, they can be forged (masqueraded), but if you knew how to do that, you would not publish it.) ;-)

your ip addressing as xx.xx.xx.xx is confusing the issue.

MRTG is looking for a FQDN (fully qualified domain name)at that line.

For instance your Hostname.

try....

uname -n

to see what that gives for the machine.
Quote:

glenn@GamesBox:~$ uname -n (16-06 11:04)
GamesBox.GlennsPref.net
glenn@GamesBox:~$ (16-06 11:04)
(This is actually a private (local) domain, it does not exist outside this machine. It is just for looks, instead of localhost) ;-)

It's named in /etc/hosts
Quote:

# generated by drakhosts
127.0.0.1 GamesBox.GlennsPref.net GamesBox localhost localhost,
192.168.0.2 GamesBox.GlennsPref.net GamesBox

Hope this helps.

Regards Glenn

GlennsPref 06-15-2009 08:16 PM

Code:

#!/bin/sh


cfgmaker --global 'WorkDir: /home/woo/mrtg' \
  --global 'Options[_]: bits,growright' \
  --output /home/woo/project/cfg/mrtg.cfg \
  community@10.13.31.49

change 10.13.31.49 to a fqdn.

localhost might work.

cheers, Glenn

I have found this page useful,

http://www.linuxhomenetworking.com/

wooonix 06-15-2009 09:59 PM

Thanks a bunch Glen, it helped a lot!


All times are GMT -5. The time now is 04:17 AM.