I am having trouble getting this template to work properly. I am new to MRTG and SNMP and have NULL Perl skills. I am running debian linux with net-SNMP snmpd version 5.4.3 and mrtg version 2.17.3-2.
I am not running IPv6. If anyone is able to give a hint or point me in a direction I will be very grateful.
After copying the file to host.template.cfg I have run:
cfgmaker --global 'Workdir: /var/www/mrtg/localhost' --output /home/mrtg/cfg/mrtgHost.cfg --host-template=host.htp public@localhost
which gives output:
#------------------------------ Begin Output ---------------------------------------------
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1381.
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1382.
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1383.
Use of uninitialized value $fs in pattern match (m//) at /usr/bin/cfgmaker line 1388.
Use of uninitialized value $t in hash element at /usr/bin/cfgmaker line 1389.
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1381.
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1382.
Use of uninitialized value $t in substitution (s///) at /usr/bin/cfgmaker line 1383.
Use of uninitialized value $fs in pattern match (m//) at /usr/bin/cfgmaker line 1388.
Use of uninitialized value $t in hash element at /usr/bin/cfgmaker line 1389.
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
--base: Get Device Info on public@localhost:
--base: Vendor Id: Unknown Vendor - 1.3.6.1.4.1.8072.3.2.10
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex
--snpd: public@localhost: -> 1 -> ifIndex = 1
--snpd: public@localhost: -> 2 -> ifIndex = 2
--snpd: public@localhost: -> 3 -> ifIndex = 3
--base: Walking ifType
--snpd: public@localhost: -> 1 -> ifType = 24
--snpd: public@localhost: -> 2 -> ifType = 6
--snpd: public@localhost: -> 3 -> ifType = 6
--base: Walking ifAdminStatus
--snpd: public@localhost: -> 1 -> ifAdminStatus = 1
--snpd: public@localhost: -> 2 -> ifAdminStatus = 1
--snpd: public@localhost: -> 3 -> ifAdminStatus = 1
--base: Walking ifOperStatus
--snpd: public@localhost: -> 1 -> ifOperStatus = 1
--snpd: public@localhost: -> 2 -> ifOperStatus = 2
--snpd: public@localhost: -> 3 -> ifOperStatus = 1
--base: Walking ifMtu
--snpd: public@localhost: -> 1 -> ifMtu = 16436
--snpd: public@localhost: -> 2 -> ifMtu = 1500
--snpd: public@localhost: -> 3 -> ifMtu = 1500
--base: Walking ifSpeed
--snpd: public@localhost: -> 1 -> ifSpeed = 10000000
--snpd: public@localhost: -> 2 -> ifSpeed = 0
--snpd: public@localhost: -> 3 -> ifSpeed = 0
--base: Writing /home/mrtg/cfg/mrtgHost.cfg
#--------------------------------- end output ----------------------------------
I then run:
sudo env LANG=C mrtg /home/mrtg/cfg/mrtgHost.cfg
#----------------------- Begin Output -----------------------------------
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
#------------------------ End Output -----------------------------------------
I again run:
sudo env LANG=C mrtg /home/mrtg/cfg/mrtgHost.cfg
------------------------ Begin Output -----------------------------------------
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.
at /usr/share/perl5/SNMP_Session.pm line 608
------------------------ End Output -----------------------------------------
I am not running IPv6.
And then I set up the cron for root user to run MRTG every 5 minutes.
Then when I check the html files: localhost-snmp-cpu.html, localhost-snmp-lavg.html, localhost-snmp-memory.html, localhost-snmp-procs.html they always read 0.
localhost-snmp-users.html seems to work fine.
I assume this is because MRTG is not getting a response from snmpd. However running:
snmpget -v 2c -c public localhost .1.3.6.1.4.1.2021.10.1.3.2
returns: UCD-SNMP-MIB::laLoad.2 = STRING: 0.12
which I think is the CPU load averaged over 5 minutes.
Running: snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.10.1.3.2 (NOTE: SNMP v1)
also returns an integer.
UCD-SNMP-MIB::laLoad.2 = STRING: 0.08
Again if anyone has any idea as to where my problems may lay I would be very grateful for the information.
Regards,
Adam.
Actually since going through the setup process again to get this post correct all functions are now working except for the load average.Statistics: Posted by atozer — Thu Apr 26, 2012 10:02 pm
]]>