I am having minor issue with mrtg script to monitor network traffic over Ethernet device on my server computer. I am using net-snmp and mrtg.
The mrtg file is working a little, I do get uptime information, computer name. What information I do not get is the information on the Ethernet traffic flowing trough the computer.
The information strings from net-snmp.
The mrtg script that I am using.
When the mrtg script is run with cron. I get this error message.
I have been trying to find mrtg script samples for this online. I have not had any luck so far.
Thanks for the help.
The mrtg file is working a little, I do get uptime information, computer name. What information I do not get is the information on the Ethernet traffic flowing trough the computer.
The information strings from net-snmp.
Code:
snmpwalk -v1 -c netsnmp 192.168.1.1 | grep net
SNMPv2-MIB::sysDescr.0 = STRING: FreeBSD saturn.net303.net 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.8
SNMPv2-MIB::sysName.0 = STRING: saturn.net303.net
IF-MIB::ifType.6 = INTEGER: ethernetCsmacd(6)
HOST-RESOURCES-MIB::hrDeviceDescr.262145 = STRING: network interface usbus0
HOST-RESOURCES-MIB::hrDeviceDescr.262146 = STRING: network interface usbus1
HOST-RESOURCES-MIB::hrDeviceDescr.262147 = STRING: network interface usbus2
HOST-RESOURCES-MIB::hrDeviceDescr.262148 = STRING: network interface usbus3
HOST-RESOURCES-MIB::hrDeviceDescr.262149 = STRING: network interface usbus4
HOST-RESOURCES-MIB::hrDeviceDescr.262150 = STRING: network interface vr0
HOST-RESOURCES-MIB::hrDeviceDescr.262151 = STRING: network interface plip0
HOST-RESOURCES-MIB::hrDeviceDescr.262152 = STRING: network interface lo0
HOST-RESOURCES-MIB::hrDeviceDescr.262153 = STRING: network interface tun0
HOST-RESOURCES-MIB::hrSWRunParameters.1203 = STRING: "-p /var/run/net_snmpd.pid -c /usr/local/share/snmp/snmpd.conf,/etc/snmpd.conf -a"
HOST-RESOURCES-MIB::hrSWRunParameters.75328 = STRING: "-v1 -c netsnmp 192.168.1.1"
HOST-RESOURCES-MIB::hrSWRunParameters.75329 = STRING: "net"
HOST-RESOURCES-MIB::hrSWInstalledName.41 = STRING: "nettle-2.7"
HOST-RESOURCES-MIB::hrSWInstalledName.93 = STRING: "net-snmp-5.7.2_2"
The mrtg script that I am using.
Code:
WorkDir: /usr/local/www/apache24/data/mrtg
Options[_]: bits,growright
Target[localhost_server]: 2:netsnmp@192.168.1.1:
SetEnv[localhost_server]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="server"
MaxBytes[localhost_server]: 12500000
Title[localhost_server]: Title
PageTop[localhost_server]: <H1>Server Network Traffic</H1>
<TABLE>
<TR><TD>System:</TD> <TD>System</TD></TR>
<TR><TD>Maintainer:</TD> <TD>Maintainer</TD></TR>
<TR><TD>Description:</TD><TD>Lan </TD></TR>
<TR><TD>ifType:</TD> <TD>eth0</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>
When the mrtg script is run with cron. I get this error message.
Code:
SNMP Error:
Received SNMP response with error code
error status: noSuchName
index 2 (OID: 1.3.6.1.2.1.2.2.1.16.262150)
SNMPv1_Session (remote host: "192.168.1.1" [192.168.1.1].161)
community: "netsnmp"
request ID: 1419061404
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/lib/perl5/site_perl/5.12.4/SNMP_util.pm line 492
SNMPGET Problem for ifInOctets.262150 ifOutOctets.262150 sysUptime sysName on netsnmp@192.168.1.1::::::v4only
at /usr/local/bin/mrtg line 2330
2013-06-03 01:49:04: ERROR: Target[localhost_server][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2013-06-03 01:49:04: ERROR: Target[localhost_server][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
I have been trying to find mrtg script samples for this online. I have not had any luck so far.
Thanks for the help.