# SNMP and MRTG Issues [SOLVED]

## hurgh

Hi All

I have searched the forums but have not come up with an answer to my problem.

I have installed SNMP and MRTG following these instructions. I only want the traffic stats so i only followed that part of it but it all seemed to work fine.

The problem I am having is that when I run the cfgmaker, it does the snmp query and writes a config file no problems, but in the config file, the only interface I have in the pc is commented out with the following reason:

```
### Interface 2 >> Descr: 'eth0' | Name: '' | Ip: '203.89.230.138' | Eth: '00-80-ad-04-bd-7b' ###

### The following interface is commented out because:

### * it is operationally DOWN
```

I then decided to do a

```
snmpwalk -v 1 -c public localhost if
```

and this is what i get returned:

```

# snmpwalk -v 1 -c public localhost if

IF-MIB::ifIndex.1 = INTEGER: 1

IF-MIB::ifIndex.2 = INTEGER: 2

IF-MIB::ifDescr.1 = STRING: lo

IF-MIB::ifDescr.2 = STRING: eth0

IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)

IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)

IF-MIB::ifMtu.1 = INTEGER: 16436

IF-MIB::ifMtu.2 = INTEGER: 1500

IF-MIB::ifSpeed.1 = Gauge32: 10000000

IF-MIB::ifSpeed.2 = Gauge32: 100000000

IF-MIB::ifPhysAddress.1 = STRING:

IF-MIB::ifPhysAddress.2 = STRING: 0:80:ad:4:bd:7b

IF-MIB::ifAdminStatus.1 = INTEGER: up(1)

IF-MIB::ifAdminStatus.2 = INTEGER: up(1)

IF-MIB::ifOperStatus.1 = INTEGER: up(1)

IF-MIB::ifOperStatus.2 = INTEGER: down(2)

IF-MIB::ifInOctets.1 = Counter32: 2277732

IF-MIB::ifInOctets.2 = Counter32: 1296330268

IF-MIB::ifInUcastPkts.1 = Counter32: 29000

IF-MIB::ifInUcastPkts.2 = Counter32: 4934632

IF-MIB::ifInDiscards.1 = Counter32: 0

IF-MIB::ifInDiscards.2 = Counter32: 0

IF-MIB::ifInErrors.1 = Counter32: 0

IF-MIB::ifInErrors.2 = Counter32: 1532414

IF-MIB::ifOutOctets.1 = Counter32: 2278918

IF-MIB::ifOutOctets.2 = Counter32: 3280727401

IF-MIB::ifOutUcastPkts.1 = Counter32: 29016

IF-MIB::ifOutUcastPkts.2 = Counter32: 6730405

IF-MIB::ifOutDiscards.1 = Counter32: 0

IF-MIB::ifOutDiscards.2 = Counter32: 0

IF-MIB::ifOutErrors.1 = Counter32: 0

IF-MIB::ifOutErrors.2 = Counter32: 4

IF-MIB::ifOutQLen.1 = Gauge32: 0

IF-MIB::ifOutQLen.2 = Gauge32: 0

IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero

IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero

```

As you can see 

```
ifOperStatus.2 = INTEGER: down(2)
```

it says that my interface is down, yet if i run ifconfig 

```
# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:80:AD:04:BD:7B

          inet addr:203.89.230.138  Bcast:203.89.230.143  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:4934718 errors:1532445 dropped:0 overruns:2 frame:1

          TX packets:6730506 errors:4 dropped:0 overruns:4 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1296340435 (1236.2 Mb)  TX bytes:3280745809 (3128.7 Mb)

          Interrupt:5 Base address:0xec00
```

you can see that the interface is actually up and running.

Does anyone know how to fix this problem? or at least force snmp to report the interface as UP so that the MRTG graphs actually work.

Any help with would be great.

-Hurgh-

----------

## Janne Pikkarainen

Maybe it's because your IF-MIB::ifPhysAddress.2 shows MAC address in a little bit invalid form? Notice that the first 0 is not there, your MAC should be 00:80... and not 0:80...

IF-MIB::ifPhysAddress.2 = STRING: 0:80:ad:4:bd:7b

----------

## hurgh

Thanks for the reply, I had noticed that, but didnt think much of it, even if that was the problem, how am i ment to change it to fix up the mac address?

-Hurgh-

----------

## Janne Pikkarainen

Have you tried to re-emerge net-snmp? snmp has been working for me for years without major problems, but sometimes small hassles go away after installing it again... for example, when I upgraded from kernel 2.4.x to 2.6.x, some statistics started to show odd readings and they went away after a reinstall.

I don't know any other way for tweaking that setting. What version of net-snmp you have installed? At least 4.1.2 works for me.

----------

## Janne Pikkarainen

Whoops, I mean 5.2.1.2 works for me. I accidentally looked at dev-perl/Net-SNMP.   :Rolling Eyes: 

----------

## hurgh

Hey, thanks for the reply,

Yes I have tried re-installing it a few times, and still get the same outcome.

Any other suggestions out there??

-Hurgh-

----------

## hurgh

no one else has had this problem??

I just tried re-installing again, clearing the portage cache and everything, hoping that it would work, updated world and still nothing  :Sad: 

Any other suggestions anyone?

-Hurgh-

----------

## njcwotx

 *Quote:*   

> RX packets:4934718 errors:1532445 dropped:0 overruns:2 frame:1 

 

your ifconfig shows 1.5 million errors out of 5 million packets.  What's up with the error count?  If you can resolve that, your  operational status may change to UP.

----------

## hurgh

Thanks for pointing that out, I had never realy noticed that.

I recently re-started the server and it already has thousands of errors, so I am thinking that something might be wrong with the network card. I am going to try replacing that and seeing if that fixed any of the problems (errors and snmp)

Thanks again for your help.

-Hurgh-

----------

## Janne Pikkarainen

Before replacing your network card you might want to check its duplex settings. If it's currently running at half duplex, that would explain the errors.

Try mii-tool eth0 or even better, emerge ethtool and after that use ethtool eth0. If it shows "Duplex: Half", try ethtool -s eth0 speed 100 duplex full autoneg off (replace speed with the speed of your network) and see what happens.

----------

## hurgh

Thanks for the tip Janne, but it says that my link is 100 Full Duplex, which is what it should be (the switch can handle that so...)

I will probably replace the network card tonight and see if that helps it at all, and if not, will look at something else.

Thanks again.

-Hurgh-

----------

## hurgh

Well thanks all for the help, I replaced the network card and it has been up for over 24 hours now and done a few gig of traffic and no errors, and also snmp now shows the interface as being up.

I changed the card to one with a different chipset, so I am not sure if it is the different chipset or the no errors that fixed snmp.

Thanks again for all the help

----------

