# mrtg and no info on traffic [solved]

## jonfr

I am trying to setup an network plot so I can monitor network traffic on my server. It has an eth0 netcard and I want to montior the traffic that goes trugh it.

Here are my config files.

snmpd.conf

```
com2sec local     127.0.0.1/32    public

com2sec local     192.168.1.0/24   public

group MyROGroup v1         local

group MyROGroup v2c        local

group MyROGroup usm        local

view all    included  .1                               80

access MyROGroup ""      any       noauth    exact  all    none   none

syslocation MyLocation

syscontact Me <me@somewhere.org
```

traffic.cfg

```
WorkDir: /var/www/localhost/htdocs/mrtg

Options[_]: bits,growright

Target[localhost_eth0]: 2:public@localhost:

SetEnv[localhost_eth0]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0"

MaxBytes[localhost_eth0]: 1250000

Title[localhost_eth0]: Title

PageTop[localhost_eth0]: <H1>PageTop</H1>

 <TABLE>

   <TR><TD>System:</TD>     <TD>System</TD></TR>

   <TR><TD>Maintainer:</TD> <TD>Maintainer</TD></TR>

   <TR><TD>Description:</TD><TD>eth0  </TD></TR>

   <TR><TD>ifType:</TD>     <TD>ethernetCsmacd (6)</TD></TR>

   <TR><TD>ifName:</TD>     <TD></TD></TR>

   <TR><TD>Max Speed:</TD>  <TD>100 Mbits/s</TD></TR>

   <TR><TD>Ip:</TD>         <TD>Ip()</TD></TR>

 </TABLE>

```

I have looked trugh the older posts on this issue, but I haven't found an solution yet. I did go after an old howto that I pointed to when I did emerge mrtg.

Here is the error message that I get when I run cron job.

```
Output from command /usr/bin/mrtg /etc/mrtg/traffic.cfg  ..

SNMP Error:

no response received

SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)

                  community: "public"

                 request ID: 330940114

                PDU bufsize: 8000 bytes

                    timeout: 2s

                    retries: 5

                    backoff: 1)

 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 490

SNMPGET Problem for ifInOctets.2 ifOutOctets.2 sysUptime sysName on public@localhost::::::v4only

 at /usr/bin/mrtg line 2150

2008-02-09 17:54:22: WARNING: skipping because at least the query for ifInOctets.2 on  localhost did not succeed

2008-02-09 17:54:22: WARNING: no data for ifInOctets&ifOutOctets:public@localhost. Skipping further queries for Host localhost in this round.

2008-02-09 17:54:32: ERROR: Target[localhost_eth0][_IN_] ' $target->[0]{$mode} ' did not eval into defined data

2008-02-09 17:54:32: ERROR: Target[localhost_eth0][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data

```

Last edited by jonfr on Tue Feb 12, 2008 3:17 am; edited 3 times in total

----------

## buzzin

Sorry, not a solution, just a possible suggestion. Maybe give Cacti ago.

----------

## jonfr

I am going to give Cacti a tryout.

----------

## jonfr

Cacti is not what I am looking for.

Here is one the error I get. The error is that mrtg cannot communicate with snmpt.

```
SNMP Error:

no response received

SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)

                  community: "public"

                 request ID: 1349317737

                PDU bufsize: 8000 bytes

                    timeout: 2s

                    retries: 5

                    backoff: 1)

 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 490

SNMPGET Problem for ssCpuRawUser.0 ssCpuRawUser.0 sysUptime sysName on public@localhost::::::v4only

 at /usr/bin/mrtg line 2150

2008-02-10 01:49:19: WARNING: skipping because at least the query for ssCpuRawUser.0 on  localhost did not succeed

2008-02-10 01:49:19: WARNING: no data for ssCpuRawUser&ssCpuRawUser:public@localhost. Skipping further queries for Host localhost in this round.

2008-02-10 01:49:29: ERROR: Target[localhost.cpu][_IN_] ' $target->[0]{$mode}  + ssCpuRawSystem.0&ssCpuRawSystem.' (warn): Ambiguous use of & resolved as operator & at (eval 16) line 1.

2008-02-10 01:49:29: ERROR: Target[localhost.cpu][_OUT_] ' $target->[0]{$mode}  + ssCpuRawSystem.0&ssCpuRawSystem.' (warn): Ambiguous use of & resolved as operator & at (eval 17) line 1.

SNMP Error:

no response received

SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)

                  community: "public"

                 request ID: 1231878405

                PDU bufsize: 8000 bytes

                    timeout: 2s

                    retries: 5

                    backoff: 1)

 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 490

SNMPGET Problem for sysUptime sysName on public@localhost

 at /usr/bin/mrtg line 624

2008-02-10 01:49:39, Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost.cpu

2008-02-10 01:49:39, Rateup WARNING: /usr/bin/rateup The backup log file for localhost.cpu was invalid as well

2008-02-10 01:49:39, Rateup WARNING: /usr/bin/rateup Can't remove localhost.cpu.old updating log file

2008-02-10 01:49:39, Rateup WARNING: /usr/bin/rateup Can't rename localhost.cpu.log to localhost.cpu.old updating log file
```

Here is the error when I try to get network traffic info.

```
SNMP Error:

no response received

SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)

                  community: "public"

                 request ID: 163391093

                PDU bufsize: 8000 bytes

                    timeout: 2s

                    retries: 5

                    backoff: 1)

 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 490

SNMPGET Problem for ifInOctets.2 ifOutOctets.2 sysUptime sysName on public@localhost::::::v4only

 at /usr/bin/mrtg line 2150

2008-02-10 01:53:44: WARNING: skipping because at least the query for ifInOctets.2 on  localhost did not succeed

2008-02-10 01:53:44: WARNING: no data for ifInOctets&ifOutOctets:public@localhost. Skipping further queries for Host localhost in this round.

2008-02-10 01:53:54: ERROR: Target[localhost_eth0][_IN_] ' $target->[0]{$mode} ' did not eval into defined data

2008-02-10 01:53:54: ERROR: Target[localhost_eth0][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data

2008-02-10 01:53:54, Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_eth0

2008-02-10 01:53:54, Rateup WARNING: /usr/bin/rateup The backup log file for localhost_eth0 was invalid as well

2008-02-10 01:53:54, Rateup WARNING: /usr/bin/rateup Can't remove localhost_eth0.old updating log file

2008-02-10 01:53:54, Rateup WARNING: /usr/bin/rateup Can't rename localhost_eth0.log to localhost_eth0.old updating log file
```

----------

## Princess Nell

I would start with a very basic snmpd.conf to ensure that snmp works. E.g.

 *Quote:*   

> 
> 
> echo "rocommunity public" >/etc/snmpd.conf
> 
> 

 

(or wherever it lives), then verify it works

 *Quote:*   

> 
> 
> snmpwalk -c public -v2c server
> 
> 

 

Then run the mrtg cfgmaker with appropriate options to create mrtg.cfg

If all this works, you can go ahead and tie down the snmp config. If it doesn't, you'll have an

interesting problem to solve  :Wink: 

----------

## jonfr

This is what I get when I did echo the settings into snmpd.conf file.

```
snmpwalk -c public -v2c server

getaddrinfo: server Name or service not known

snmpwalk: Unknown host (server)
```

----------

## andreas_st

Of course you have to replace server by the hostname of the machine you want to query (probably localhost in your case).

----------

## jonfr

When I do that, I get a lot of thease messages.

```
DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_linkDown' = STRING:

DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_linkUp' = STRING:

DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_mteTriggerFailure' = STRING:

DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_mteTriggerFalling' = STRING:

DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_mteTriggerFired' = STRING:

DISMAN-EVENT-MIB::mteEventComment."_snmpd".'_mteTriggerRising' = STRING:

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_linkDown' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_linkUp' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_mteTriggerFailure' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_mteTriggerFalling' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_mteTriggerFired' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_mteTriggerRising' = BITS: 80 notification(0)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_linkDown' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_linkUp' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_mteTriggerFailure' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_mteTriggerFalling' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_mteTriggerFired' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEnabled."_snmpd".'_mteTriggerRising' = INTEGER: true(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_linkDown' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_linkUp' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_mteTriggerFailure' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_mteTriggerFalling' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_mteTriggerFired' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventEntryStatus."_snmpd".'_mteTriggerRising' = INTEGER: active(1)

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_linkDown' = OID: IF-MIB::linkDown

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_linkUp' = OID: IF-MIB::linkUp

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_mteTriggerFailure' = OID: DISMAN-EVENT-MIB::mteTriggerFailure

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_mteTriggerFalling' = OID: DISMAN-EVENT-MIB::mteTriggerFalling

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_mteTriggerFired' = OID: DISMAN-EVENT-MIB::mteTriggerFired

DISMAN-EVENT-MIB::mteEventNotification."_snmpd".'_mteTriggerRising' = OID: DISMAN-EVENT-MIB::mteTriggerRising

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_linkDown' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_linkUp' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_mteTriggerFailure' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_mteTriggerFalling' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_mteTriggerFired' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjectsOwner."_snmpd".'_mteTriggerRising' = STRING: _snmpd

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_linkDown' = STRING: _linkUpDown

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_linkUp' = STRING: _linkUpDown

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerFailure' = STRING: _triggerFail

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerFalling' = STRING: _triggerFire

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerFired' = STRING: _triggerFire

DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerRising' = STRING: _triggerFire

NOTIFICATION-LOG-MIB::nlmConfigGlobalEntryLimit.0 = Gauge32: 1000

NOTIFICATION-LOG-MIB::nlmConfigGlobalAgeOut.0 = Gauge32: 1440 minutes

NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsLogged.0 = Counter32: 0 notifications

NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsBumped.0 = Counter32: 0 notifications
```

So I guess it is working.

----------

## jonfr

I got the network traffic to work. But not the cpu, mem etc to work.

----------

## jonfr

I got network to "work", but everything looks flat for some reason. As can be seen here. I was also trying to create an monitoring points for vpn and two remote computers, but that didn't work at all. I got the vpn to work, but not correctly.

----------

## andreas_st

Is your snmp daemon still running? Did you set it up to be started after every reboot?

----------

## jonfr

It is still running and working. This is most likley an problem with the mrtg config files.

----------

## jonfr

What is the best way for me to monitor the ip forwarding that I have on my server ? So I can tell how much speed the vpn connections I have are on.

----------

## jonfr

By adjusting few scripts I got everything working as I did want to. So this is solved.

----------

## VAJRAVEL

 *jonfr wrote:*   

> By adjusting few scripts I got everything working as I did want to. So this is solved.

 

----------

