В файле конфигурации mrtg
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
RouterUptime[localhost_2]: hrSystemUptime.0:public@localhostИз консоли
[admin@localhost:/etc/snmp]$ snmpget -v 2c -c public localhost hrSystemUptime.0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (2962479528) 342 days, 21:06:35.28
При запуске mrtg возникает ошибка
Unknown SNMP var hrSystemUptime.0
at /usr/bin/mrtg line 657
Строки кода mrtg
625 # Get the uptime and device name from the alternate location (community@host or
626 # (OID:community@host or OID) that may have been specified with the RouterUptime
627 # target keyword
628 if( defined $rcfg->{ routeruptime }{ $rou } ) {
629 my( $noid, $nloc ) = split( /:/, $rcfg->{ routeruptime }{ $rou }, 2 );
630 # If only location (community@host) was specified then
631 # move the location details into the right place
632 if( $noid =~ /@/ ) {
633 $nloc = $noid;
634 $noid = undef;
635 }
636 # If no OID (community@host) was specified use the hardcoded default
637 if( not $noid ) {
638 $noid = 'sysUptime';
639 }
640 # If no location (community@host) was specified use values from the
641 # unique target referred to in the monitored data calculation
642 if( not $nloc ){
643 if ($u >= 0) {
644 my $comm = $target->[ $u ]{ Community };
645 my $host = $target->[ $u ]{ Host };
646 my $opt = $target->[ $u ]{ SnmpOpt };
647 $nloc = "$comm\@$host$opt";
648 } else {
649 die "$NOW: ERROR: You must specify the location part of the RouterUptime oid for non unique targets! ($rou)\n";
650 }
651 }
652
653 $uploc = $nloc;
654 # Get the device uptime if $noid(OID) and $nloc (community@host) have been specified
655 # one way or the other
656 debug('base', "Fetching sysUptime and sysName from: $noid:$nloc");
657 ( $uptime, $name ) = snmpget( $uploc, $rcfg->{ snmpoptions }{ $rou }, $noid, 'sysName');
658 }
Указание OID не помогает.
В режиме отладки mrtg показывает эту ошибку, других подробностей о ней нет.