原创分享:mrtg通过修改cfgmaker 文件可以读取到华为设备的端口描述
[size=2]原创分享: 缺省情况下,mrtg不能读取华为设备的端口描述 description 通过修改cfgmaker 文件可以读取到华为设备的端口描述[/size][size=2][/size]
[size=2]我当前用的mrtg版本是MRTG 2.16.3 [/size]
[size=2][/size]
[size=2]vi /usr/local/mrtg-2/bin/cfgmaker 文件[/size]
[size=2][/size]
[size=2][color=#ff0000]注:红色部分为新增的语句,其中OID 1.3.6.1.4.1.2011为国际标准中华为的厂商代码[/color][/size]
[size=2][color=#ff0000][/color][/size]
[size=2][/size]
[size=2] # vendor identification
my %vendorIDs = (
# Add your vendor here
# sysObjectID Vendora
'1.3.6.1.4.1.43.' => '3com',
'1.3.6.1.4.1.11.' => 'hp',
'1.3.6.1.4.1.9.' => 'cisco',
'1.3.6.1.4.1.674.10895.' => 'dellLan',
'1.3.6.1.4.1.1916.' => 'extremenetworks',
'1.3.6.1.4.1.1991.' => 'foundry',
'1.3.6.1.4.1.6027.' => 'force10',
'1.3.6.1.4.1.2636.' => 'juniper',
'1.3.6.1.4.1.94.' => 'nokiaipsofw',
'1.3.6.1.4.1.307.' => 'portmaster',
'1.3.6.1.4.1.2272.30' => 'nortel'[color=#ff0000],
'1.3.6.1.4.1.2011' => 'huawei'
[/color] );[/size]
[size=2][/size]
[size=2]
if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' &&
$routers->{$router}{deviceinfo}{sysDescr} =~ m/Version\s+(\d+\.\d+)/) {
push @Variables, ($1 > 11.0 or $1 < 10.0 ) ? "ifAlias" : "CiscolocIfDescr";
if ($1 > 11.2) {push @Variables, "vmVlan";};
if ($1 > 11.3) {push @Variables, "vlanTrunkPortDynamicStatus";};
} elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:hp|juniper|foundry|dellLan|3com|extremenetworks[color=#ff0000]|huawei[/color])/) {
push @Variables, "ifAlias";
}
[/size] 谢谢分享!y016 谢谢,学习了!不过现在很多都用cacti了,不知道cacti有没有这么问题呢?呵呵!
页:
[1]