diff -Nru mrtg-2.14.7/bin/cfgmaker mrtg-2.16.1/bin/cfgmaker --- mrtg-2.14.7/bin/cfgmaker 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/bin/cfgmaker 2008-05-10 19:05:47.000000000 +0100 @@ -1,7 +1,7 @@ #! /usr/bin/perl # -*- mode: Perl -*- ################################################################## -# MRTG 2.14.7 -- Config file creator +# MRTG 2.16.1 -- Config file creator ################################################################## # Created by Tobias Oetiker # this produces an mrtg config file for one router or more routers @@ -15,7 +15,7 @@ # base - basic program flow # snpo - SNMP Polling # snpd - SNMP Detail -#@main::DEBUG=qw(base snpo coca); +#@main::DEBUG=qw(base); @main::DEBUG=qw(); require 5.005; @@ -54,14 +54,17 @@ sub main { - my %opt; + # assign defaults + my %opt = ( +# 'snmp-options' => ':::::2' + ); my %routers; my %confcache; my $ipv4only; my %v3opt; $opt{fullcmd} = "$0 ".(join " ", - map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? "'$_'" : $_ } @ARGV); + map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? qq{"$_"} : $_ } @ARGV); $opt{community}="public"; $opt{interfaces}=1; options(\%opt,\%routers); @@ -85,7 +88,7 @@ } # Check for SNMP V3 # - if (lc($opt{enablesnmpv3}) eq "yes") { + if (exists($opt{username}) or lc($opt{enablesnmpv3}) eq "yes" ) { if (eval {local $SIG{__DIE__};require Net_SNMP_util;}) { import Net_SNMP_util; debug('base', "SNMP V3 libraries found, SNMP V3 enabled."); @@ -119,6 +122,7 @@ $routers{$router}{'snmp-options'} = join(":",@snmpopt); } else { die "SNMP V3 requires a --username parameter as part of the User Security Model for router $routers{$router}{routerkey}" if $opt{enablesnmpv3} eq "no"; + $routers{$router}{enablesnmpv3} = $opt{enablesnmpv3}; %v3opt = parsev3(\%opt); } } else { @@ -165,6 +169,7 @@ $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|force10|3com|extremenetworks)/) { push @Variables, "ifAlias"; } @@ -175,6 +180,13 @@ push @Variables, "CiscoCatalystPortName"; push @Variables, "vmVlan"; } + if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' && + $descr =~ m/Catalyst/ ) { + push @Variables, "vlanTrunkPortDynamicStatus"; + } + if ($descr =~ m/Passport-8610/ ) { + push @Variables, "ppPortName"; + } foreach my $var (@Variables) { debug('base',"Walking $var"); @@ -413,6 +425,7 @@ or die "File $$router_opt{'host-template'} couldn't be opened.\n"; my @template_lines = readline *IF_TEMPLATE; + close IF_TEMPLATE; $@ = undef; eval ('local $SIG{__DIE__};'.join("", @template_lines)); @@ -472,7 +485,7 @@ my $if_is_loopback = $if_type == 24; my $if_is_ciscovlan = ($$router_dev{Vendor} eq 'cisco' - and $$i{Descr} =~ /^(unrouted )?V(LAN|lan)\d+$/); + and $$i{Descr} =~ /^(unrouted )?[- ]?VLAN[- ]?\d*$/i); my $if_ip = $$i{Ip}; my $if_snmp_descr = $$i{Descr}; @@ -485,6 +498,7 @@ my $if_cisco_descr = $$i{CiscolocIfDescr}; my $if_dns_name = $$i{DNSName}; my $if_vlan_id = $$i{vmVlan}; + my $if_cisco_trunk = ($$i{vlanTrunkPortDynamicStatus} ==1); my $if_MTU = $$i{ifMtu}; # For Nokia IPSO, find non-ethernet interfaces with IP addresses @@ -614,10 +628,15 @@ } my $message; + my $nohc =0; if ($message = IsCounterBroken($ifindex, $router_ref,$v3opt)) { # set snmpopt_current to working snmp options - push @prob, "got '$message' from interface when trying to query"; + if ($message ==1) { + $nohc = 1; + } else { + push @prob, "got '$message' from interface when trying to query"; $if_ok = 0; + } } my $community = $$router_ref{community}; @@ -667,6 +686,7 @@ my $port_dot = $$i{Name}; $port_dot =~ s/\//./g; my $if_port_name = $$router_ref{$port_dot}{CiscoCatalystPortName}; + my $if_pp_port_name = $$router_ref{$ifindex}{ppPortName}; if (defined $$router_opt{ifdesc}) { $desc_prefix = ''; @@ -679,6 +699,7 @@ last}; /^name$/ && do {$if_title_desc = "#".$$i{Name} if $$i{Name}; last}; /^catname$/ && do {$if_title_desc = "$if_port_name"; last}; + /^ppname$/ && do {$if_title_desc = "$if_pp_port_name"; last}; /^type$/ && do {$if_title_desc = "%".$$i{Type} if $$i{Type}; last}; /^nr$/ && do {$if_title_desc = "Interface $ifindex"; last}; /^$/ && do {$if_title_desc = $if_type_desc; @@ -715,6 +736,7 @@ $if_ref =~ s/([& :])/\\$1/g; my $default_target_directive = "Target[$target_name]: $if_ref:$router_connect"; $default_target_directive .= "\nSnmpOptions[$target_name]: $v3options" if $$router_ref{snmpopt_current} =~ /(?=:.*?){4}:3/ ; + $default_target_directive .= "\nnoHC[$target_name]: yes" if $nohc == 1; my $if_snmp_descr_save = $if_snmp_descr; $if_snmp_descr_save =~ s/"/'/g; my $default_setenv_directive = "SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_snmp_descr_save\""; @@ -755,6 +777,11 @@ " if defined $if_port_name; $default_pagetop_directive .= " + Port Name: + $if_pp_port_name + " if defined $if_pp_port_name; + $default_pagetop_directive .= " + Max Speed: $if_speed_str "; @@ -868,9 +895,10 @@ my $router_ref = shift; my $v3opt = shift; my $router = $$router_ref{routerkey}; - my $old_state = $SNMP_Session::suppress_warnings; + my $fallback = 0; $$router_ref{snmpopt_current} = $$router_ref{'snmp-options'}; - $SNMP_Session::suppress_warnings = 3; + local $SNMP_Session::suppress_warnings = 3; + local $Net_SNMP_util::suppress_warnings = 3; my $ipv4only = $$router_ref{ipv4only}; my $snmphost = v4onlyifnecessary($router, $ipv4only); @@ -880,31 +908,35 @@ my $speed = (snmpget($snmphost, $v3opt, 'ifHighSpeed.'.$if))[0]; debug('base',"snmpget $snmphost for ifHighSpeed.$if -> $speed Mb/s"); $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; my $counter = (snmpget($snmphost,$v3opt, 'ifHCInOctets.'.$if))[0]; debug('base',"snmpget $snmphost for ifHCInOctets.$if -> $counter"); - if(not $speed or $counter eq "" or $SNMP_Session::errmsg){ + if(not $speed or $counter eq "" or $counter =~ /\D/ or $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ $SNMP_Session::errmsg = undef; - $$router_ref{snmpopt_current} =~ s/:+[23]$//; + $Net_SNMP_util::ErrorMessage = undef; + $fallback = 1; debug('base',"check for HighspeedCounters failed ... Dropping back to V1"); } else { - $SNMP_Session::suppress_warnings = $old_state; return 0; } } - $router = "$$router_ref{community}\@$$router_ref{routername}$$router_ref{'snmp-options'}"; - $snmphost = v4onlyifnecessary($router, $ipv4only); - if ( $$router_ref{snmpopt_current} !~ /:[23]/) { - snmpget($snmphost, 'ifInOctets.'.$if); + if ( $fallback == 1 or $$router_ref{snmpopt_current} !~ /:\d*:\d*:\d*:\d*:[23]$/) { + my $counter = (snmpget($snmphost, 'ifInOctets.'.$if))[0]; if (defined $SNMP_Session::errmsg) { my $error = $SNMP_Session::errmsg; $SNMP_Session::errmsg = undef; $error =~ s/\n/\n### /g; - $SNMP_Session::suppress_warnings = $old_state; return $error; + } elsif (defined $Net_SNMP_util::ErrorMessage and $Net_SNMP_util::ErrorMessage =~ /\w/) { + my $error = $Net_SNMP_util::ErrorMessage; + $Net_SNMP_util::ErrorMessage = undef; + $error =~ s/\n/\n### /g; + return $error; + } elsif (not defined $counter or $counter eq '' or $counter =~ /\D/) { + return "No counter exists for $if"; } } - $SNMP_Session::suppress_warnings = $old_state; - return 0; + return $fallback; } # end IsCounterBroken # DeviceInfo does fallback between IPv6 and IPv4: if an IPv6 snmpwalk returns @@ -1208,12 +1240,12 @@ 'output=s', 'global=s@', 'enable-ipv6', - 'enable-snmpv3', + 'enablesnmpv3', 'use-16bit', 'zero-speed=s', '<>', $addrouter_ornf) or pod2usage(2); - die("cfgmaker for mrtg-2.14.7\n") if $$opt{version}; + die("cfgmaker for mrtg-2.16.1\n") if $$opt{version}; pod2usage(-exitval => 0, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not keys %$routers; } # end options @@ -1444,6 +1476,24 @@ return $s; } # end html_escape +sub oid_pick ($$$;@){ + my $router = shift; + my $v3opt = shift; + my @oids = @_; + local $SNMP_Session::suppress_warnings = 3; + foreach my $oid (@oids){ + local $SNMP_Session::errmsg = undef; + my $counter = snmpget($router,$v3opt,$oid); + if (not defined $SNMP_Session::errmsg and defined $counter and $counter ne '' ) { + debug('base',"oid_pick - found $oid to work for $router"); + return $oid; + } + } + debug('base',"oid_pick - none of ".(join ",",@oids)." seem to work for $router"); + return undef; +} + + sub parsev3 ($) { my $opt = shift; my %v3opt; @@ -1489,6 +1539,8 @@ snmpmapOID('sysObjectID' => '1.3.6.1.2.1.1.2.0', 'CiscolocIfDescr' => '1.3.6.1.4.1.9.2.2.1.1.28', 'CiscoCatalystPortName' => '1.3.6.1.4.1.9.5.1.4.1.1.4', + 'ppPortName' => '1.3.6.1.4.1.2272.1.4.10.1.1.35', + 'vlanTrunkPortDynamicStatus'=> '1.3.6.1.4.1.9.9.46.1.6.1.1.14', 'vmVlan' => '1.3.6.1.4.1.9.9.68.1.2.2.1.2', 'ifAlias' => '1.3.6.1.2.1.31.1.1.1.18'); } # end init @@ -1499,7 +1551,7 @@ =head1 NAME -cfgmaker - Creates mrtg.cfg files (for mrtg-2.14.7) +cfgmaker - Creates mrtg.cfg files (for mrtg-2.16.1) =head1 SYNOPSIS @@ -1520,6 +1572,7 @@ --ifdesc=descr ... uses Interface Description --ifdesc=name ... uses Interface Name --ifdesc=catname ... uses CatOS Interface Name + --ifdesc=ppname ... uses Passport Port Name --ifdesc=alias ... uses Interface Alias --ifdesc=type ... uses Interface Type @@ -1870,8 +1923,18 @@ =head2 SNMP V3 Options -B supports SNMP V3. There are optional parameters affecting SNMP operation. +B supports SNMP V3 using the B perl module. There are optional +parameters affecting SNMP operation. + +=over + +=item --enablesnmpv3 {yes|no} + +The B<--enablesnmpv3> option is an optional flag to check for the presence of +the B libraries. B will try to determine whether this flag is +required and will set the values automatically. +=back =head3 SNMPv3 Arguments @@ -2139,7 +2202,13 @@ Returns the vlan id associated with a specific port on Cisco Catalyst switches under both Catalyst OS -and IOS. If it is not a vlan interface, will return undef. +and IOS, and 3Com switches. If it is not a vlan interface, will return undef. + +=item B<$if_cisco_trunk> + +Returns the trunking state of a specific port +on Cisco Catalyst switches under both Catalyst OS +and IOS. Returns "1" if the interface is a trunk, undef otherwise. =item B<$if_MTU> @@ -2485,6 +2554,11 @@ If the host is a Cisco Catalyst LAN switch, this variable is the name of that port. (No HTML escaped variant available) +=item B<$if_pp_port_name> + +If the host is a Nortel Passport LAN switch, this variable is the name of +that port. (No HTML escaped variant available) + =item B<$desc_prefix> This variable is a prefix of the description of what the target is to use in @@ -2519,6 +2593,12 @@ in the string are prepended with "
" and appended with a space character (newlines at the end of the string are not touched). +=item B + +This function will try to poll each of the oids specified until +it is successful or has run out of oids. It will return the name of the +first oid that worked or undef if it is not successful + =back =head3 Example Template Files @@ -2577,6 +2657,13 @@ ECHO + $target_lines .= < + Port Name: + $if_pp_port_name + + ECHO + $target_lines .= < Max Speed: diff -Nru mrtg-2.14.7/bin/indexmaker mrtg-2.16.1/bin/indexmaker --- mrtg-2.14.7/bin/indexmaker 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/bin/indexmaker 2008-02-17 10:27:36.000000000 +0000 @@ -1,7 +1,7 @@ #! /usr/bin/perl -w # -*- mode: Perl -*- ################################################################## -# MRTG 2.14.7 --- Index Generator +# MRTG 2.16.1 --- Index Generator ################################################################## # # This reads a mrtg.cfg file form std input or cmdline argument @@ -58,7 +58,7 @@ my $argz = "$0"; foreach my $ar (@argv) { if ($ar =~ /[ |()]/ ) { - $ar = sprintf "\"%s\"", $ar; + $ar = sprintf qq{"%s"}, $ar; } $argz .= " $ar"; } @@ -303,26 +303,27 @@ $$opt{title} - - - - - - + + + + + + + $headeradd ECHO - $index .= < - ECHO + $index .= < @@ -398,10 +399,10 @@ /^descr(iption)?$/ && do{ $section = "No Description for $item"; - $$rcfg{setenv}{$item} =~ /MRTG_INT_DESCR="(.*?)"/ #" + $$rcfg{setenv}{$item} =~ /MRTG_INT_DESCR="(.+?)"/ #" and $section = $1; $$rcfg{pagetop}{$item} =~ - m,Description:\s*\Q$section\E\s*(.*?),i + m,Description:\s*\Q$section\E\s*([^< ][^<]+?),i and $section = $1; last; }; @@ -430,9 +431,9 @@ if (not $image) { if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; + my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; $index .= - "". + "". "$$opt{boldon}". "$section$$opt{boldoff}"; } else { @@ -463,11 +464,11 @@ if ( !($picfirstloop^$$opt{picfirst}) ) { # figure show name for rrd viewer if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; - $index .= "". + my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; + $index .= "". "\"$item" + "SRC=\"$$opt{rrdviewer}".$sep."log=$item&cfg=$$cfgfile{$item}&png=$$opt{show}.". + "s&small=1\">" } else { $index .= " @@ -615,7 +616,7 @@ $$opt{prefix} .= '/'; $$opt{prefix} =~ s|/+$|/|; } - die ("Indexmaker for mrtg-2.14.7\n") if $$opt{version}; + die ("Indexmaker for mrtg-2.16.1\n") if $$opt{version}; pod2usage(-exitval => 1, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not @ARGV; @@ -645,7 +646,7 @@ =head1 NAME -indexmaker - Creates index files for mrtg web sites (mrtg-2.14.7) +indexmaker - Creates index files for mrtg web sites (mrtg-2.16.1) =head1 SYNOPSIS diff -Nru mrtg-2.14.7/bin/mrtg mrtg-2.16.1/bin/mrtg --- mrtg-2.14.7/bin/mrtg 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/bin/mrtg 2008-05-10 19:05:47.000000000 +0100 @@ -2,7 +2,7 @@ # -*- mode: cperl -*- ################################################################### -# MRTG 2.14.7 Multi Router Traffic Grapher +# MRTG 2.16.1 Multi Router Traffic Grapher ################################################################### # Created by Tobias Oetiker # and Dave Rand @@ -30,6 +30,8 @@ # time - some timing info # log - logging of data via rateup or rrdtool # eval - trace eval experssions +# prof - add timeing info some interesting bits of code + $main::GRAPHFMT="png"; # There older perls tend to behave peculiar with # large integers ... @@ -154,7 +156,6 @@ sub main { - debug 'time', "prog start ".localtime(time); # read in the config file my @routers; @@ -163,7 +164,7 @@ my %opts; my $EXITCODE = 0; - GetOptions(\%opts, 'user=s', 'group=s', 'lock-file=s','confcache-file=s','logging=s', 'check', 'fhs', 'daemon', 'pid-file=s','debug=s', 'log-only'); + GetOptions(\%opts, 'user=s', 'group=s', 'lock-file=s','confcache-file=s','logging=s', 'check', 'fhs', 'daemon', 'pid-file=s','debug=s', 'log-only') or die "Please use valid Options\n"; if (defined $opts{debug}){ @main::DEBUG = split /\s*,\s*/, $opts{debug}; @@ -171,6 +172,15 @@ $SNMP_util::Debug = 1 if grep /^snpo2$/, @main::DEBUG; } } + if (grep /^prof$/, @main::DEBUG){ + require Time::HiRes; + eval "sub gettimeofday() {return Time::HiRes::time()}"; + # note this will crash if the module is missing + # so only use the --debug=prof if you have Time::HiRes installed + } else { + eval "sub gettimeofday() {return time()}"; + } + debug 'time', "prog start ".localtime(time); my $uid = $<; my $gid = $(; @@ -252,7 +262,7 @@ debug('base', "Reading Config File: $cfgfile"); readcfg($cfgfile,\@routers,\%cfg,\%rcfg); - + imggen($cfg{icondir} || $cfg{imagedir} || $cfg{workdir}); # Enable or disable snmpv3 if(defined $cfg{enablesnmpv3}) { @@ -261,6 +271,14 @@ $cfg{enablesnmpv3} = 'no'; } + if ($cfg{threshmailserver}) { + if (eval {local $SIG{__DIE__};require Net::SMTP;}) { + import Net::SMTP; + debug('base', "Loaded Net::SMTP module for ThreshMail."); + } else { + die "$NOW: WARNING: Can't load Net::SMTP module. This is required for ThreshMail."; + } + } # Check we have the necessary libraries for IPv6 support if ($cfg{enablesnmpv3} eq 'yes') { if (eval {local $SIG{__DIE__};require Net_SNMP_util;}) { @@ -362,7 +380,7 @@ debug 'time', "loop start ".localtime(time); #if we run as daemon, we sleep in between collection cycles - $sleep_time= ($cfg{interval}*60)-(time-$last_time); + $sleep_time= (int($cfg{interval}*60))-(time-$last_time); if ($sleep_time > 0 ) { #If greater than 0 the sleep that amount of time debug('time', "Sleep time $sleep_time seconds"); sleep ($sleep_time); @@ -374,7 +392,7 @@ # set meta expires if there is an index file # 2000/05/03 Bill McGonigle if (defined $cfg{'writeexpires'}) { - my $exp = &expistr($cfg{'interval'} ? $cfg{'interval'} : 5); + my $exp = &expistr($cfg{'interval'}); my $fil; $fil = "$cfg{'htmldir'}index.html" if -e "$cfg{'htmldir'}index.html"; $fil = "$cfg{'htmldir'}index.htm" if -e "$cfg{'htmldir'}index.htm"; @@ -596,7 +614,7 @@ # Get the uptime, device name, and data collection time from the @$target # array if the monitored data calculation refers only to one target. # Otherwise it doesn't make sense to do this. - if( $rcfg->{ uniqueTarget }{ $rou } >= 0 ) { + if( $u >= 0 ) { $uptime = $target->[ $u ]{ _UPTIME_ }; $name = $target->[ $u ]{ _NAME_ }; $time = $target->[ $u ]{ _TIME_ }; @@ -604,17 +622,45 @@ # Set the time to the current time if it was not set above $time = time unless $time; - - # Get the uptime and device name from the alternate location - # (community@host) that may have been specified with the RouterUptime + + # Cache uptime location for reading name + my( $uploc ); + + # Get the uptime and device name from the alternate location (community@host or + # (OID:community@host or OID) that may have been specified with the RouterUptime # target keyword if( defined $rcfg->{ routeruptime }{ $rou } ) { - ( $uptime, $name ) = snmpget( - v4onlyifnecessary( $rcfg->{ routeruptime }{ $rou }, - $rcfg->{ ipv4only }{ $rou } ), - $rcfg->{ snmpoptions }{ $rou }, 'sysUptime', 'sysName'); + my( $noid, $nloc ) = split( /:/, $rcfg->{ routeruptime }{ $rou }, 2 ); + # If only location (community@host) was specified then + # move the location details into the right place + if( $noid =~ /@/ ) { + $nloc = $noid; + $noid = undef; + } + # If no OID (community@host) was specified use the hardcoded default + if( not $noid ) { + $noid = 'sysUptime'; + } + # If no location (community@host) was specified use values from the + # unique target referred to in the monitored data calculation + if( not $nloc ){ + if ($u >= 0) { + my $comm = $target->[ $u ]{ Community }; + my $host = $target->[ $u ]{ Host }; + my $opt = $target->[ $u ]{ SnmpOpt }; + $nloc = "$comm\@$host$opt"; + } else { + die "$NOW: ERROR: You must specify the location part of the RouterUptime oid for non unique targets! ($rou)\n"; + } + } + + $uploc = $nloc; + # Get the device uptime if $noid(OID) and $nloc (community@host) have been specified + # one way or the other + debug('base', "Fetching sysUptime and sysName from: $noid:$nloc"); + ( $uptime, $name ) = snmpget( $uploc, $rcfg->{ snmpoptions }{ $rou }, $noid, 'sysName'); } - + # Get the device name from the alternate location (OID or # OID:community@host) that may have been specified with the RouterName # target keyword @@ -630,10 +676,10 @@ } # Get the location from the RouterUptime keyword if that is defined # and $nloc has not otherwise been specified - $nloc = $rcfg->{ routeruptime }{ $rou } - if defined $rcfg->{ routeruptime }{ $rou } and not $nloc; + $nloc = $uploc if $uploc and not $nloc; # Get the device name if $nloc (community@host) has been specified # one way or the other + debug('base', "Fetching sysName from: $noid:$nloc"); ( $name ) = snmpget( $nloc, $$rcfg{snmpoptions}{ $rou }, $noid ) if $nloc; } @@ -765,10 +811,10 @@ debug('base',"create $dotrrd"); # create the rrd if it doesn't exist # don't fail if interval is not set - my $interval = $$cfg{interval} || 5; + my $interval = $$cfg{interval}; my $minhb = int($$cfg{interval} * 60)*2; $minhb = 600 if ($minhb <600); - my $rows = $$rcfg{'rrdrowcount'}{$router} || ( 4000 / $interval); + my $rows = $$rcfg{'rrdrowcount'}{$router} || int( 4000 / $interval); my @args = ($dotrrd, '-b', $time-10, '-s', int($interval * 60), "DS:ds0:$up_abs:$minhb:0:$absi", "DS:ds1:$up_abs:$minhb:0:$abso", @@ -780,45 +826,72 @@ ( $interval < 30 ? ("RRA:MAX:0.5:".int(30/$interval).":800"):()), "RRA:MAX:0.5:".int(120/$interval).":800", "RRA:MAX:0.5:".int(1440/$interval).":800"); + # do we have holt winters rras defined here ? + if (defined $$rcfg{'rrdhwrras'} and defined $$rcfg{'rrdhwrras'}{$router}){ + push @args, split(/\s+/, $$rcfg{'rrdhwrras'}{$router}); + } + + debug('log', "RRDs::create(".join(',',@args).")"); RRDs::create(@args); my $e = RRDs::error(); - die "$NOW: ERROR: Cannot create logfile: $e\n" if $e; - debug('log', "Called: RRDs::create(@args)"); - } else { + die "$NOW: ERROR: Cannot create RRD ".join(',',@args)."- $e\n" if $e; + } elsif ( -M $dotrrd > 0 ) { # update the minimum/maximum according to maxbytes/absmax # and (re)set the data-source-type to reflect cfg changes # cost: 1 read/write cycle, but update will reuse the buffered data + # in daemon mode this will only happen in the first round my @args = ($dotrrd, '-a', "ds0:$absi", '-a', "ds1:$abso", '-d', "ds0:$up_abs", '-d', "ds1:$up_abs"); + debug('log', "RRDs::tune(@args)"); + my $start = gettimeofday(); RRDs::tune(@args); + debug('prof',sprintf("RRDs::tune $dotrrd - %.3fs",gettimeofday()-$start)); my $e = RRDs::error(); warn "$NOW: ERROR: Cannot tune logfile: $e\n" if $e; - debug('log', "Called: RRDs::tune(@args)"); } # update the rrd $inlast = 'U' unless defined $inlast and $inlast =~ /\S/ and $inlast ne '##UNDEF##'; $outlast = 'U' unless defined $outlast and $outlast =~ /\S/ and $outlast ne '##UNDEF##'; - debug('log', "Calling: RRDs::update($dotrrd, '$time:$inlast:$outlast')"); - RRDs::update("$dotrrd", "$time:$inlast:$outlast"); + debug('log', "RRDs::update($dotrrd, '$time:$inlast:$outlast')"); + my $start = gettimeofday(); + my $rrddata; + if ( $RRDs::VERSION >= 1.2 ){ + $rrddata=RRDs::updatev($dotrrd, "$time:$inlast:$outlast"); + } else { + RRDs::update($dotrrd, "$time:$inlast:$outlast"); + } + debug('prof',sprintf("RRDs::update $dotrrd - %.3fs",gettimeofday()-$start)); my $e = RRDs::error(); warn "$NOW: ERROR: Cannot update $dotrrd with '$time:$inlast:$outlast' $e\n" if ($e); - # get the rrdtool-processed values back from rrdtool - # for the threshold checks (we cannot use the fetched data) - my $info = RRDs::info($dotrrd); - my $lasttime = $info->{last_update} - $info->{last_update} % $info->{step}; - debug('log', "Called: RRDs::info($dotrrd)"); - $e = RRDs::error(); - warn "$NOW: ERROR: Cannot 'info' $dotrrd: $e\n" if ($e); - my $fetch = (RRDs::fetch($dotrrd,'AVERAGE','-s',$lasttime-1,'-e',$lasttime))[3]; - $e = RRDs::error(); - warn "$NOW: ERROR: Cannot 'fetch' $dotrrd: $e\n" if ($e); - debug('log', "Called: RRDs::fetch($dotrrd,'AVERAGE','-s',$lasttime,'-e',$lasttime)"); - my $in = $fetch->[0][0] ? $fetch->[0][0] : "NaN" ; - my $out = $fetch->[0][1] ? $fetch->[0][1] : "NaN" ; - debug('log', " got: $in/$out"); - $cuin{'d'}{$router} = $fetch->[0][0]; - $cuout{'d'}{$router} = $fetch->[0][1]; + if ( $RRDs::VERSION < 1.2 ){ + # get the rrdtool-processed values back from rrdtool + # for the threshold checks (we cannot use the fetched data) + $start = gettimeofday(); + my $info = RRDs::info($dotrrd); + debug('prof',sprintf("RRDs::info $dotrrd - %.3fs",gettimeofday()-$start)); + my $lasttime = $info->{last_update} - $info->{last_update} % $info->{step}; + debug('log', "RRDs::info($dotrrd)"); + $e = RRDs::error(); + warn "$NOW: ERROR: Cannot 'info' $dotrrd: $e\n" if ($e); + $start = gettimeofday(); + my $fetch = (RRDs::fetch($dotrrd,'AVERAGE','-s',$lasttime-1,'-e',$lasttime))[3]; + debug('prof',sprintf("RRDs::fetch $dotrrd - %.3fs",gettimeofday()-$start)); + $e = RRDs::error(); + warn "$NOW: ERROR: Cannot 'fetch' $dotrrd: $e\n" if ($e); + debug('log', "RRDs::fetch($dotrrd,'AVERAGE','-s',$lasttime,'-e',$lasttime)"); + $cuin{d}{$router} = $fetch->[0][0]; + $cuout{d}{$router} = $fetch->[0][1]; + } else { + my $utime = $time - ($time % int($cfg->{interval}*60)); + $cuin{d}{$router} = $rrddata->{"[$utime]RRA[AVERAGE][1]DS[ds0]"}; + $cuout{d}{$router} = $rrddata->{"[$utime]RRA[AVERAGE][1]DS[ds1]"}; + $cuin{d_hwfail}{$router} = $rrddata->{"[$utime]RRA[FAILURES][1]DS[ds0]"}; + $cuout{d_hwfail}{$router} = $rrddata->{"[$utime]RRA[FAILURES][1]DS[ds1]"}; + } + my $in = defined $cuin{d}{$router} ? $cuin{d}{$router} : "???" ; + my $out = defined $cuout{d}{$router} ? $cuout{d}{$router} : "???" ; + debug('log', " got: $in/$out"); # the html pages and the graphics are created at "call time" so that's it! # (the returned hashes are empty, it's just to minimize the changes to mrtg) if ($$rcfg{'options'}{'dorelpercent'}{$router}) { @@ -934,7 +1007,7 @@ $sign*$maxvi, $sign*$maxvo, $maxx, $maxy, ,$xscale, $yscale, $growright, $step, $bits, $ytics, $yticsf, $timestrfmt, $timestrpos); @mxvls = ("d"); push (@metas, "$$cfg{'imagedir'}$$rcfg{'directory'}{$router}${router}-day.${main::GRAPHFMT}", - $$cfg{'interval'} ? $$cfg{'interval'} : 5); + $$cfg{'interval'}); } @@ -1022,9 +1095,8 @@ } - debug('log', "Called @exec"); + debug('log', join(" ", @exec)); - imggen($$cfg{icondir} || $$cfg{imagedir}); if (open (HTML,"<$$cfg{'htmldir'}$$rcfg{'directory'}{$router}$router.$$rcfg{'extension'}{$router}")) { for ($i=0 ; $i<200 ; $i++) { @@ -1304,7 +1376,7 @@ my $dirrel = "../" x ($$rcfg{'directory_web'}{$router} =~ tr|/|/|); $Today=&$LOC(datestr(time)); - $VERSION = "2.14.7"; + $VERSION = "2.16.1"; open (HTML,">$$cfg{'htmldir'}$$rcfg{'directory'}{$router}$router.$$rcfg{'extension'}{$router}") || do { warn ("$NOW: WARNING: Writing $router.$$rcfg{'extension'}{$router}: $!"); next }; @@ -1313,9 +1385,9 @@ # print HTML '' . "\n"; print HTML '' . "\n"; print HTML "\n"; - my $interval =$$cfg{'interval'} ? $$cfg{'interval'} : 5; + my $interval =$$cfg{'interval'}; my $expiration = &expistr($interval); - my $refresh = $$cfg{'refresh'} ? $$cfg{'refresh'} : 300; + my $refresh = defined $$cfg{'refresh'} ? $$cfg{'refresh'} : 300; my $namestring = &$LOC("the device"); print HTML "\n"; print HTML <<"TEXT"; @@ -1719,7 +1791,7 @@ print < -mrtg-2.14.7 - Multi Router Traffic Grapher +mrtg-2.16.1 - Multi Router Traffic Grapher Copyright 1995-2006 by Tobias Oetiker Licensed under the Gnu GPL. @@ -1789,16 +1861,28 @@ } } +sub threshmail ($$$$){ + my $server = shift; + my $from = shift; + my $to = shift; + my $message = shift; + debug('base',"sending threshmail from $from to $to"); + my $smtp = Net::SMTP->new([split /\s*,\s*/, $server],Timeout=>5) or + do { warn "$NOW: ERROR: could not send thresholdmail to $to"; return }; + $smtp->mail($from); + $smtp->to(split(/\s*,\s*/, $to)); + $smtp->data(); + $smtp->datasend($message); + $smtp->dataend(); + $smtp->quit; +} + sub threshcheck { # threshold checking by Tom Muggli # ... fsck'd up but fixed by Juha Laine my ($cfg,$rcfg,$cfgfile,$router,$cuin,$cuout) = @_; my $threshfile; - my %threshval; - - $threshval{i} = $$cuin{'d'}{$router}; - $threshval{o} = $$cuout{'d'}{$router}; - + my %cu = ( i=> $cuin, o=>$cuout ); # are we going to keep state ? if (defined $$cfg{'threshdir'}){ ensureSL(\$$cfg{'threshdir'}); @@ -1806,67 +1890,139 @@ } # setup environment for external scripts - if (defined $$rcfg{'threshdesc'}{$router}) { - $ENV{THRESH_DESC}=$$rcfg{'threshdesc'}{$router}; + if (defined $rcfg->{'threshdesc'}{$router}) { + $ENV{THRESH_DESC}=$rcfg->{'threshdesc'}{$router}; } else { delete $ENV{THRESH_DESC}; } + if (defined $rcfg->{'hwthreshdesc'}{$router}) { + $ENV{HWTHRESH_DESC}=$rcfg->{'hwthreshdesc'}{$router}; + } else { + delete $ENV{HWTHRESH_DESC}; + } - foreach my $dir (qw(i o)){ # in and out - foreach my $bound (qw(min max)){ - # skip unless a threshold is defined for this "$router" - next unless defined $$rcfg{'thresh'.$bound.$dir}{$router}; - # we can not deal with unknown data here - $threshval{$dir} = 0 if not defined $threshval{$dir} and $$rcfg{'options'}{'unknaszero'}{$router}; - warn "$NOW: WARNING: can't do threshold checking for target $router($dir) -- No valid current data\n" - unless defined $threshval{$dir}; - my $value = $threshval{$dir}; - next unless defined $value; - my $boundval = $$rcfg{'thresh'.$bound.$dir}{$router}; - next unless defined $boundval; - if ($boundval =~ s/%$//) { # defined in % of maxbytes - # 2 decimals in % - $value = int($value / $$rcfg{"maxbytes".($dir eq 'i' ? 1 : 2)}{$router} * 10000.0) / 100; # the new code - } - - if (($bound eq 'min' and $boundval > $value) or - ($bound eq 'max' and $boundval < $value)) { - - # threshold was broken... - my @exec = ( $$rcfg{'threshprog'.$dir}{$router}, $router, - $$rcfg{'thresh'.$bound.$dir}{$router}, $threshval{$dir},($$rcfg{'threshdesc'}{$router} ||"No Description"), $value); - - # Check if we use the status file or not... - if ( defined $threshfile ) { - if ( not -e $threshfile.".".$bound.uc($dir) ) { - # Create a file to indicate a threshold problem for the time after the problem - open THRESHTOUCH, ">".$threshfile.".".$bound.uc($dir) - or warn "$NOW: WARNING: Creating $threshfile.".$bound.uc($dir).": $!\n"; - close THRESHTOUCH; - debug('base',"run treshprog$dir: ".(join ",",@exec)); - system @exec if defined $$rcfg{'threshprog'.$dir}{$router}; - } - } else { - # no threshold dir so run on every 'break' - system @exec if defined $$rcfg{'threshprog'.$dir}{$router}; - } - } else { + for my $dir (qw(i o)){ # in and out + my %thresh = ( + thresh => $cu{$dir}{d}{$router}, + + # if we are looking at an rrd with holtwinters RRAs + # we get a failures count. + hwthresh => $cu{$dir}{d_hwfail}{$router} + ); + for my $type (keys %thresh){ + my $threshval = $thresh{$type}; + next if not defined $threshval; + for my $bound (qw(min max)){ + # skip unless a threshold is defined for this "$router" + my $boundval = $rcfg->{$type.$bound.$dir}{$router}; + next unless defined $boundval; + + my $realval = ""; + my $realthresh = ""; + + if ($boundval =~ s/%$//) { # defined in % of maxbytes + # 2 decimals in % + $realval = "% ($threshval)"; + $realthresh = "% (".sprintf("%.1f",($rcfg->{"maxbytes".($dir eq 'i' ? 1 : 2)}{$router} * $boundval / 100)).")"; + $threshval = sprintf "%.1f", ($threshval / $rcfg->{"maxbytes".($dir eq 'i' ? 1 : 2)}{$router} * 100); # the new code + } + my $msghead = ""; + $msghead = "From: $cfg->{threshmailsender}\nTo: $rcfg->{${type}.'mailaddress'}{$router}" + if $rcfg->{${type}.'mailaddress'}{$router}; + my $pagetop = $rcfg->{pagetop}{$router}; + $pagetop =~ s|

.*?

||; + $pagetop =~ s|\s*\s*(.*?)\s*(.*?)\s*\s*|$1 $2\n|g; + $pagetop =~ s|\s*<.+?>\s*\n?||g; - # no threshold broken ... - my @exec = ( $$rcfg{'threshprogok'.$dir}{$router}, $router, - $$rcfg{'thresh'.$bound.$dir}{$router}, $threshval{$dir}); - - # Check if we use the status file or not... - if ( defined $threshfile ) { - if ( -e $threshfile.".".$bound.uc($dir) ){ - unlink "$threshfile.".$bound.uc($dir); - system @exec if defined $$rcfg{'threshprogok'.$dir}{$router}; - } - } - } + my $msgbody = <{title}{$router} + + Target: $router + Type: $type +Direction: $dir + Bound: $bound +Threshold: $boundval$realthresh + Current: $threshval$realval - } # foreach my $bound ... - } # foreach my $dir +$pagetop + +MESSAGE + $msgbody .= "\n$rcfg->{$type.'desc'}{$router}\n" if $rcfg->{$type.'desc'}{$router}; + + + if (($bound eq 'min' and $boundval > $threshval) or + ($bound eq 'max' and $boundval < $threshval)) { + # threshold was broken... + my $message = <{$type.'prog'.$dir}{$router}, $router, + $rcfg->{$type.$bound.$dir}{$router}, $threshval,($rcfg->{$type.'desc'}{$router} ||"No Description")); + + # Check if we use the status file or not... + if ( defined $threshfile ) { + if ( not -e $threshfile.".".$type.$bound.uc($dir) ) { + # Create a file to indicate a threshold problem for the time after the problem + open THRESHTOUCH, ">".$threshfile.".".$type.$bound.uc($dir) + or warn "$NOW: WARNING: Creating $threshfile.".$bound.uc($dir).": $!\n"; + close THRESHTOUCH; + if (defined $rcfg->{$type.'prog'.$dir}{$router}){ + debug('base',"run threshprog$dir: ".(join ",",@exec)); + system @exec; + } + threshmail $cfg->{threshmailserver},$cfg->{threshmailsender},$rcfg->{$type.'mailaddress'}{$router},$message + if $rcfg->{$type.'mailaddress'}{$router} + } + else { + debug('base',"NOT acting on BROKEN threshold since $threshfile.$type$bound$dir exists"); + } + } elsif ( not defined $cfg->{$type.'hyst'} or + ($bound eq 'min' and $boundval - $cfg->{$type.'hyst'}* $boundval < $threshval) or + ($bound eq 'max' and $boundval + $cfg->{$type.'hyst'}* $boundval > $threshval) + ) { + # no threshold dir so run on every 'break' + if (defined $rcfg->{$type.'prog'.$dir}{$router}){ + debug('base',"run ${type}prog$dir: ".(join ",",@exec)); + system @exec; + } + threshmail $cfg->{threshmailserver},$cfg->{threshmailsender},$rcfg->{$type.'mailaddress'}{$router},$message + if $rcfg->{$type.'mailaddress'}{$router}; + } + } else { + # no threshold broken ... + my @exec = ( $rcfg->{$type.'progok'.$dir}{$router}, $router, + $rcfg->{$type.$bound.$dir}{$router}, $threshval); + my $message = <{$type.$bound.$dir}{$router} vs $threshval) + +Threshold UN-BROKEN +------------------- +$msgbody +MESSAGE + + # Check if we use the status file or not... + if ( defined $threshfile ) { + if ( -e $threshfile.".".$type.$bound.uc($dir) ){ + unlink "$threshfile.".$type.$bound.uc($dir); + if (defined $rcfg->{$type.'progok'.$dir}{$router}){ + debug('base',"run ${type}progok$dir: ".(join ",",@exec)); + system @exec; + } + threshmail $cfg->{threshmailserver},$cfg->{threshmailsender},$rcfg->{$type.'mailaddress'}{$router},$message + if $rcfg->{$type.'mailaddress'}{$router}; + } + } + } + } # for my $bound ... + } # for my $type + } # for my $dir } sub getexternal ($) { @@ -1924,10 +2080,11 @@ return ($in,$out,time,$uptime,$name); } -sub getsnmparg ($$$){ +sub getsnmparg ($$$$){ my $confcache = shift; my $target = shift; my $cfg = shift; + my $populated = shift; my $retry = 0; my $hostname = $$target{Host}; @@ -1972,10 +2129,16 @@ } else { $$target{Key}[$i] =~ s/\s+$//; # no trainling whitespace in keys ... - if (not defined readfromcache($confcache,$hostkey,$$target{IfSel}[$i],$$target{Key}[$i])) { + if (not $$populated{$hostname} and + not defined readfromcache($confcache,$hostkey,$$target{IfSel}[$i],$$target{Key}[$i])) { debug('snpo',"($i) Populate ConfCache for $$target{Host}$$target{SnmpOpt}"); populateconfcache($confcache,"$$target{Community}\@$$target{Host}$$target{SnmpOpt}",$$target{ipv4only},1,$$target{snmpoptions}); + $$populated{$hostname} = 1; # set cache population to true for this cycle and host } +# if ($$populated{$hostname} and +# not defined readfromcache($confcache,$hostkey,$$target{IfSel}[$i],$$target{Key}[$i])){ +# debug('repo', "ConfCache for host $hostname already updated into this cycle"); +# } if (not defined readfromcache($confcache,$hostkey,$$target{IfSel}[$i],$$target{Key}[$i])) { warn "$NOW: WARNING: Could not match host:'$$target{Community}\@$$target{Host}$$target{SnmpOpt}' ref:'$$target{IfSel}[$i]' key:'$$target{Key}[$i]'\n"; return 'NOMATCH'; @@ -2027,12 +2190,13 @@ # make sure we have no error messages hanging round. - $SNMP_Session::errmsg = ''; + $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; my $targtemp = $$target{Community}.'@'.$$target{Host}.$$target{SnmpOpt}; $targtemp = v4onlyifnecessary($targtemp, $$target{ipv4only}); - my @snmpoids = grep !/^(Pseudo|WaLK|GeTNEXT)/, @OID; + my @snmpoids = grep !/^(Pseudo|WaLK|GeTNEXT|CnTWaLK)|IndexPOS/, @OID; if (defined $$cfg{singlerequest}){ #LH local $BER::pretty_print_timeticks = 0; @@ -2050,6 +2214,11 @@ debug('snpo',"snmpwalk '$oid' -> ".($newret[-1]||'UNDEF'));next}; s/^GeTNEXT// && do { my $oid=$_;push @newret, (split /:/, snmpgetnext($targtemp,$$target{snmpoptions},$oid),2)[1]; debug('snpo',"snmpgetnext '$oid' -> ".($newret[-1]||'UNDEF'));next}; + s/^CnTWaLK// && do { my $oid=$_;my @insts= (snmpwalk($targtemp,$$target{snmpoptions},$_)); + undef @insts if $insts[1] =~/no/i; push @newret, $#insts; + debug('snpo',"snmpCountwalk '$oid' -> ".($newret[-1]||'UNDEF'));next}; + /IndexPOS.*\.(\d*)/ && do { my $idx=$1; s/IndexPOS/$idx/; s/\.\d*$//; push @newret, snmpget($targtemp,$$target{snmpoptions},$_); + debug('snpo', "snmpget of oid '$_' after replacement of IndexPOS"); next}; push @newret, shift @ret; } @ret = @newret; @@ -2125,10 +2294,15 @@ } # no sense continuing here ... if there is no data ... if (defined $SNMP_Session::errmsg and $SNMP_Session::errmsg =~ /no response received/){ - $SNMP_Session::errmsg = ''; + $SNMP_Session::errmsg = undef; warn "$NOW: WARNING: skipping because at least the query for $OID[0] on $$target{Host} did not succeed\n"; return 'DEADHOST'; - } + } + if (defined $Net_SNMP_util::ErrorMessage and $Net_SNMP_util::ErrorMessage =~ /No response from remote/){ + $Net_SNMP_util::ErrorMessage = undef; + warn "$NOW: WARNING: skipping because at least the query for $OID[0] on $$target{Host} did not succeed\n"; + return 'DEADHOST'; + } if ($$target{OID}[$i] =~ /if(Admin|Oper)Hack/) { push @final, ((shift @ret) == 1) ? 1:0; } else { @@ -2200,6 +2374,7 @@ debug ('fork',"Child $i ($$) after fork"); my $res = ""; my %deadhost; + my %populated; for (my $ii = $i * $split; $ii < ($i+1) * $split and $ii < $trgnum; $ii++){ @@ -2209,7 +2384,7 @@ @res = getexternal($$targ{Command}); } else { # parent if (not $deadhost{$$targ{Community}.$$targ{Host}}) { - @res = getsnmparg($confcache,$targ,$cfg); + @res = getsnmparg($confcache,$targ,$cfg,\%populated); if ( $res[0] and $res[0] eq 'DEADHOST') { # guess we got a blank here @res = ( undef,undef,time,undef,undef); @@ -2310,6 +2485,7 @@ } else { my %deadhost; + my %populated; foreach my $targ (@$target) { if ($$targ{Methode} eq 'EXEC') { debug('snpo', "run external $$targ{Command}"); @@ -2324,7 +2500,7 @@ $$targ{_OUT_}, $$targ{_TIME_}, $$targ{_UPTIME_}, - $$targ{_NAME_}) = getsnmparg($confcache,$targ,$cfg); + $$targ{_NAME_}) = getsnmparg($confcache,$targ,$cfg,\%populated); if ( $$targ{_IN_} and $$targ{_IN_} eq 'DEADHOST') { $$targ{_IN_} = undef; $$targ{_TIME_} =time; diff -Nru mrtg-2.14.7/bin/mrtg-traffic-sum mrtg-2.16.1/bin/mrtg-traffic-sum --- mrtg-2.14.7/bin/mrtg-traffic-sum 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/bin/mrtg-traffic-sum 2006-12-22 08:46:40.000000000 +0000 @@ -0,0 +1,220 @@ +#!/usr/bin/perl -w + +use strict; +use Getopt::Long; +use Pod::Usage; + +BEGIN { + # Automatic OS detection ... do NOT touch + if ( $^O =~ /^(?:(ms)?(dos|win(32|nt)?))/i ) { + $main::OS = 'NT'; + $main::SL = '\\'; + $main::PS = ';'; + } elsif ( $^O =~ /^VMS$/i ) { + $main::OS = 'VMS'; + $main::SL = '.'; + $main::PS = ':'; + } else { + $main::OS = 'UNIX'; + $main::SL = '/'; + $main::PS = ':'; + } +} + +use FindBin; +use lib "${FindBin::Bin}"; +use lib "${FindBin::Bin}${main::SL}..${main::SL}lib${main::SL}mrtg2"; +use MRTG_lib "2.090017"; +use POSIX qw(mktime); + +'$Revision: 1.8 $ ' =~ /Revision: (\S*)/; +my $Revision = $1; + +my $sendmail = "/usr/lib/sendmail"; +$sendmail = "/usr/sbin/sendmail" if -x "/usr/sbin/sendmail"; + +# main loop +my %opt = ( + 'catch' => '(?:description|port name):\s*\s*([^<\s]+[^<]*?)\s* 'td>\s*([^<\s]+COLO[^<]*?)\s* 500 ); +sub walklog ($$$$); +sub sumlog($$$); +sub mailout($$); + +sub main() +{ + # parse options + GetOptions(\%opt, 'min=i','help|h', 'catch=s', 'email=s','version') or exit(1); + if($opt{help}) { pod2usage(1) } + if($opt{man}) { pod2usage(-exitstatus => 0, -verbose => 2) } + if($opt{version}) { print "mrtg-traffic-sum $Revision\n"; exit(0) } + my $cfgfile = shift @ARGV; + pod2usage(1) unless $cfgfile and -r $cfgfile; + my %rcfg; + my %cfg; + my @routers; + my @target; + my $report = "Subject: Traffic total for '$cfgfile' ($Revision) "; + readcfg($cfgfile,\@routers,\%cfg,\%rcfg); + cfgcheck(\@routers, \%cfg, \%rcfg, \@target); + walklog \@routers, \%cfg, \%rcfg,\$report; + if ($opt{email}) { + mailout \$report,$opt{email}; + } else { + print $report; + } +} + +main; + +sub walklog ($$$$){ + my $routers = shift; + my $cfg = shift; + my $rcfg = shift; + my $report = shift; + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = + localtime(time); + my $start = mktime(0, 0, 0, 1, $mon-1, $year, 0, 0, 1); + my $end = mktime(0, 0, 0, 1, $mon, $year, 0, 0, 1)-1; + my($m,$y) = (localtime($start))[4,5]; + $y += 1900; + $m ++; + $$report .= sprintf "%04d/%02d\n\n", $y,$m; + + $$report .= "Start: ".localtime($start)."\n"; + $$report .= "End: ".localtime($end)."\n"; + $$report .= sprintf "%-40s %15s\n","Interface","In+Out in GB"; + $$report .= ("-" x 78)."\n"; + foreach my $r (@$routers) { + my $label; + if ($rcfg->{pagetop}{$r} =~ /$opt{catch}/i ) { + $label = $1; + $label .= " $2" if $2; + my ($in,$out) = sumlog $cfg->{logdir}.$rcfg->{directory}{$r}."$r.log",$start,$end; + my $sum = ($in+$out)/(10**9); + next if $sum < $opt{'min'}; + $$report .= sprintf "%-40s %15.0f\n",$label,$sum; + } + } +} + +sub sumlog ($$$) { + my $log = shift; + my $start = shift; + my $end = shift; + my $in = 0.0; + my $out = 0.0; + if (open L, "<",$log){ + my @this=($end+1,0,0); + my @prev; + while () { + chomp; + @prev = @this; + @this = (split /\s+/)[0,1,2]; + + if ($prev[0] <= $end) { + my $diff = $prev[0] - $this[0]; + $in += $diff * $prev[1]; + $out += $diff * $prev[2]; + } + last if $this[0] <= $start; + } + close L; + } else { + warn "WARN Skipping $log\n"; + } + return $in,$out; +} + +sub mailout ($$) { + my $data = shift; + my $rec = shift; + open S, "|-" or exec $sendmail,'-f',$rec,$rec; + print S < [I...] B + + --man show man-page and exit + -h, --help display this help and exit + --version output version information and exit + --catch=regexp filter out things that match this in PageTop + --email=address email the result + --min=gigabytes minimal number of gigabites required for report + +=head1 DESCRIPTION + +The mrtg-traffic-sum goes through the mrtg logs for the targets in the +the config file specified and builds the traffic total for the last +month in Giga Bytes. (Note in communications Giga is 10^9). + +The result of this analysis can be sent via email to an address of +your choice using the B<--email> option. + +With the B<--catch> option you can specify a regular expression which +will be matched against the contents of the PageTop settings. The +regular expression should return a value into $1 and possibly into +$2. This will then be used as description for the appropriate traffic +sum. By default the catch is set to: + + (?:description|port name):\s*\s*([^< ]*?[^<]*?)\s* switch to change this number. + +=head1 COPYRIGHT + +Copyright (c) 2002 by Tobias Oetiker. All rights reserved. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +=head1 AUTHOR + +Tobias Oetiker Etobi@oetiker.chE + +=head1 HISTORY + + 2002-07-13 to Initial Version + +=cut + +# Emacs Configuration +# +# Local Variables: +# mode: cperl +# eval: (cperl-set-style "PerlStyle") +# mode: flyspell +# mode: flyspell-prog +# End: +# +# vi: sw=4 et diff -Nru mrtg-2.14.7/CHANGES mrtg-2.16.1/CHANGES --- mrtg-2.14.7/CHANGES 2006-09-06 14:28:24.000000000 +0100 +++ mrtg-2.16.1/CHANGES 2008-02-17 10:27:05.000000000 +0000 @@ -1,3 +1,118 @@ +Changes 2.16.1, 2008-02-17 +-------------------------- +From: Tobi +* fix RouterUptime config with non unique targets + +Changes 2.16.0, 2008-02-06 +-------------------------- +From: Fernando Nieto fnieto satec.es +* Makesure mrtg repopulates its cache only once even in fork mode + +From: Tobi +* Added support for RRDtool based Holt-Winters aberrant behaviour detection. + Threshold based alerts have been enhanced to be able to fire based on the + FAILURES RRA. Note that Holt-Winters aberrant behaviour detection can only + be enabled on newly created RRAs. + +From: Sergio Chiesa sergio.chiesa eutelia.it +* when thresholds were UNboraken, the threshprogok did not run necessarily + +From: Mike Mitchell Mike.Mitchell sas.com +* MIB parser rewritten for better compatibility + +From: Norman Rasmussen norman rasmussen.co.za +* allow RouterUptime to contain an explicit OID for queriing the uptime. + +From Ajit Mallick ajitmallick gmail com +* support for nortel passport 8600 in cfgmaker + +From Dan.McDonald +* Added Documentation for GeTNEXT prefix +* Added New Prefix for Counterd SNMP Walk -> CnTWaLK (see docs) + +From: Simon Leinen +* Upgrade to SNMP Session 1.10 + +From: Mike Mitchel +* Updates for Net_SNMP_util.pm and SNMP_util.pm + +From: Tobi +* Fix if_is_ciscovlan condition in cfgmaker +* Updated port syntax in documentation (based on trac entry) + +Changes 2.15.2, 2007-04-29 +-------------------------- +From: Tobi +* Improve parsing reliability of indexmaker +* Fixed deadhost detection in mrtg + +From: Dan.McDonald austinenergy.com +* added config option noHC for boxes that don't have HC counters + but run SNMPv2/v3 + +From: Mike Mitchell Mike.Mitchell sas.com +* Updated Net_SNMP_util module (error messages) + +From: Günter Knauf +* Updated Makefiles for Win32 and Netware +* New Netware version of rateup.nlm + +Changes 2.15.1, 2007-02-01 +-------------------------- +From: Gosselin, Gerry GGosselin onecommunications.com +* make cfgmaker detect broken snmpv1 counters more reliably + +From: Mike Mitchell +* latest Net_SNMP_util.pm with many small fixes + +From: Dan.McDonald austinenergy.com +* more cfgmaker smarts and documentation for snmpv3 + +From: Tobi +* be happy even if no threshmail sending is configured +* add install target for traffic-summer +* fix mrtg-traffic-sum default catch expression to be in sync with docs + +Changes 2.15.0, 2006-12-05 +-------------------------- +From: Stefan.Schnitter t-systems.com +* Free positioning of a generated ifIndex in the OID string using + the magic IndexPOS keyword + +From: Tobi + +* When doing threshold checking with rrdtool, there was a very expensive + 'getting the data back with rrdinfo and rrdfetch' cycle after each + rrdupdate. with rrdtool 1.2 and the updatev function this is not + necessary anymore the new code speeds up mrtg cycle time by a factor of 3 + to 10 depending on your platform. + +* Threshold Un-Borken Messages will only be generated when the value is 10% + away from the threshold. Configurable via ThreshHyst + +* New function thresholdmail lets you send an email when a threshold + is broken. This feature talks directly to the mailserver and does + not require any external programs. + +* New template writers helper function in cfgmaker - oid_pick. It tests if a + device is willing to supply information regarding a particular oid. This + makes template writing much more pleasant. + http://oss.oetiker.ch/mrtg-trac/browser/trunk/templates/cisco/host-cisco.tmpl + +* added new tool mrtg-traffic-sum to build traffic stats based on the + content of your mrtg log (not rrd) files. + +* mrtg running with rrdtool can now do sub-minute resolution if the interval + is specified like that: 0:30 ... note that you can not change the + resolution of an existing rrd file. So this will only have the desired + effect on new rrds. Also note that the graphing frontend may need changes too to be + able to deal with the new interval type. Internally interval is now a float! + +* new debug option 'prof' to see how long rrdtool spends on its writes ... + +From: Daniel J McDonald dan.mcdonald austinenergy.com +* fixed snmpv3 support in cfgmaker + Changes 2.14.7, 2006-09-06 -------------------------- From: Tobi diff -Nru mrtg-2.14.7/config.h mrtg-2.16.1/config.h --- mrtg-2.14.7/config.h 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/config.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,66 +0,0 @@ -/* config.h. Generated by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strtoll' function. */ -#define HAVE_STRTOLL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* How to print a long long */ -#define LLD "%lld" - -/* long long format without % specifier */ -#define LLD_FORMAT "lld" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -#ifndef HAVE_STRTOLL -long long int strtoll(const char *str, char **ptr, int base) -{ - long long int ll; - sscanf(str, LLD, &ll); - return ll; -} -#endif - diff -Nru mrtg-2.14.7/configure mrtg-2.16.1/configure --- mrtg-2.14.7/configure 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/configure 2008-05-10 19:05:47.000000000 +0100 @@ -1,25 +1,54 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.61. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -29,8 +58,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +108,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +128,388 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. fi +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +518,28 @@ as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,39 +548,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -276,42 +581,108 @@ # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PERL NROFF EGREP RRD_PERL GDFORM_EXT LD_RUN_PATH LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +SET_MAKE +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +PERL +NROFF +GREP +EGREP +RRD_PERL +GDFORM_EXT +LD_RUN_PATH +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -338,34 +709,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -387,33 +772,45 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -440,6 +837,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -464,13 +867,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -535,6 +941,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -587,24 +1003,20 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -635,8 +1047,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -656,27 +1067,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -703,75 +1106,77 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + # # Report the --help message. # @@ -799,9 +1204,6 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -819,15 +1221,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -856,126 +1265,95 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -994,7 +1372,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1008,6 +1386,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1029,7 +1408,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1040,7 +1418,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1062,9 +1440,7 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1075,8 +1451,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1089,20 +1465,34 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1113,22 +1503,28 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1140,26 +1536,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1190,14 +1584,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1213,8 +1610,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1226,12 +1623,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1256,8 +1652,7 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1274,12 +1669,6 @@ { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1296,6 +1685,11 @@ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu @@ -1307,8 +1701,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1321,32 +1715,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1359,36 +1755,51 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1401,74 +1812,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1482,7 +1853,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1493,6 +1864,7 @@ fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1510,22 +1882,23 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1538,36 +1911,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1580,29 +1955,45 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1615,21 +2006,35 @@ { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -1654,47 +2059,77 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1706,19 +2141,21 @@ fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1737,22 +2174,27 @@ fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1763,9 +2205,8 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -1779,14 +2220,14 @@ fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1806,14 +2247,20 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1831,12 +2278,12 @@ rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1859,50 +2306,49 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1918,38 +2364,118 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -1965,12 +2491,12 @@ CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2004,12 +2530,17 @@ /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2024,271 +2555,121 @@ return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2297,9 +2678,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2309,24 +2691,22 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -2337,6 +2717,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2354,8 +2735,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2378,24 +2759,22 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2404,9 +2783,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2416,24 +2796,22 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -2444,6 +2822,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2465,59 +2844,66 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2532,8 +2918,8 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2555,7 +2941,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2574,21 +2960,22 @@ ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2600,8 +2987,8 @@ # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2617,28 +3004,29 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" ;; esac fi PERL=$ac_cv_path_PERL - if test -n "$PERL"; then - echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6 + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test $PERL = no; then echo echo "** No Perl found in the PATH. A recent copy of Perl" @@ -2651,8 +3039,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_NROFF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2667,50 +3055,198 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi NROFF=$ac_cv_path_NROFF - if test -n "$NROFF"; then - echo "$as_me:$LINENO: result: $NROFF" >&5 -echo "${ECHO_T}$NROFF" >&6 + { echo "$as_me:$LINENO: result: $NROFF" >&5 +echo "${ECHO_T}$NROFF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$NROFF" && break done -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2734,35 +3270,31 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -2818,6 +3350,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -2837,18 +3370,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2861,12 +3403,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2889,9 +3433,9 @@ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -2905,38 +3449,35 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2951,18 +3492,19 @@ for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2973,41 +3515,37 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3016,24 +3554,22 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3041,9 +3577,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3067,25 +3604,19 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3097,8 +3628,8 @@ done -echo "$as_me:$LINENO: checking for unsigned long long" >&5 -echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3109,53 +3640,50 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned long long ac__type_new_; int main () { -if ((unsigned long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_long_long=no + ac_cv_type_unsigned_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3166,58 +3694,55 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long long ac__type_new_; int main () { -if ((long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no + ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } for ac_func in strtoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3243,68 +3768,60 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -3315,8 +3832,8 @@ # Taken from libIDL-0.8.2 -echo "$as_me:$LINENO: checking for printf long long format specifier" >&5 -echo $ECHO_N "checking for printf long long format specifier... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for printf long long format specifier" >&5 +echo $ECHO_N "checking for printf long long format specifier... $ECHO_C" >&6; } if test "${long_long_format_specifier+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3347,13 +3864,22 @@ _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3366,13 +3892,15 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + done fi -echo "$as_me:$LINENO: result: $long_long_format_specifier" >&5 -echo "${ECHO_T}$long_long_format_specifier" >&6 +{ echo "$as_me:$LINENO: result: $long_long_format_specifier" >&5 +echo "${ECHO_T}$long_long_format_specifier" >&6; } cat >>confdefs.h <<_ACEOF #define LLD "$long_long_format_specifier" @@ -3387,8 +3915,8 @@ -echo "$as_me:$LINENO: checking for pow in -lm" >&5 -echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pow in -lm" >&5 +echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3401,139 +3929,136 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pow (); int main () { -pow (); +return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_m_pow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_pow=no + ac_cv_lib_m_pow=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 -echo "${ECHO_T}$ac_cv_lib_m_pow" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 +echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; } if test $ac_cv_lib_m_pow = yes; then MATHLIBS="-lm" fi -# Check whether --with-gd or --without-gd was given. +# Check whether --with-gd was given. if test "${with_gd+set}" = set; then - withval="$with_gd" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_gd; LDFLAGS="${LDFLAGS} -L${withval}" CPPFLAGS="${CPPFLAGS} -I${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi + -# Check whether --with-gd-lib or --without-gd-lib was given. +# Check whether --with-gd-lib was given. if test "${with_gd_lib+set}" = set; then - withval="$with_gd_lib" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_gd_lib; LDFLAGS="${LDFLAGS} -L${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi + -# Check whether --with-gd-inc or --without-gd-inc was given. +# Check whether --with-gd-inc was given. if test "${with_gd_inc+set}" = set; then - withval="$with_gd_inc" - CPPFLAGS="${CPPFLAGS} -I${withval}" -fi; + withval=$with_gd_inc; CPPFLAGS="${CPPFLAGS} -I${withval}" +fi + -# Check whether --with-z or --without-z was given. +# Check whether --with-z was given. if test "${with_z+set}" = set; then - withval="$with_z" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_z; LDFLAGS="${LDFLAGS} -L${withval}" CPPFLAGS="${CPPFLAGS} -I${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi -# Check whether --with-z-lib or --without-z-lib was given. + +# Check whether --with-z-lib was given. if test "${with_z_lib+set}" = set; then - withval="$with_z_lib" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_z_lib; LDFLAGS="${LDFLAGS} -L${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi -# Check whether --with-z-inc or --without-z-inc was given. + +# Check whether --with-z-inc was given. if test "${with_z_inc+set}" = set; then - withval="$with_z_inc" - CPPFLAGS="${CPPFLAGS} -I${withval}" -fi; + withval=$with_z_inc; CPPFLAGS="${CPPFLAGS} -I${withval}" +fi -# Check whether --with-png or --without-png was given. + +# Check whether --with-png was given. if test "${with_png+set}" = set; then - withval="$with_png" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_png; LDFLAGS="${LDFLAGS} -L${withval}" CPPFLAGS="${CPPFLAGS} -I${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi + -# Check whether --with-png-lib or --without-png-lib was given. +# Check whether --with-png-lib was given. if test "${with_png_lib+set}" = set; then - withval="$with_png_lib" - LDFLAGS="${LDFLAGS} -L${withval}" + withval=$with_png_lib; LDFLAGS="${LDFLAGS} -L${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" -fi; +fi + -# Check whether --with-png-inc or --without-png-inc was given. +# Check whether --with-png-inc was given. if test "${with_png_inc+set}" = set; then - withval="$with_png_inc" - CPPFLAGS="${CPPFLAGS} -I${withval}" -fi; + withval=$with_png_inc; CPPFLAGS="${CPPFLAGS} -I${withval}" +fi + LIBS="${LIBS} ${MATHLIBS}" GDEXTRALIB="" -echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5 -echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5 +echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImageGif+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3546,56 +4071,53 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gdImageGif (); int main () { -gdImageGif (); +return gdImageGif (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImageGif=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gd_gdImageGif=no + ac_cv_lib_gd_gdImageGif=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGif" >&5 -echo "${ECHO_T}$ac_cv_lib_gd_gdImageGif" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGif" >&5 +echo "${ECHO_T}$ac_cv_lib_gd_gdImageGif" >&6; } if test $ac_cv_lib_gd_gdImageGif = yes; then GDFORM_EXT=gif @@ -3606,8 +4128,8 @@ fi -echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5 -echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5 +echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImagePng+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3620,56 +4142,53 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gdImagePng (); int main () { -gdImagePng (); +return gdImagePng (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImagePng=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gd_gdImagePng=no + ac_cv_lib_gd_gdImagePng=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng" >&5 -echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng" >&5 +echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng" >&6; } if test $ac_cv_lib_gd_gdImagePng = yes; then GDFORM_EXT=png @@ -3680,8 +4199,8 @@ fi -echo "$as_me:$LINENO: checking for gdImagePng_jpg in -lgd" >&5 -echo $ECHO_N "checking for gdImagePng_jpg in -lgd... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gdImagePng_jpg in -lgd" >&5 +echo $ECHO_N "checking for gdImagePng_jpg in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImagePng_jpg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3694,56 +4213,53 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gdImagePng_jpg (); int main () { -gdImagePng_jpg (); +return gdImagePng_jpg (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImagePng_jpg=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gd_gdImagePng_jpg=no + ac_cv_lib_gd_gdImagePng_jpg=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng_jpg" >&5 -echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng_jpg" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng_jpg" >&5 +echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng_jpg" >&6; } if test $ac_cv_lib_gd_gdImagePng_jpg = yes; then GDFORM_EXT=png @@ -3754,8 +4270,8 @@ fi -echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in -lgd" >&5 -echo $ECHO_N "checking for gdImagePng_jpg_ft in -lgd... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gdImagePng_jpg_ft in -lgd" >&5 +echo $ECHO_N "checking for gdImagePng_jpg_ft in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImagePng_jpg_ft+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3768,56 +4284,53 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gdImagePng_jpg_ft (); int main () { -gdImagePng_jpg_ft (); +return gdImagePng_jpg_ft (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImagePng_jpg_ft=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gd_gdImagePng_jpg_ft=no + ac_cv_lib_gd_gdImagePng_jpg_ft=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng_jpg_ft" >&5 -echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng_jpg_ft" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng_jpg_ft" >&5 +echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng_jpg_ft" >&6; } if test $ac_cv_lib_gd_gdImagePng_jpg_ft = yes; then GDFORM_EXT=png @@ -3832,8 +4345,8 @@ CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImageGif" fi -echo "$as_me:$LINENO: checking for gdImageGd in -lgd" >&5 -echo $ECHO_N "checking for gdImageGd in -lgd... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gdImageGd in -lgd" >&5 +echo $ECHO_N "checking for gdImageGd in -lgd... $ECHO_C" >&6; } if test "${ac_cv_lib_gd_gdImageGd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3846,56 +4359,62 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gdImageGd (); int main () { -gdImageGd (); +return gdImageGd (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gd_gdImageGd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gd_gdImageGd=no + ac_cv_lib_gd_gdImageGd=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGd" >&5 -echo "${ECHO_T}$ac_cv_lib_gd_gdImageGd" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGd" >&5 +echo "${ECHO_T}$ac_cv_lib_gd_gdImageGd" >&6; } +if test $ac_cv_lib_gd_gdImageGd = yes; then + +# GLIBS="-Wl,-Bstatic ${GLIBS} -Wl,-Bdynamic" + : + +else + : +fi + if test x$GDFORM_EXT = xpng; then CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImagePng" @@ -3905,17 +4424,17 @@ if test "${ac_cv_header_gd_h+set}" = set; then - echo "$as_me:$LINENO: checking for gd.h" >&5 -echo $ECHO_N "checking for gd.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gd.h" >&5 +echo $ECHO_N "checking for gd.h... $ECHO_C" >&6; } if test "${ac_cv_header_gd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 -echo "${ECHO_T}$ac_cv_header_gd_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 +echo "${ECHO_T}$ac_cv_header_gd_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking gd.h usability" >&5 -echo $ECHO_N "checking gd.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking gd.h usability" >&5 +echo $ECHO_N "checking gd.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3926,41 +4445,37 @@ #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking gd.h presence" >&5 -echo $ECHO_N "checking gd.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking gd.h presence" >&5 +echo $ECHO_N "checking gd.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3969,24 +4484,22 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3994,9 +4507,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4020,25 +4534,18 @@ echo "$as_me: WARNING: gd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gd.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for gd.h" >&5 -echo $ECHO_N "checking for gd.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gd.h" >&5 +echo $ECHO_N "checking for gd.h... $ECHO_C" >&6; } if test "${ac_cv_header_gd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gd_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 -echo "${ECHO_T}$ac_cv_header_gd_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_gd_h" >&5 +echo "${ECHO_T}$ac_cv_header_gd_h" >&6; } fi if test $ac_cv_header_gd_h = yes; then @@ -4081,16 +4588,16 @@ exit 1 fi -echo "$as_me:$LINENO: checking the weather" >&5 -echo $ECHO_N "checking the weather... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: (cached) it's fine" >&5 -echo "${ECHO_T}(cached) it's fine" >&6 +{ echo "$as_me:$LINENO: checking the weather" >&5 +echo $ECHO_N "checking the weather... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: (cached) it's fine" >&5 +echo "${ECHO_T}(cached) it's fine" >&6; } if test "x$GCC" = "xyes"; then oCFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W" - echo "$as_me:$LINENO: checking if we can use GCC-specific compiler options" >&5 -echo $ECHO_N "checking if we can use GCC-specific compiler options... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can use GCC-specific compiler options" >&5 +echo $ECHO_N "checking if we can use GCC-specific compiler options... $ECHO_C" >&6; } if test "${rd_cv_gcc_opt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4110,40 +4617,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then rd_cv_gcc_opt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -rd_cv_gcc_opt=no + rd_cv_gcc_opt=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $rd_cv_gcc_opt" >&5 -echo "${ECHO_T}$rd_cv_gcc_opt" >&6 +{ echo "$as_me:$LINENO: result: $rd_cv_gcc_opt" >&5 +echo "${ECHO_T}$rd_cv_gcc_opt" >&6; } if test $rd_cv_gcc_opt = no; then CFLAGS=$oCFLAGS fi @@ -4155,9 +4658,10 @@ - ac_config_headers="$ac_config_headers config.h" +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile" - ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -4176,39 +4680,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -4217,32 +4740,18 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -4273,17 +4782,45 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -4293,8 +4830,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -4308,18 +4880,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -4327,159 +4900,120 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -4488,7 +5022,28 @@ as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -4497,31 +5052,14 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4529,30 +5067,19 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -4560,7 +5087,7 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -4576,19 +5103,21 @@ $config_headers Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -4599,39 +5128,24 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -4641,18 +5155,24 @@ $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -4668,29 +5188,43 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4701,557 +5235,510 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@PERL@,$PERL,;t t -s,@NROFF@,$NROFF,;t t -s,@EGREP@,$EGREP,;t t -s,@RRD_PERL@,$RRD_PERL,;t t -s,@GDFORM_EXT@,$GDFORM_EXT,;t t -s,@LD_RUN_PATH@,$LD_RUN_PATH,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +PERL!$PERL$ac_delim +NROFF!$NROFF$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +RRD_PERL!$RRD_PERL$ac_delim +GDFORM_EXT!$GDFORM_EXT$ac_delim +LD_RUN_PATH!$LD_RUN_PATH$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF + rm -f "$tmp/out12" + ;; + + + esac + +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF @@ -5282,7 +5769,7 @@ -echo $ECHO_N "ordering CD from http://people.ee.ethz.ch/~oetiker/wish $ECHO_C" 1>&6 +echo $ECHO_N "ordering CD from http://tobi.oetiker.ch/wish $ECHO_C" 1>&6 sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 sleep 1 @@ -5292,8 +5779,8 @@ sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 sleep 1 -echo "$as_me:$LINENO: result: just kidding ;-)" >&5 -echo "${ECHO_T} just kidding ;-)" >&6 +{ echo "$as_me:$LINENO: result: just kidding ;-)" >&5 +echo "${ECHO_T} just kidding ;-)" >&6; } sleep 2 echo echo "----------------------------------------------------------------" @@ -5305,5 +5792,5 @@ echo "you feel like showing your appreciation for MRTG, this is the" echo "place to go. I just love CDs and DVDs" echo -echo " -- Tobi Oetiker " +echo " -- Tobi Oetiker " echo "----------------------------------------------------------------" diff -Nru mrtg-2.14.7/configure.in mrtg-2.16.1/configure.in --- mrtg-2.14.7/configure.in 2006-08-27 22:14:51.000000000 +0100 +++ mrtg-2.16.1/configure.in 2007-05-02 21:31:06.000000000 +0100 @@ -201,7 +201,7 @@ AC_OUTPUT(Makefile) -echo $ECHO_N "ordering CD from http://people.ee.ethz.ch/~oetiker/wish $ECHO_C" 1>&6 +echo $ECHO_N "ordering CD from http://tobi.oetiker.ch/wish $ECHO_C" 1>&6 sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 sleep 1 @@ -223,5 +223,5 @@ echo "you feel like showing your appreciation for MRTG, this is the" echo "place to go. I just love CDs and DVDs" echo -echo " -- Tobi Oetiker " +echo " -- Tobi Oetiker " echo "----------------------------------------------------------------" diff -Nru mrtg-2.14.7/contrib/linux_stat/linux_stats.pl mrtg-2.16.1/contrib/linux_stat/linux_stats.pl --- mrtg-2.14.7/contrib/linux_stat/linux_stats.pl 2006-09-06 07:05:54.000000000 +0100 +++ mrtg-2.16.1/contrib/linux_stat/linux_stats.pl 2006-10-10 16:54:35.000000000 +0100 @@ -51,7 +51,7 @@ $found++; } } else { - if ($line =~ /^\s+$interface:\s*(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+$/) { + if ($line =~ /^\s*$interface:\s*(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+$/) { $in = $1; $out = $2; $found = 1; diff -Nru mrtg-2.14.7/contrib/mrtg-ipacc/ipacc mrtg-2.16.1/contrib/mrtg-ipacc/ipacc --- mrtg-2.14.7/contrib/mrtg-ipacc/ipacc 2006-09-06 07:05:50.000000000 +0100 +++ mrtg-2.16.1/contrib/mrtg-ipacc/ipacc 2008-05-10 19:05:47.000000000 +0100 @@ -88,7 +88,7 @@ if($source_port.$dest_port ne '') { $prot='tcp';} if($mode eq 'both') { - $exec_line="$ipfwadm -A out -a -P $prot -S $source_ip $source_port -D $dest_ip $dest_port; $ipfwadm -A in -a -P $prot -S $dest_ip $dest_port -D $source_ip $source_port"; + $exec_line="$ipfwadm -A in -a -P $prot -S $source_ip $source_port -D $dest_ip $dest_port; $ipfwadm -A out -a -P $prot -S $dest_ip $dest_port -D $source_ip $source_port"; } else { $exec_line="$ipfwadm -A $mode -a -P $prot -S $source_ip $source_port -D $dest_ip $dest_port"; diff -Nru mrtg-2.14.7/debian/cfgmaker.1 mrtg-2.16.1/debian/cfgmaker.1 --- mrtg-2.14.7/debian/cfgmaker.1 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/cfgmaker.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -.TH CFGMAKER 1 -.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection -.\" other parms are allowed: see man(7), man(1) -.SH CFGMAKER -cfgmaker \- create mrtg configuration file -.SH SYNOPSIS -.B cfgmaker -.I "[options] community@router" -.br -.SH "DESCRIPTION" -This manual page documents briefly the -.BR cfgmaker -command. -This manual page was written for the Debian GNU/Linux distribution -because the original program does not have a manual page. -.PP -.B cfgmaker -is a program to connect to a router via SNMP, extract information on the -router's interfaces, and to generate a configuration file using this -information suitable for mrtg(1). -.PP -.I community -is the SNMP community name to use when connecting to the router and -.I router -is the hostname or IP address of the router to interrogate. -.SH OPTIONS -The program follows the usual GNU command line syntax, with long -options starting with two dashes (`-'). -A summary of options are included below. -.TP -.B \-\-vendor -Try and extract additional information from Cisco and Livingston equipment. -.SH "SEE ALSO" -indexmaker(1), mrtg(1), rateup(1). -.SH AUTHOR -This manual page was written by Dermot Bradley , -for the Debian GNU/Linux system (but may be used by others). diff -Nru mrtg-2.14.7/debian/changelog mrtg-2.16.1/debian/changelog --- mrtg-2.14.7/debian/changelog 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/changelog 2008-05-10 19:05:47.000000000 +0100 @@ -1,3 +1,36 @@ +mrtg (2.16.1-2ubuntu1) intrepid; urgency=low + + * Merge from Debian unstable. Remaining Ubuntu changes (LP: #224581): + - Make --ifref default to name. + - debian/cron.d: /var/log/mrtg disappearing on reboot. + * HTML documentation dropped upstream (LP: #2019). + * Modify Maintainer value to match the DebianMaintainerField + specification. + + -- Iain Lane Sat, 10 May 2008 18:39:08 +0100 + +mrtg (2.16.1-2) unstable; urgency=low + + * "The Purge Begins" release + * No longer remove stuff from /var/www on purge. This was dangerous. + * Install support images to /usr/share/mrtg instead of dumping it in + var/www/mrtg. Administrators should symlink these images to the mrtg's + output directory. + * No longer ship the .pod files as documentation. + * Added l10n format changes from Christian Perrier. + * Galician debconf templates translation thanks to Jacobo Tarrio + (closes: #412643) + + -- Adam Majer Wed, 07 May 2008 01:35:56 -0500 + +mrtg (2.16.1-1) unstable; urgency=low + + * New upstream release (closes: #471550) + * Updated watch file and copyright to reflect new website for mrtg + * Update doc-base section to Network/Monitoring + + -- Adam Majer Wed, 26 Mar 2008 01:35:17 -0500 + mrtg (2.14.7-2ubuntu3) hardy; urgency=low * Don't unconditionally remove /var/www/mrtg when purging. diff -Nru mrtg-2.14.7/debian/compat mrtg-2.16.1/debian/compat --- mrtg-2.14.7/debian/compat 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/compat 2008-05-10 19:05:47.000000000 +0100 @@ -1 +1 @@ -5 +4 diff -Nru mrtg-2.14.7/debian/control mrtg-2.16.1/debian/control --- mrtg-2.14.7/debian/control 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/control 2008-05-10 19:05:47.000000000 +0100 @@ -1,10 +1,10 @@ Source: mrtg Section: net Priority: extra -XSBC-Original-Maintainer: Adam Majer Maintainer: Ubuntu MOTU Developers -Standards-Version: 3.7.2 -Build-Depends: debhelper (>=5.0.37), libgd2-noxpm-dev, libpng-dev|libpng12-dev, zlib1g-dev, debconf-utils, po-debconf +XSBC-Original-Maintainer: Adam Majer +Standards-Version: 3.7.3 +Build-Depends: debhelper (>=4.1.16), libgd2-noxpm-dev, libpng-dev|libpng12-dev, zlib1g-dev, debconf-utils, po-debconf Package: mrtg Architecture: any diff -Nru mrtg-2.14.7/debian/copyright mrtg-2.16.1/debian/copyright --- mrtg-2.14.7/debian/copyright 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/copyright 2008-05-10 19:05:47.000000000 +0100 @@ -1,7 +1,9 @@ This package was originally debianized by Dermot Bradley bradley@debian.org on Sun, 4 May 1997 01:03:58 +0100. -It was downloaded from http://www.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ +MRTG website at: http://oss.oetiker.ch/mrtg/ +It original downloaded site was http://www.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ + Copyright: diff -Nru mrtg-2.14.7/debian/dirs mrtg-2.16.1/debian/dirs --- mrtg-2.14.7/debian/dirs 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/dirs 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -etc/ -etc/cron.d/ -etc/logrotate.d/ -usr/bin -usr/share/perl5/ -usr/share/doc/mrtg/html -usr/share/doc/mrtg/pod -usr/share/man/man1 -var/lib/mrtg/ -var/lock/mrtg/ -var/log/mrtg/ -var/www/mrtg/ diff -Nru mrtg-2.14.7/debian/indexmaker.1 mrtg-2.16.1/debian/indexmaker.1 --- mrtg-2.14.7/debian/indexmaker.1 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/indexmaker.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -.TH INDEXMAKER 1 -.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection -.\" other parms are allowed: see man(7), man(1) -.SH INDEXMAKER -indexmaker \- Create HTML index page with HREFs to MRTG-produced HTML graphs -.SH SYNOPSIS -.B indexmaker -.I "config-file title router-name" -.br -.SH "DESCRIPTION" -This manual page documents briefly the -.BR indexmaker -command. -This manual page was written for the Debian GNU/Linux distribution -because the original program does not have a manual page. -.PP -.B indexmaker -is a program to produced a HTML page containing HREFs that point to other -HTML pages produced by mrtg. -.PP -.I config-file -is the full path to a mrtg configuration file (usually /etc/mrtg.cfg). -.PP -.I title -is the text to use as the title of the HTML page produced. -.PP -.I router-name -is a regex(7) pattern defining the routers to create the index page for. This -pattern is used when parsing the mrtg configuration file. -.SH "SEE ALSO" -cfgmaker(1), mrtg(1), rateup(1). -.SH AUTHOR -This manual page was written by Dermot Bradley , -for the Debian GNU/Linux system (but may be used by others). diff -Nru mrtg-2.14.7/debian/mrtg.dirs mrtg-2.16.1/debian/mrtg.dirs --- mrtg-2.14.7/debian/mrtg.dirs 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/debian/mrtg.dirs 2008-05-10 19:05:47.000000000 +0100 @@ -0,0 +1,10 @@ +etc/ +etc/cron.d/ +etc/logrotate.d/ +usr/bin +usr/share/perl5/ +usr/share/mrtg +usr/share/man/man1 +var/lib/mrtg/ +var/lock/mrtg/ +var/log/mrtg/ diff -Nru mrtg-2.14.7/debian/mrtg.doc-base.configuration mrtg-2.16.1/debian/mrtg.doc-base.configuration --- mrtg-2.14.7/debian/mrtg.doc-base.configuration 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/mrtg.doc-base.configuration 2008-05-10 19:05:47.000000000 +0100 @@ -1,9 +1,9 @@ Document: mrtg-configuration Title: MRTG Configuration -Author: Tobias Oetiker +Author: Tobias Oetiker Abstract: This document provides a detailed description of the MRTG configuration file. -Section: Apps/Net +Section: Network/Monitoring Format: text Files: /usr/share/doc/mrtg/mrtg-reference.txt.gz diff -Nru mrtg-2.14.7/debian/mrtg.docs mrtg-2.16.1/debian/mrtg.docs --- mrtg-2.14.7/debian/mrtg.docs 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/debian/mrtg.docs 2008-05-10 19:05:47.000000000 +0100 @@ -0,0 +1,20 @@ +CHANGES +README +THANKS +doc/cfgmaker.txt +doc/indexmaker.txt +doc/mrtg-contrib.txt +doc/mrtg-faq.txt +doc/mrtg-forum.txt +doc/mrtg-ipv6.txt +doc/mrtglib.txt +doc/mrtg-logfile.txt +doc/mrtg-mibhelp.txt +doc/mrtg-nt-guide.txt +doc/mrtg-nw-guide.txt +doc/mrtg-reference.txt +doc/mrtg-rrd.txt +doc/mrtg-squid.txt +doc/mrtg.txt +doc/mrtg-unix-guide.txt +doc/mrtg-webserver.txt diff -Nru mrtg-2.14.7/debian/mrtg.install mrtg-2.16.1/debian/mrtg.install --- mrtg-2.14.7/debian/mrtg.install 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/debian/mrtg.install 2008-05-10 19:05:47.000000000 +0100 @@ -0,0 +1 @@ +images/*.png usr/share/mrtg diff -Nru mrtg-2.14.7/debian/mrtg.manpages mrtg-2.16.1/debian/mrtg.manpages --- mrtg-2.14.7/debian/mrtg.manpages 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/debian/mrtg.manpages 2008-05-10 19:05:47.000000000 +0100 @@ -0,0 +1,16 @@ +doc/cfgmaker.1 +doc/indexmaker.1 +doc/mrtg.1 +doc/mrtg-contrib.1 +doc/mrtg-faq.1 +doc/mrtg-forum.1 +doc/mrtg-ipv6.1 +doc/mrtglib.1 +doc/mrtg-logfile.1 +doc/mrtg-mibhelp.1 +doc/mrtg-reference.1 +doc/mrtg-rrd.1 +doc/mrtg-squid.1 +doc/mrtg-unix-guide.1 +doc/mrtg-webserver.1 +debian/rateup.1 diff -Nru mrtg-2.14.7/debian/old_temp_pod/cfgmaker.pod mrtg-2.16.1/debian/old_temp_pod/cfgmaker.pod --- mrtg-2.14.7/debian/old_temp_pod/cfgmaker.pod 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/old_temp_pod/cfgmaker.pod 1970-01-01 01:00:00.000000000 +0100 @@ -1,2761 +0,0 @@ -#! /usr/bin/perl -# -*- mode: Perl -*- -################################################################## -# MRTG 2.14.5 -- Config file creator -################################################################## -# Created by Tobias Oetiker -# this produces an mrtg config file for one router or more routers -# by pulling info off the router via snmp -################################################################## -# Distributed under the GNU copyleft -# Copyright 2000 by Tobias Oetiker -################################################################## - -# DEBUG TARGETS -# base - basic program flow -# snpo - SNMP Polling -# snpd - SNMP Detail -#@main::DEBUG=qw(base snpo coca); -@main::DEBUG=qw(); - -require 5.005; -use strict; - -BEGIN { - # Automatic OS detection ... do NOT touch - if ( $^O =~ /^(?:(ms)?(dos|win(32|nt)?))/i ) { - $main::OS = 'NT'; - $main::SL = '\\'; - $main::PS = ';'; - } elsif ( $^O =~ /^NetWare$/i ) { - $main::OS = 'NW'; - $main::SL = '/'; - $main::PS = ';'; - } elsif ( $^O =~ /^VMS$/i ) { - $main::OS = 'VMS'; - $main::SL = '.'; - $main::PS = ':'; - } else { - $main::OS = 'UNIX'; - $main::SL = '/'; - $main::PS = ':'; - } -} - -use FindBin; -use lib "${FindBin::Bin}"; -use lib "${FindBin::Bin}${main::SL}..${main::SL}lib${main::SL}mrtg2"; - -use MRTG_lib "2.100015"; -use Getopt::Long; -use Pod::Usage; -use Socket; - - -sub main { - - my %opt; - my %routers; - my %confcache; - my $ipv4only; - my %v3opt; - $opt{fullcmd} = - "$0 ".(join " ", - map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? "'$_'" : $_ } @ARGV); - $opt{community}="public"; - $opt{interfaces}=1; - options(\%opt,\%routers); - - # Check for IPv6 libraries if IPv6 is enabled. - # If the check fails, IPv6 is disabled. - $ipv4only = 1; - if ($opt{'enable-ipv6'} == 1) { - if ((eval {local $SIG{__DIE__};require Socket6;}) && (eval {local $SIG{__DIE__};require IO::Socket::INET6;})) { - debug ('base',"IPv6 libraries found, IPv6 enabled."); - $ipv4only = 0; - } else { - warn "WARNING: IPv6 libraries not found, IPv6 disabled.\n"; - $opt{'enable-ipv6'} = 0; - } - } - - if ($opt{'use-16bit'} == 1) { - warn "WARNING: Using 16bit RequestIDs\n"; - $SNMP_Session::default_use_16bit_request_ids=1; - } - # Check for SNMP V3 - # - if (lc($opt{enablesnmpv3}) eq "yes") { - if (eval {local $SIG{__DIE__};require Net_SNMP_util;}) { - import Net_SNMP_util; - debug('base', "SNMP V3 libraries found, SNMP V3 enabled."); - $opt{enablesnmpv3} = "yes"; - push @{$opt{global}}, "enablesnmpv3: yes"; - } else { - warn "WARNING: SNMP V3 libraries not found, SNMP V3 disabled. Falling back to V2c.\n"; - require SNMP_util; - import SNMP_util; - $opt{enablesnmpv3} = "revert"; - } - } - else { - require SNMP_util; - import SNMP_util; - $opt{enablesnmpv3} = "no"; - } - - init(); - - foreach my $router - (sort - {($routers{$a}{noofrouter}) <=> ($routers{$b}{noofrouter})} - keys %routers) - { - my @snmpopt = split(/:/,$routers{$router}{'snmp-options'}); - if ($snmpopt[5] == 3) { - if ($opt{enablesnmpv3} eq "revert") { - $snmpopt[5] = 2; - warn "reverting to snmpV2c for router $router\n"; - $routers{$router}{'snmp-options'} = join(":",@snmpopt); - } else { - die "SNMP V3 requires a --username parameter as part of the User Security Model for router $routers{$router}{routerkey}" if $opt{enablesnmpv3} eq "no"; - %v3opt = parsev3(\%opt); - } - } else { - debug('base',"snmpv3 available, but using v1/v2c for $routers{$router}{routerkey}") if $opt{enablesnmpv3} eq "yes"; - } - - - # pod2usage(-verbose=>1,-message=>"ERROR: Could not Parse $router\n") - # unless $router =~ /.*\@.*/; - debug('base',"Get Device Info on $router"); - $routers{$router}{ipv4only} = $ipv4only; - if ( my $devinfo = DeviceInfo($router,\%routers,\%v3opt) ) { - $routers{$router}{deviceinfo} = $devinfo; - } else { - warn "WARNING: Skipping $router as no info could be retrieved\n\n"; - sleep 5; - next; - } - - if ($opt{interfaces}) { - debug('base',"Populating confcache"); - populateconfcache(\%confcache,$router,$routers{$router}{ipv4only},1,\%v3opt); - debug('base',"Get Interface Info"); - InterfaceInfo(\%confcache,\%routers,$router,\%opt,\%v3opt); - } - } - GenConf(\%opt,\%routers,\%confcache,\%v3opt); -} # end main - -main; -exit 0; - -sub InterfaceInfo($$$$$) { - my $confcache = shift; - my $routers = shift; - my $router = shift; - my $opt = shift; - my $v3opt = shift; - my @Variables = qw (ifIndex ifType ifAdminStatus ifOperStatus ifMtu); - - my $snmphost = v4onlyifnecessary($router, $routers->{$router}{ipv4only}); - - 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";}; - } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:hp|juniper|foundry|dellLan|force10|3com|extremenetworks)/) { - push @Variables, "ifAlias"; - } - - my $descr = $routers->{$router}{deviceinfo}{sysDescr}; - if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' && - $descr =~ m/Catalyst\sOperating\sSystem|Cisco\sSystems\sWS-C2900/ ) { - push @Variables, "CiscoCatalystPortName"; - push @Variables, "vmVlan"; - } - - foreach my $var (@Variables) { - debug('base',"Walking $var"); - foreach my $tuple (snmpwalk($snmphost,$v3opt, $var)){ - my($if,$value) = split /:/, $tuple, 2; - $value =~ s/[\0- ]+$//; # no trailing space - $routers->{$router}{$if}{$var} = $value; - debug('snpd'," $router -> $if -> $var = $value"); - } - } - - # interface speed var depends on snmp version - - my $snmp_version = ($router =~ /:/)? (split(':', $router, 6))[5] : 1; - - if ( $snmp_version =~ /[23]/ ) { - debug('base',"Walking ifSpeed"); - my @ifSpeed = snmpwalk($snmphost, $v3opt,'ifSpeed'); - debug('snpd',"\@ifSpeed = @ifSpeed\n"); - debug('base',"Walking ifHighSpeed"); - my @ifHighSpeed = snmpwalk($snmphost,$v3opt, 'ifHighSpeed'); - for ( my $i=0; $i<=$#ifHighSpeed; $i++ ) { - my ($if,$value) = split /:/, $ifSpeed[$i], 2; -# the mib entry on ifSpeed says -# "An estimate of the interface's current bandwidth in bits -# per second. For interfaces which do not vary in bandwidth -# or for those where no accurate estimation can be made, this -# object should contain the nominal bandwidth. If the -# bandwidth of the interface is greater than the maximum value -# reportable by this object then this object should report its -# maximum value (4,294,967,295) and ifHighSpeed must be used -# to report the interace's speed. For a sub-layer which has -# no concept of bandwidth, this object should be zero." - if ( (not defined $value) || ($value == 2**32-1)) { - ($if, $value) = split /:/, $ifHighSpeed[$i], 2; - $value = $value * 1000000; # highSpeed = contador * 10^6 - #debug('base',"Speed: $if - $value"); - } - $routers->{$router}{$if}{'ifSpeed'} = $value; - } - } else { - debug('base',"Walking ifSpeed"); - foreach my $tuple (snmpwalk($snmphost,$v3opt, 'ifSpeed')){ - my($if,$value) = split /:/, $tuple, 2; - $routers->{$router}{$if}{'ifSpeed'} = $value; - debug('snpd'," $router -> $if -> ifSpeed = $value"); - } - } - - # magic speed determination for portmaster IFs - - if ($routers->{$router}{deviceinfo}{Vendor} eq 'portmaster') { - # We can only approximate speeds - # - # so we think that ppp can do 76800 bit/s, and slip 38400. - # (actualy, slip is a bit faster, but usualy users with newer modems - # use ppp). Alternatively, you can set async speed to 115200 or - # 230400 (the maximum speed supported by portmaster). - # - # But if the interface is ptpW (sync), max speed is 128000 - # change it to your needs. On various Portmasters there are - # various numbers of sync interfaces, so modify it. - # - # The most commonly used PM-2ER has only one sync. - # - # Paul Makeev (mac@redline.ru) - # - foreach my $if (keys %{$routers->{$router}}) { - next unless $if =~ /^\d+$/; - my $ift = $routers->{$router}{$if}{ifType}; - my $ifd = $routers->{$router}{$if}{Descr}; - if ($ift == 23) { - if ($ifd eq 'ptpW1') { - $routers->{$router}{$if}{ifSpeed} = 128000; - } else { - $routers->{$router}{$if}{ifSpeed} = 76800; - } - } elsif ($ift == 28) { - $routers->{$router}{$if}{ifSpeed} = 38400; - } elsif ($ift == 6) { - $routers->{$router}{$if}{ifSpeed} = 10000000; - } - } - } - - # match confcache info into tree - my $cachekey = cleanhostkey $router; - - foreach my $method (keys %{$$confcache{$cachekey}}) { - foreach my $key (keys %{$$confcache{$cachekey}{$method}}) { - my $if = readfromcache($confcache,$router,$method,$key); - next unless $if =~ /^\d+$/; - $routers->{$router}{$if}{$method} = $key; - for ($method) { - #fix special chars in ifdescr - # no need for this we fix if references later on - # /^Descr|Name$/ && do { - # $routers->{$router}{$if}{"R$method"} = $routers->{$router}{$if}{$method}; - # $routers->{$router}{$if}{$method} =~ s/(:)/\\$1/g; - # next; - # }; - - #find hostname of IF - !$$opt{noreversedns} && /^Ip$/ and do { - my $name = - gethostbyaddr( - pack('C4', - split(/\./, - $routers->{$router}{$if}{$method})), - AF_INET); - $routers->{$router}{$if}{DNSName} = ($name or ""); - next; - }; - } - } - } -} # end InterfaceInfo - -sub GenConf ($$$$) { - my $opt = shift; - my $routers = shift; - my $confcache = shift; - my $v3opt = shift; - my $conf = "# Created by \n# $$opt{fullcmd}\n\n"; - - # print global options - $conf .= < ($$routers{$b}{noofrouter})} - keys %$routers ) { - my $router_ref = $$routers{$router}; - my $router_opt = $$router_ref{opt}; - my $router_dev = $$router_ref{deviceinfo}; - - # Did any global options appear on the command line - # before this router? If so, include them into the - # configuration file. - if (defined $$router_opt{global}) { - foreach my $key (@{$$router_opt{global}}) { - $conf .= "$key\n"; - } - } - - # If IPv6 is enabled, add IPv4Only target directive for targets - # that do not support SNMP over IPv6. - my $ipv4only_directive; - my $router_ipv4only = ($$opt{'enable-ipv6'} == 1) && $$router_ref{ipv4only}; - - my $syscontact = $$router_dev{sysContact}; - my $html_syscontact = html_escape($syscontact); - my $syslocation = $$router_dev{sysLocation}; - my $html_syslocation = html_escape($syslocation); - my $sysname = $$router_dev{sysName}; - my $sysdescr = $$router_dev{sysDescr}; - my $comment_sysdescr = $sysdescr; - # make sure embeded newlines do not harm us here - $comment_sysdescr =~ s/[\n\r]+/\n\# /g; - my $community = $$router_ref{community}; - $community =~ s/([@ ])/\\$1/g; - my $router_connect = "$community\@$$router_ref{routername}$$router_ref{snmpopt_current}"; - my @v3options; - foreach my $v3op (keys %$v3opt) { - push @v3options, $v3op."=>'".$$v3opt{$v3op}."'"; - } - my $v3options = join(",",@v3options) if $$router_ref{'snmp-options'} =~ /(?=:.*?){4}:3/ ; - my $html_sysdescr = html_escape($sysdescr); - my $router_name = - ($$router_ref{routername} - . (($$router_ref{'dns-domain'})?'.':'') - . $$router_ref{'dns-domain'}); - - # James Overbeck 2001/09/20 - # Moved $directory_name definition from within the interface - # foreach loop to here. In its previous location, $directory_name - # was not accessible to host templates. $directory_name is not - # changed per-interface so it might as well be here instead of - # where it was. - - my $directory_name = ""; - - if (defined $$router_opt{subdirs}) { - $directory_name = $$router_opt{subdirs}; - $directory_name =~ s/HOSTNAME/$router_name/g; - $directory_name =~ s/SNMPNAME/$$router_dev{sysName}/g; - } - - - my $target_lines = ""; - my $problem_lines = ""; - my $head_lines = " -###################################################################### -# System: $sysname -# Description: $comment_sysdescr -# Contact: $syscontact -# Location: $syslocation -###################################################################### -"; - - my $separator_lines = "\n\n"; - - # Host specific config lines generation code starts HERE - - if(defined $$router_opt{'host-template'}) { - # First test if the file exists and is readable, die if not. - die "File $$router_opt{'host-template'} didn't exist.\n" - unless (-e $$router_opt{'host-template'} - and -r $$router_opt{'host-template'}); - # Open the file (or die). - open IF_TEMPLATE, $$router_opt{'host-template'} - or die "File $$router_opt{'host-template'} couldn't be opened.\n"; - - my @template_lines = readline *IF_TEMPLATE; - $@ = undef; - eval ('local $SIG{__DIE__};'.join("", @template_lines)); - - die "ERROR Evaluation of the contents in the file \n\n". - "$$router_opt{'host-template'}\ngave the error \n\n\"$@\"\n\nExiting cfgmaker\n" if $@; - } - - $conf .= ($head_lines - . $problem_lines - . $target_lines - . $separator_lines); - - # Host specific config lines generation code ends HERE - - - if ($$router_opt{'interfaces'}) { - foreach my $ifindex (sort {int($a) <=> int($b)} keys %$router_ref) { - next unless $ifindex =~ /^\d+$/; - my $i = $$router_ref{$ifindex}; - - # Now define a number of variables used for this interface. - # Some variables are just used internally by cfgmaker to - # process the interface, others are provided for usage in - # host and interface templates and for interface filters. - - my $if_index = $ifindex; - my $if_eth = $$i{Eth}; - - # does it make sense to look at the interface ? - my @prob; - my $default_ifstate = 1; # State assumed up. - my $default_iftype = 1; # iftype assumed ok. - my $if_ok = 1; # - - my $if_admin = ($$i{ifAdminStatus} == 1); - my $if_oper = ($$i{ifOperStatus} == 1); - - my $if_type = $$i{ifType}; - my $if_is_ethernet = 0 < scalar(grep {$_ == $if_type;} - (6,7,26,62,69,117)); - my $if_is_isdn = (0 < scalar (grep {$_ == $if_type;} - (20,21,63,75,76,77))); - my $if_is_dialup = $if_is_isdn || - (0 < scalar (grep {$_ == $if_type;} - (23,81,82,108))); - my $if_is_atm = (0 < scalar(grep {$_ == $if_type;} - (37,49,107,105,106,114,134))); - - my $if_is_wan = 0 < scalar(grep {$_ == $if_type;} - (22,30,32,39,44,46)); - - my $if_is_lan = $if_is_ethernet || - (0 < scalar (grep {$_ == $if_type;} - (8,9,11,15,26,55,59,60,115))); - my $if_is_dsl = (0 < scalar(grep {$_ == $if_type;} - (94,95,96,97))); - my $if_is_loopback = $if_type == 24; - my $if_is_ciscovlan = - ($$router_dev{Vendor} eq 'cisco' - and $$i{Descr} =~ /^(unrouted )?V(LAN|lan)\d+$/); - - my $if_ip = $$i{Ip}; - my $if_snmp_descr = $$i{Descr}; - $if_snmp_descr =~ s/\n$//; # no you don't want to know who does this - # ok ... dell 3524 - $if_snmp_descr =~ s/ /-/g; - my $if_type_num = $$i{ifType}; - my $if_snmp_name = $$i{Name}; - my $if_snmp_alias = $$i{ifAlias}; - my $if_cisco_descr = $$i{CiscolocIfDescr}; - my $if_dns_name = $$i{DNSName}; - my $if_vlan_id = $$i{vmVlan}; - my $if_MTU = $$i{ifMtu}; - - # For Nokia IPSO, find non-ethernet interfaces with IP addresses - # and add missing MAC address and Port Speed information to - # to the LOGICAL and LOGICAL+VLAN interfaces. - if ( $$router_dev{Vendor} eq 'nokiaipsofw' ) { - if ($$i{ifType} ne "6" && - $$router_dev{sysDescr} =~ / IPSO / && - $$i{Ip} =~ /^\d+/ && - ($$i{Eth} == undef || - $$i{ifSpeed} < 10 || - $$i{ifSpeed} == undef ) - ) { - my $logical_if_name = $$i{Name}; - - # Split the LOGICAL interface name in attempt - # to match with base PHYSICAL interface detail. - my ($logical_if_HEAD, $logical_if_TAIL) = - $logical_if_name =~ /^(.*)(c\d+)$/; - - foreach my $ifindexTMP (sort {int($a) <=> int($b)} - keys %$router_ref) { - next unless $ifindexTMP =~ /^\d+$/; - - my $physical_if_name = $$router_ref{$ifindexTMP}; - - if ($$physical_if_name{ifType} == 6 && - $logical_if_HEAD eq $$physical_if_name{Name} ) { - $$i{Eth} = $$physical_if_name{Eth} - if ( $$i{Eth} == undef ); - $$i{ifSpeed} = $$physical_if_name{ifSpeed} - if ( $$i{ifSpeed} == undef || $$i{ifSpeed} < 10 ); - } - } - } - } - - # First investigate the state of the interface. - if (not defined $$router_opt{'no-down'}) { - if ($$i{ifAdminStatus} == 2) { - push @prob, "it is administratively DOWN"; - $default_ifstate = 0; - } elsif ($$i{ifAdminStatus} == 3) { - push @prob, "it is in administrative TEST mode"; - $default_ifstate = 0; - } - - if (not defined $$router_opt{'show-op-down'}) { - if ($$i{ifOperStatus} == 2) { - push @prob, "it is operationally DOWN"; - $default_ifstate = 0; - } elsif ($$i{ifOperStatus} == 3) { - push @prob, "it is in operational TEST mode"; - $default_ifstate = 0; - } - } - } - - - # Investigate the type of the interface. - if ($$router_dev{Vendor} eq 'cisco' && $$i{ifType} == 18) { # by fwo@obsidian.co.za - push @prob, "it is a DS1 controllers"; - $default_iftype = 0; - } elsif ($$router_dev{Vendor} eq 'cisco' && $$i{ifType} == 19) { # by fwo@obsidian.co.za - push @prob, "it is a E1 controllers"; - $default_iftype = 0; - } elsif ($$i{ifType} == 24) { - push @prob, "it is a Software Loopback interface" ; - $default_iftype = 0; - } elsif ($$router_dev{Vendor} eq 'cisco' && $$i{ifType} == 30) { # by blube@floridadigital.net - push @prob, "it is a DS3 controller"; - $default_iftype = 0; - } elsif ($$router_dev{Vendor} eq 'cisco' && $$i{ifType} == 102) { # by dan.mcdonald@austinenergy.com - push @prob, "it is a Voice controller"; - $default_iftype = 0; - } elsif ($$router_dev{Vendor} eq 'cisco' && $$i{ifType} == 103) { # by dan.mcdonald@austinenergy.com - push @prob, "it is a Voice dial peer"; - $default_iftype = 0; - } elsif ($$i{ifType} == 162) { - push @prob, "it is a CEF Sub-interface"; # John Begley - } elsif ($$router_dev{Vendor} eq 'cisco' - and $$i{Descr} eq 'Null0') { - push @prob, "it is a cisco Null0 interface"; - $default_iftype = 0; - } - my $default = $default_iftype && $default_ifstate; - - # Do some futher investigation if the interface makes - # sense to collect on - - # I debated whether to insert the zero-speed check before - # or after the "will always be zero" sections below. - # I settled on before since I'll assume the user knows - # what speed the zero-speed interfaces should be better - # than the simple logic below. - if ($$i{ifSpeed} == 0 && $$router_opt{'zero-speed'}) { - # Set all interfaces with zero speed to the value specified - # by the --zero-speed= command line option. - - # Be sure the value specified is a valid integer. - # It seems like this could be done once when - # $$router_opt is set, but I didn't see any example - # of input validation in that part of cfgmaker, - # so it gets done here, more times than are - # really necessary. ;-) - unless ($$router_opt{'zero-speed'} =~ /^\d+$/) { - die "ERROR: zero-speed specified with non-integer speed: $$router_opt{'zero-speed'}"; - } - $$i{ifSpeed} = $$router_opt{'zero-speed'}; - } - - if ($$i{ifSpeed} == 0 && $$router_dev{Vendor} eq 'foundry' && $$i{ifType} == 194) { - # foundry ATM subinterfaces always report 0 speed, make it 155Mbps instead. - $$i{ifSpeed} = 155000000; - } elsif ($$i{ifSpeed} == 0 && $$router_dev{Vendor} eq 'foundry' && $$i{ifType} == 135) { - # Foundry virtual Ethernet interfaces always report 0 speed, make it 100Mbps instead. - $$i{ifSpeed} = 12500000; - } elsif ($$i{ifSpeed} == 0 && $$router_dev{Vendor} eq 'cisco' && $$i{sysDescr} == /FWSM-Firewall / ) { - # Cisco PIX Firewall Switch Modules have effective backplane speed of 600 Megs - $$i{ifSpeed} = 600000000; - } elsif ($$i{ifSpeed} == 0 && $$router_dev{Vendor} eq '3com' && $$i{Descr} =~ /RMON VLAN (\d+)/ ) { - $$i{ifSpeed} = 100000000; - $if_vlan_id = $1; - } elsif ($$i{ifSpeed} == 0) { - push @prob, "has a speed of $$i{ifSpeed} which makes no sense"; - $if_ok = 0; - } - - my $message; - if ($message = IsCounterBroken($ifindex, $router_ref,$v3opt)) { - # set snmpopt_current to working snmp options - push @prob, "got '$message' from interface when trying to query"; - $if_ok = 0; - } - - my $community = $$router_ref{community}; - $community =~ s/([@ ])/\\$1/g; - my $router_connect = "$community\@$$router_ref{routername}$$router_ref{snmpopt_current}"; - - my $v3options = join(",",@v3options) if $$router_ref{snmpopt_current} =~ /(?=:.*?){4}:3/ ; - - # determine interface reference - my $if_ref; - if (defined $$router_opt{ifref}) { - for ($$router_opt{ifref}) { - /^ip$/ && do { $if_ref = "/".$$i{Ip} if $$i{Ip} ; last}; - /^eth$/ && do { $if_ref = "!".$$i{Eth} if $$i{Eth}; last}; - /^descr$/ && do {$if_ref = "\\".$$i{Descr} if $$i{Descr}; last}; - /^name$/ && do {$if_ref = "#".$$i{Name} if $$i{Name}; last}; - /^type$/ && do {$if_ref = "%".$$i{Type} if $$i{Type}; last}; - /^nr$/ && do {$if_ref = $ifindex; last}; - die "ERROR: Invalid value for --ifref: '$$router_opt{ifref}'\n"; - } - if (not defined $if_ref) { - push @prob, "--ifref=$$router_opt{ifref} is not unique for this interface"; - $if_ref = $ifindex; - $if_ok = 0; - } - } else { - $if_ref = $ifindex; - } - - # generate Target name - my $trim_if_ref = $if_ref; - $trim_if_ref =~ s/[\#!\/\\:\s\@%]+/_/g; - $trim_if_ref =~ s/^_*(.+?)_*$/$1/; - my $target_name = "${router_name}_$trim_if_ref"; - my $if_title_desc = $if_ref; - $if_title_desc =~ s/^[^\d]//; - my $if_speed = int($$i{ifSpeed} / 8); - my $if_speed_str = fmi($if_speed,$$router_ref{flags}); - my $if_type_desc = IfType($$i{ifType}); - my $html_if_type_desc = html_escape($if_type_desc); - my $desc_prefix = 'Traffic Analysis for '; - - my $port_dot = $$i{Name}; - $port_dot =~ s/\//./g; - my $if_port_name = $$router_ref{$port_dot}{CiscoCatalystPortName}; - - if (defined $$router_opt{ifdesc}) { - $desc_prefix = ''; - for ($$router_opt{ifdesc}) { - /^ip$/ && do { $if_title_desc = $$i{Ip} if $$i{Ip} ; last}; - /^eth$/ && do { $if_title_desc = $$i{Eth} if $$i{Eth}; last}; - /^descr$/ && do {$if_title_desc = $$i{Descr} if $$i{Descr}; last}; - /^alias$/ && do {$if_title_desc = - "$$i{Descr} $$i{ifAlias} $$i{CiscolocIfDescr}"; - last}; - /^name$/ && do {$if_title_desc = "#".$$i{Name} if $$i{Name}; last}; - /^catname$/ && do {$if_title_desc = "$if_port_name"; last}; - /^type$/ && do {$if_title_desc = "%".$$i{Type} if $$i{Type}; last}; - /^nr$/ && do {$if_title_desc = "Interface $ifindex"; last}; - /^$/ && do {$if_title_desc = $if_type_desc; - $if_title_desc =~ s/^$/$$i{Descr}/; - last}; - die "ERROR: Invalid value for --ifdesc: '$$router_opt{ifdesc}'\n"; - } - } - - # Now setup a large number of variables needed for the - # generation of the configuration lines. - - $if_title_desc =~ s/\\([:@\\\/\# ])/$1/g; # unescape - $if_title_desc = $if_snmp_name if not $if_title_desc; - my $html_if_title_desc = html_escape($if_title_desc); - my $html_desc_prefix = html_escape($desc_prefix); - - my $html_if_snmp_descr = html_escape($if_snmp_descr); - my $html_if_snmp_name = html_escape($if_snmp_name); - my $html_if_snmp_alias = html_escape($if_snmp_alias); - my $html_if_cisco_descr = html_escape($if_cisco_descr); - my $if_description = "$if_snmp_descr $if_snmp_alias $if_cisco_descr"; - my $html_if_description = html_escape($if_description); - my $if_title = "$desc_prefix$if_title_desc -- $sysname"; - my $html_if_title = html_escape($if_title); - - my $head_lines = "### Interface $ifindex >> Descr: '$if_snmp_descr' |". - " Name: '$if_snmp_name' | Ip: '$if_ip' | Eth: '$$i{Eth}' ###\n"; - - my $target_lines = ""; - my $separator_lines = "\n\n"; - - # escape the if reference - $if_ref =~ s/([& :])/\\$1/g; - my $default_target_directive = "Target[$target_name]: $if_ref:$router_connect"; - $default_target_directive .= "\nSnmpOptions[$target_name]: $v3options" if $$router_ref{snmpopt_current} =~ /(?=:.*?){4}:3/ ; - my $if_snmp_descr_save = $if_snmp_descr; - $if_snmp_descr_save =~ s/"/'/g; - my $default_setenv_directive = "SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_snmp_descr_save\""; - my $default_directory_directive = ($directory_name ? "Directory[$target_name]: $directory_name" : ""); - my $default_maxbytes_directive = "MaxBytes[$target_name]: $if_speed"; - - $ipv4only_directive = $router_ipv4only ? "IPv4Only[$target_name]: yes" : ""; - - my $default_title_directive = "Title[$target_name]: $html_desc_prefix$html_if_title_desc -- $sysname"; - my $default_pagetop_directive = - "PageTop[$target_name]:

$html_desc_prefix$html_if_title_desc -- $sysname

-
- - - - - - - - - - - - - - - - - - - - - "; - $default_pagetop_directive .= " - - - - " if defined $if_port_name; - $default_pagetop_directive .= " - - - - "; - $default_pagetop_directive .= " - - - - " if $if_ip; - $default_pagetop_directive .= " -
System:$sysname in $html_syslocation
Maintainer:$html_syscontact
Description:$html_if_description
ifType:$html_if_type_desc ($if_type_num)
ifName:$html_if_snmp_name
Port Name:$if_port_name
Max Speed:$if_speed_str
Ip:$if_ip ($if_dns_name)
-
"; - - my $default_target_lines = - ("\n" - . $default_target_directive . "\n" - . $default_setenv_directive . "\n" - . ($default_directory_directive - ? ($default_directory_directive . "\n") - : "") - . $default_maxbytes_directive . "\n" - . ($ipv4only_directive - ? ($ipv4only_directive . "\n") - : "") - . $default_title_directive . "\n" - . $default_pagetop_directive . "\n"); - - - # If --if-filter is provided, evalutat that. If it - # returns true, clear @prob. If it returns false, - # instead add a complaint to @prob. - - if (defined $$router_opt{'if-filter'}) { - $@ = undef; - if (eval('local $SIG{__DIE__};'.$$router_opt{'if-filter'})) { - @prob = (); - } else { - push @prob, "filter specified by --if-filter rejected the interface"; - $if_ok = 0; - } - die "ERROR: with if-filter $$router_opt{'if-filter'}: $@" if $@; - } - - - # issue problem report - - my $problem_lines = ""; - - if (@prob) { - $problem_lines .= "### The following interface is commented out because:\n"; - map {$problem_lines .= "### * $_\n"} @prob; - $if_ok = 0; - } - - # The target config generation code starts HERE. - - - if (defined $$router_opt{'if-template'}) { - # First test if the file exists and is readable, - # die if not. - die "File $$router_opt{'if-template'} didn't exist.\n" unless (-e $$router_opt{'if-template'} - and -r $$router_opt{'if-template'}); - # Open the file (or die). - open IF_TEMPLATE, $$router_opt{'if-template'} - or die "File $$router_opt{'if-template'} couldn't be opened.\n"; - my @template_lines = readline *IF_TEMPLATE; - - $@ = undef; - eval ('local $SIG{__DIE__};'.join( "", @template_lines)); - die "Evaluation of the contents in the file \n\n$$router_opt{'if-template'}\n". - "gave the error \n\n\"$@\"\n\nExiting cfgmaker\n" if $@; - } else { - $target_lines = $default_target_lines; - } - - - if ($target_lines && not $if_ok) { # comment out the target lines if needed - $target_lines =~ s/^/\# /gm; - } - - $conf .= ($head_lines - . $problem_lines - . $target_lines - . $separator_lines); - - } - # Target generation code ends HERE. - } - } - - # print any global options which might have - # appeared on the command line after the last - # router. - if (defined $$opt{global}) { - foreach my $key (@{$$opt{global}}) { - $conf .= "$key\n"; - } - } - - if ($$opt{output}) { - debug ('base', "Writing $$opt{output}"); - open X, ">$$opt{output}" or die "ERROR: creating $$opt{output}: $!\n"; - print X $conf; - close X; - } else { - print $conf; - } -} # end GenConf - -sub IsCounterBroken ($$$) { - my $if = shift; - my $router_ref = shift; - my $v3opt = shift; - my $router = $$router_ref{routerkey}; - my $old_state = $SNMP_Session::suppress_warnings; - $$router_ref{snmpopt_current} = $$router_ref{'snmp-options'}; - $SNMP_Session::suppress_warnings = 3; - - my $ipv4only = $$router_ref{ipv4only}; - my $snmphost = v4onlyifnecessary($router, $ipv4only); - - if ($router =~ /:\d*:\d*:\d*:\d*:[23]$/) { - # anybody knows why /:(\d*:){4}2$/ does not work ? - my $speed = (snmpget($snmphost, $v3opt, 'ifHighSpeed.'.$if))[0]; - debug('base',"snmpget $snmphost for ifHighSpeed.$if -> $speed Mb/s"); - $SNMP_Session::errmsg = undef; - my $counter = (snmpget($snmphost,$v3opt, 'ifHCInOctets.'.$if))[0]; - debug('base',"snmpget $snmphost for ifHCInOctets.$if -> $counter"); - if(not $speed or $counter eq "" or $SNMP_Session::errmsg){ - $SNMP_Session::errmsg = undef; - $$router_ref{snmpopt_current} =~ s/:+[23]$//; - debug('base',"check for HighspeedCounters failed ... Dropping back to V1"); - } else { - $SNMP_Session::suppress_warnings = $old_state; - return 0; - } - } - $router = "$$router_ref{community}\@$$router_ref{routername}$$router_ref{'snmp-options'}"; - $snmphost = v4onlyifnecessary($router, $ipv4only); - if ( $$router_ref{snmpopt_current} !~ /:[23]/) { - snmpget($snmphost, 'ifInOctets.'.$if); - if (defined $SNMP_Session::errmsg) { - my $error = $SNMP_Session::errmsg; - $SNMP_Session::errmsg = undef; - $error =~ s/\n/\n### /g; - $SNMP_Session::suppress_warnings = $old_state; - return $error; - } - } - $SNMP_Session::suppress_warnings = $old_state; - return 0; -} # end IsCounterBroken - -# DeviceInfo does fallback between IPv6 and IPv4: if an IPv6 snmpwalk returns -# undef values (= an error) and the target is a hostname, then it repeats the -# query using IPv4 in case the target does not support SNMP over IPv6. -# If DeviceInfo falls back to IPv4, it sets the ipv4only field for the target -# in the routers hash. -sub DeviceInfo ($$$) { - my $router=shift; - my $routers=shift; - my $v3opt=shift; - my @variables = qw(sysDescr sysContact - sysName sysLocation - sysObjectID); - my %DevInfo; - my $ipv4only = $$routers{$router}{ipv4only}; - - my @variables = snmpwalk(v4onlyifnecessary($router, $ipv4only),$v3opt,'1.3.6.1.2.1.1'); # walk system - if (!(defined $variables[0])) { - # Do we need to fall back to IPv4? - my ($commmunity, $host) = ($1, $2) if ($router =~ /^(.*)@([^@]+)$/); - if ( ( ! $ipv4only ) && ( $host !=~ /^\[(.*)\]/) ) { - # Not using IPv4, not an IPv6 address, so a hostname - debug ('base',"No response using IPv6 for $router, trying again using IPv4"); - $$routers{$router}{ipv4only} = 1; - @variables = snmpwalk(v4onlyifnecessary($router, 1),$v3opt, '1.3.6.1.2.1.1'); - } - } - - if ( defined $variables[0] ) { - my (%DevInfo, %revOIDS); - - if ($$routers{$router}{enablesnmpv3} eq "yes") { - %revOIDS = reverse %Net_SNMP_util::OIDS; - } - else { - %revOIDS = reverse %SNMP_util::OIDS; - } - foreach my $variable ( @variables ) { - my ($oid, $value) = split ( ':', $variable, 2); - $DevInfo{ $revOIDS{'1.3.6.1.2.1.1.'.$oid} } = $value; - } - # 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' - ); - foreach (keys %vendorIDs) { - $DevInfo{Vendor} = $vendorIDs{$_} if ($DevInfo{sysObjectID} =~ /\Q$_\E/); - } - debug('base',"Vendor Id: $DevInfo{Vendor}"); - return \%DevInfo; - } else { - # we just die because the snmp module has already complained - return undef; - } -} # end DeviceInfo - - -sub fmi ($$) { - my $number = shift; - my $flags = shift; - my(@short); - if ($$flags{bits} eq "set"){ - $number*=8; - @short = ("bits/s","kbits/s","Mbits/s","Gbits/s"); - } else { - @short = ("Bytes/s","kBytes/s","MBytes/s","GBytes/s"); - } - my $digits=length("".$number); - my $divm=0; - while ($digits-$divm*3 > 4) { $divm++; } - my $divnum = $number/10**($divm*3); - return sprintf("%1.1f %s",$divnum,$short[$divm]); -} # end fmi - - -sub IfType ($) { - return {'1'=>'Other', - '2'=>'regular1822', - '3'=>'hdh1822', - '4'=>'ddnX25', - '5'=>'rfc877x25', - '6'=>'ethernetCsmacd', - '7'=>'iso88023Csmacd', - '8'=>'iso88024TokenBus', - '9'=>'iso88025TokenRing', - '10'=>'iso88026Man', - '11'=>'starLan', - '12'=>'proteon10Mbit', - '13'=>'proteon80Mbit', - '14'=>'hyperchannel', - '15'=>'fddi', - '16'=>'lapb', - '17'=>'sdlc', - '18'=>'ds1', - '19'=>'e1', - '20'=>'basicISDN', - '21'=>'primaryISDN', - '22'=>'propPointToPointSerial', - '23'=>'ppp', - '24'=>'softwareLoopback', - '25'=>'eon', - '26'=>'ethernet-3Mbit', - '27'=>'nsip', - '28'=>'slip', - '29'=>'ultra', - '30'=>'ds3', - '31'=>'sip', - '32'=>'frame-relay', - '33'=>'rs232', - '34'=>'para', - '35'=>'arcnet', - '36'=>'arcnetPlus', - '37'=>'atm', - '38'=>'miox25', - '39'=>'sonet', - '40'=>'x25ple', - '41'=>'iso88022llc', - '42'=>'localTalk', - '43'=>'smdsDxi', - '44'=>'frameRelayService', - '45'=>'v35', - '46'=>'hssi', - '47'=>'hippi', - '48'=>'modem', - '49'=>'aal5', - '50'=>'sonetPath', - '51'=>'sonetVT', - '52'=>'smdsIcip', - '53'=>'propVirtual', - '54'=>'propMultiplexor', - '55'=>'100BaseVG', - '56'=>'Fibre Channel', - '57'=>'HIPPI Interface', - '58'=>'Obsolete for FrameRelay', - '59'=>'ATM Emulation of 802.3 LAN', - '60'=>'ATM Emulation of 802.5 LAN', - '61'=>'ATM Emulation of a Circuit', - '62'=>'FastEthernet (100BaseT)', - '63'=>'ISDN & X.25', - '64'=>'CCITT V.11/X.21', - '65'=>'CCITT V.36', - '66'=>'CCITT G703 at 64Kbps', - '67'=>'Obsolete G702 see DS1-MIB', - '68'=>'SNA QLLC', - '69'=>'Full Duplex Fast Ethernet (100BaseFX)', - '70'=>'Channel', - '71'=>'Radio Spread Spectrum (802.11)', - '72'=>'IBM System 360/370 OEMI Channel', - '73'=>'IBM Enterprise Systems Connection', - '74'=>'Data Link Switching', - '75'=>'ISDN S/T Interface', - '76'=>'ISDN U Interface', - '77'=>'Link Access Protocol D (LAPD)', - '78'=>'IP Switching Opjects', - '79'=>'Remote Source Route Bridging', - '80'=>'ATM Logical Port', - '81'=>'AT&T DS0 Point (64 Kbps)', - '82'=>'AT&T Group of DS0 on a single DS1', - '83'=>'BiSync Protocol (BSC)', - '84'=>'Asynchronous Protocol', - '85'=>'Combat Net Radio', - '86'=>'ISO 802.5r DTR', - '87'=>'Ext Pos Loc Report Sys', - '88'=>'Apple Talk Remote Access Protocol', - '89'=>'Proprietary Connectionless Protocol', - '90'=>'CCITT-ITU X.29 PAD Protocol', - '91'=>'CCITT-ITU X.3 PAD Facility', - '92'=>'MultiProtocol Connection over Frame/Relay', - '93'=>'CCITT-ITU X213', - '94'=>'Asymetric Digitial Subscriber Loop (ADSL)', - '95'=>'Rate-Adapt Digital Subscriber Loop (RDSL)', - '96'=>'Symetric Digitial Subscriber Loop (SDSL)', - '97'=>'Very High Speed Digitial Subscriber Loop (HDSL)', - '98'=>'ISO 802.5 CRFP', - '99'=>'Myricom Myrinet', - '100'=>'Voice recEive and transMit (voiceEM)', - '101'=>'Voice Foreign eXchange Office (voiceFXO)', - '102'=>'Voice Foreign eXchange Station (voiceFXS)', - '103'=>'Voice Encapulation', - '104'=>'Voice Over IP Encapulation', - '105'=>'ATM DXI', - '106'=>'ATM FUNI', - '107'=>'ATM IMA', - '108'=>'PPP Multilink Bundle', - '109'=>'IBM IP over CDLC', - '110'=>'IBM Common Link Access to Workstation', - '111'=>'IBM Stack to Stack', - '112'=>'IBM Virtual IP Address (VIPA)', - '113'=>'IBM Multi-Protocol Channel Support', - '114'=>'IBM IP over ATM', - '115'=>'ISO 802.5j Fiber Token Ring', - '116'=>'IBM Twinaxial Data Link Control (TDLC)', - '117'=>'Gigabit Ethernet', - '118'=>'Higher Data Link Control (HDLC)', - '119'=>'Link Access Protocol F (LAPF)', - '120'=>'CCITT V.37', - '121'=>'CCITT X.25 Multi-Link Protocol', - '122'=>'CCITT X.25 Hunt Group', - '123'=>'Transp HDLC', - '124'=>'Interleave Channel', - '125'=>'Fast Channel', - '126'=>'IP (for APPN HPR in IP Networks)', - '127'=>'CATV MAC Layer', - '128'=>'CATV Downstream Interface', - '129'=>'CATV Upstream Interface', - '130'=>'Avalon Parallel Processor', - '131'=>'Encapsulation Interface', - '132'=>'Coffee Pot', - '133'=>'Circuit Emulation Service', - '134'=>'ATM Sub Interface', - '135'=>'Layer 2 Virtual LAN using 802.1Q', - '136'=>'Layer 3 Virtual LAN using IP', - '137'=>'Layer 3 Virtual LAN using IPX', - '138'=>'IP Over Power Lines', - '139'=>'Multi-Media Mail over IP', - '140'=>'Dynamic synchronous Transfer Mode (DTM)', - '141'=>'Data Communications Network', - '142'=>'IP Forwarding Interface', - '162'=>'Cisco Express Forwarding Interface', - - }->{(shift)}; -} # end IfType - - - - - -sub options ($$) { - my $opt = shift; - my $routers = shift; - - my $noofrouter = 0; # How many routers we've seen on cmdline. - - # The $flags hash stores what we've seen in Options[_], - # Options[^] and Options[$] so far. - # A cmdline arg like --global 'Options[_]: bits' will insert - # the element $$flags{default}{bits}="set". - # Similarly --global 'Options[$]:' will delete all elements - # in $$flags{append} - # - # This was originally created to manipulate the "bits" flag - # so fmi should know when to use "bits" or "bytes". It might - # be overkill to use such a comples solution but it makes life - # easier if cfgmaker in the future has to be extended to be - # aware of other Options[] settings like gauge, growright etc. - - my %flags; - { - my $def = {}; - my $pre = {}; - my $app = {}; - %flags = (default => $def, - prepend => $pre, - append => $app); - } - - my $addrouter_ornf = addrouter($opt, - $routers, - \$noofrouter, - \%flags); - - Getopt::Long::Configure("permute"); - GetOptions( $opt, - 'help|?', - 'man', - 'subdirs=s', - 'no-down', - 'show-op-down', - 'noreversedns', - 'ifref=s', - 'ifdesc=s', - 'if-filter=s', - 'if-template=s', - 'interfaces!', - 'host-template=s', - 'community=s', - 'username=s', - 'authkey=s', - 'authpassword=s', - 'authprotocol=s', - 'contextengineid=s', - 'contextname=s', - 'privkey=s', - 'privpassword=s', - 'privprotocol=s', - 'snmp-options=s', - 'dns-domain=s', - 'version', - 'output=s', - 'global=s@', - 'enable-ipv6', - 'enable-snmpv3', - 'use-16bit', - 'zero-speed=s', - '<>', $addrouter_ornf) or pod2usage(2); - - die("cfgmaker for mrtg-2.14.5\n") if $$opt{version}; - pod2usage(-exitval => 0, -verbose => 2) if $$opt{man}; - pod2usage(-verbose => 1) if not keys %$routers; -} # end options - -# The callback routine used by GetOptions to process "non-option -# strings" (routers) among the arguments is given only ONE argument. -# However, I want it to be able to specify both the %options hash -# (for read access) and the %routers hash (for modifying) as well -# as the router's name. This makes for three arguments. -# -# The solution is to use a closure. addrouter takes a opt hash, a -# routers hash, an index to the current number of routers and a flags -# hash and then returns a function which "remembers" these -# values (the closure) but also takes an argument (the router name). - -sub addrouter() { - my $opt = shift; - my $routers = shift; - my $noofrouter = shift; - my $flags = shift; - - return sub { - my $rawname = shift; - - $$noofrouter++; # First increase the number of routers seen. - - my ($community,$routername,$routerkey,$snmpopt,$dnsdomain,$tmpname,@tmpsnmp); - - # Now make sure that the router is defined with the - # proper community, domainname and SNMP options. - # Dissect the rawname to find out what it contains. - - # First check for community: - if ($rawname =~ /^(.+)\@([^@]+)$/) { - # Community was given explicitly! - $community = $1; - $tmpname = $2 - } else { - $community = $$opt{community}; - $tmpname = $rawname; - } - # Now separate the router name from the options. We - # can't just split on the : character because a numeric - # IPv6 address contains a variable number of :'s - if( ($tmpname =~ /^(\[.*\]):(.*)$/) || ($tmpname =~ /^(\[.*\])$/) ){ - # Numeric IPv6 address between [] - ($routername, $snmpopt) = ($1, $2); - } else { - # Hostname or numeric IPv4 address - ($routername, $snmpopt) = split(':', $tmpname, 2); - } - @tmpsnmp = split(':', $snmpopt); - - $routername =~ s/\.$//; # if the hostname ends in a '.' remove it - # it seems to cause trouble in some other - # parts of mrtg - - # Now setup the SNMP options. - if (not defined $$opt{'snmp-options'}) { - $snmpopt = ':' . (join ':', @tmpsnmp); # No merge needed. - } else { - my ($t,$o,@s); - my @optsnmp = split ':',$$opt{'snmp-options'}; - - # Trim first element as the SNMP options start - # with a colon and thus the first element is a - # dummy "" string not corresponding to any SNMP option - # (or rather, corresponding to a router, if there had - # been one...) - shift @optsnmp; - - while ((scalar @tmpsnmp > 0) - or (scalar @optsnmp > 0)) { - $t = shift @tmpsnmp; - $o = shift @optsnmp; - - if(not defined $t) {$t = "";} - if(not defined $o) {$o = "";} - - if($t ne "") - { - push @s, $t; - } else { - push @s, $o; - } - } - - $snmpopt = ':' . (join ':', @s); - } - - my $newopt={}; # Perhaps unecessary initialization but... - - foreach my $o (keys %$opt) { - my $ovalue = $$opt{$o}; - - $$newopt{$o} = $ovalue - unless - ($o =~ /^fullcmd$/ or - $o =~ /^community$/ or - $o =~ /^snmp-options$/ or - $o =~ /^global$/ or - $o =~ /^output$/ - ); - - # Ok, copy the --globals array from $$opt so we know - # that which global(s) to print out into the config. - push @{$$newopt{$o}}, @{$$opt{$o}} if ($o =~ /^global$/); - - # Go through these --global statements one by one. - # If anyone of them contains Options[] for any of the - # targets [_], [^] or [_], process those statements - # tenderly and populate the $$flags{}{} hashes accordingly. - for my $g (@{$$opt{"global"}}) { - my ($t,$fs); - $g =~ /^options\[([_^\$])\]:\s*(.*)$/i; - $t = $1; - $fs = $2; - $t =~ s/_/default/; - $t =~ s/\^/prepend/; - $t =~ s/\$/append/; - - # If a line like "options[X]:" is found clear - # all flags for that category and then go to next - # --global 'Options[..' line if any. - if ($fs =~ /^\s*$/) { - $$flags{$t} = {}; - next; - } else { - for my $f (split /\s*,\s*/,$fs) { - $$flags{$t}{$f} = "set"; - } - } - } - - $$opt{$o} = [] if ($o =~ /^global$/); - } - - # Now let this router get it's own copy of - # the "currently effective" flags. - # Note, Options[_] should only be considered - # if Options[^] and Options[$] both are absent. - - my $newflags = {}; - - if((0 == keys %{$$flags{prepend}}) - and (0== keys %{$$flags{append}})) { - for my $f (keys %{$$flags{default}}) { - $$newflags{$f}="set"; - } - } else { - for my $f (keys %{$$flags{prepend}}, - keys %{$$flags{append}}) { - $$newflags{$f}="set"; - } - } - - if(defined $$opt{'dns-domain'}) { - $dnsdomain=$$opt{'dns-domain'}; - } else { - $dnsdomain=""; - } - - $routerkey = - "${community}\@${routername}" - . (($dnsdomain eq "")?"":".") - . "${dnsdomain}${snmpopt}"; - - $$routers{$routerkey}= { - # rawname is the unprocessed string from the - # command line. - rawname => $rawname, - - # opt is the commandline options which are - # in effect for THIS particular router. - opt => $newopt, - - # noofrouter is the unique number for the - # router. The first router on the command - # line is given number 1, the second number 2 - # and so on. - noofrouter => $$noofrouter, - - # flags contains which --global 'Options[^_$]: flags' - # are effective for THIS particular router. - flags => $newflags, - - # community is the SNMP community used for the router - community => $community, - - # snmpopt is the SNMP options on the form - # [port[:timeout[:retries[:backoff[:version]]]]] - # The empty string simply means that no - # specific SNMP options has been given. - 'snmp-options' => $snmpopt, - - # dns-domain is a domain which should be added - # to the routers hostname. - # e.g if dns-domain is place.xyz and host is router - # the host "router.place.xyz" will be polled. - # If host is "router.dept" the poll will be against - # "router.dept.place.xyz". - 'dns-domain' => $dnsdomain, - - # routername is the routers name as given on the - # command line but with SNMP community (if given) - # and SNMP options (if given) stripped. - # - # (Yes, routername COULD be on the form - # "host.domain" or "host.subdomain.domain") - routername => $routername, - - # routerkey is the same as the has key used for the - # router, which is the router name with everything - # taken into account: community, dns-domain and - # snmp-options. This is the value used when doing - # SNMP communication with the router. - routerkey => $routerkey, - }; - } -} # end addrouter - -sub html_escape ($) { - my $s = shift; - $s =~ s/&/&/g; - $s =~ s//>/g; - $s =~ s/[\n\r]+([^\n\r])/
\n $1/g; - return $s; -} # end html_escape - -sub parsev3 ($) { - my $opt = shift; - my %v3opt; - if (!exists ($$opt{username})) { - die "SMNP V3 requires a --username paramter as part of the User Security Model"; - } else { - $v3opt{username} = $$opt{username}; - } - $v3opt{contextname} = $$opt{contextname} if exists($$opt{contextname}); - if (exists ($$opt{authkey})) { - die "Can't use both an --authkey and --authpassword in the User Security Model" if exists($$opt{authpassword}); - $v3opt{authkey} = $$opt{authkey}; - } - if (exists ($$opt{authpassword})) { - die "Use of --authpassword requires --contextengineid" if !exists($$opt{contextengineid}); - $v3opt{authpassword} = $$opt{authpassword}; - } - if (exists ($$opt{authprotocol})) { - die "Only sha and md5 are defined for --authprotocol" if $$opt{authprotocol} !~ /^(md5|sha)$/i; - die "--authprotocol can only be used with --authpassword or --authkey" if ! exists($$opt{authpassword}) and ! exists($$opt{authkey}); - ($v3opt{authprotocol}) = (lc($$opt{authprotocol}) =~ /^(md5|sha)$/); - } - if (exists ($$opt{privkey})) { - die "Can't use both an --privkey and --privpassword in the User Security Model" if exists($$opt{privpassword}); - die "Can't have privacy parameters without authentication in the User security Model" if ! exists($$opt{authpassword}) and ! exists($$opt{authkey}); - $v3opt{privkey} = $$opt{privkey}; - } - if (exists ($$opt{privpassword})) { - die "Use of --privpassword requires --contextengineid" if !exists($$opt{contextengineid}); - die "Can't have privacy parameters without authentication in the User security Model" if ! exists($$opt{authpassword}) and ! exists($$opt{authkey}); - $v3opt{privpassword} = $$opt{privpassword}; - } - if (exists ($$opt{privprotocol})) { - die "Only des, 3desede, aescfb128, aescffb192 and aescfb256 are defined for --privprotocol" if $$opt{privprotocol} !~ /^(3*des(ede)*|aescfb(128|192|256))$/; - die "--privprotocol can only be used with --privpassword or --privkey" if ! exists($$opt{privpassword}) and ! exists($$opt{privkey}); - $v3opt{privprotocol} = lc($$opt{privprotocol}); - } - return %v3opt; -} - - -sub init () { - snmpmapOID('sysObjectID' => '1.3.6.1.2.1.1.2.0', - 'CiscolocIfDescr' => '1.3.6.1.4.1.9.2.2.1.1.28', - 'CiscoCatalystPortName' => '1.3.6.1.4.1.9.5.1.4.1.1.4', - 'vmVlan' => '1.3.6.1.4.1.9.9.68.1.2.2.1.2', - 'ifAlias' => '1.3.6.1.2.1.31.1.1.1.18'); -} # end init - -__END__ - -=pod - -=head1 NAME - -cfgmaker - Creates mrtg.cfg files (for mrtg-2.14.5) - -=head1 SYNOPSIS - -cfgmaker [options] [community@]router [[options] [community@]router ...] - -=head1 OPTIONS - - --ifref=nr interface references by Interface Number (default) - --ifref=ip ... by Ip Address - --ifref=eth ... by Ethernet Number - --ifref=descr ... by Interface Description - --ifref=name ... by Interface Name - --ifref=type ... by Interface Type - - --ifdesc=nr interface description uses Interface Number (default) - --ifdesc=ip ... uses Ip Address - --ifdesc=eth ... uses Ethernet Number - --ifdesc=descr ... uses Interface Description - --ifdesc=name ... uses Interface Name - --ifdesc=catname ... uses CatOS Interface Name - --ifdesc=alias ... uses Interface Alias - --ifdesc=type ... uses Interface Type - - --if-filter=f Test every interface against filter f to decide wether - or not to include that interface into the collection. - Currently f is being evaluated as a Perl expression - and it's truth value is used to reject or accept the - interface. - (Experimental, under development, might change) - - --if-template=templatefile - Replace the normal target entries for the interfaces - with an entry as specified by the contents in the file - templatefile. The file is supposed to contain Perl - code to be executed to generate the lines for the - target in the configuration file. - (Experimental, under development, might change) - - --host-template=templatefile - In addition to creating targets for a host's interfaces - do also create targets for the host itself as specified - by the contents in the file templatefile. The file is - supposed to contain Perl code to be executed to generate - the lines for the host related targets (such as CPU, - ping response time measurements etc.) in the config- - uration file. - (Experimental, under development, might change) - - --global "x: a" add global config entries - - --no-down do not look at admin or opr status of interfaces - - --show-op-down show interfaces which are operatively down - - --zero-speed=spd use this speed in bits-per-second as the interface - speed for all interfaces that return a speed of 0 - via ifSpeed/ifHighSpeed. 100Mbps = 100000000 - - --subdirs=format give each router its own subdirectory, naming each per - "format", in which HOSTNAME and SNMPNAME will be - replaced by the values of those items -- for instance, - --subdirs=HOSTNAME or --subdirs="HOSTNAME (SNMPNAME)" - - --noreversedns do not reverse lookup ip numbers - - --community=cmty Set the default community string to "cmty" instead of - "public". - - --enable-ipv6 Enable IPv6 support, if the required libraries are - present. Numeric IPv6 addresses must be enclosed - in square brackets, e.g. public@[2001:760:4::1]:161 - - --use-16bit Use 16bit SNMP request IDs to query all routers. - - --snmp-options=:[][:[][:[][:[][:]]]] - - Specify default SNMP options to be appended to all - routers following. Individual fields can be empty. - Routers following might override some or all of the - options given to --snmp-options. - - --dns-domain=domain - Specifies a domain to append to the name of all - routers following. - - --nointerfaces Don't do generate any configuration lines for interfaces, - skip the step of gathering interface information and - don't run any interface template code. - - --interfaces Generate configuration lines for interfaces (this is the - default). The main purpose of this option is to negate - an --nointerfaces appearing earlier on the command line. - - --help brief help message - --man full documentation - --version print the version of cfgmaker - - --output=file output filename default is STDOUT - -=head1 DESCRIPTION - -B creates MRTG configuration files based on information -pulled from a router or another SNMP manageable device. - -[IB<@>]I - -I is the community name of the device you want to create a -configuration for. If not specified, it defaults to 'B'; you might -want to try this first if you do not know the community name of a -device. If you are using the wrong community name you will get no -response from the device. - -I is the DNS name or the IP number of an SNMP-managable device. -Following the name you can specify 6 further options separated by -colons. The full syntax looks like this: - -B[:[B][:[B][:[B][:[B][:B]]]]] - -Of special interest may be the last parameter, B. If you set this to -'2' then your device will be queried with SNMP version 2 requests. This -allows to poll the 64 bit traffic counters in the device and will thus work -much better with fast interfaces (no more counter overrun). Note that the -order in which the routers are specified on the command line do matter as -the same order is used when the configuration file is generated. The first -specified router has it's configuration lines genrated first, followed by -the lines belonging to the next router and so on. - -Note that the first line of the generated cfg file will contain all the -commandline options you used for generating it. This is to allow for the -easy 'regeneration' in case you want to add newhosts or make some other -global change. - -=head2 Configuration - -Except for the B<--output> and B<--global> options, all options affect -only the routers following them on the command line. If an option -specified earlier on the command line reappears later on the command -line with another value, the new value overrides the old value as far as -remaining routers are concerned. This way options might be tailored for -groups of routers or for individual routers. - -See B<--output> and B<--global> for how their behaviour is affected by -where or how many times they appear on the command line. - -See the B below on how to set an option differently for -multiple routers. - -=over - -=item B<--help> - -Print a brief help message and exit. - -=item B<--man> - -Prints the manual page and exits. - -=item B<--version> - -Print the version of cfgmaker. This should match the version of MRTG -for which config files are being created. - -=item B<--ifref> B|B|B|B|B - -Select the interface identification method. Default is B which -identifies the router interfaces by their number. Unfortunately the -interface numbering scheme in an SNMP tree can change. Some routers -change their numbering when new interfaces are added, others change -thier numbering every full moon just for fun. - -To work around this sad problem MRTG can identify interfaces by 4 -other properties. None of these works for all interfaces, but you -should be able to find one which does fine for you. Note that -especially ethernet addrsses can be problematic as some routers have -the same ethernet address on most of their interface cards. - -Select B to identify the interface by its IP number. Use B to -use the ethernet address for identification. Use B to use -the Interface description. Or use B to use the Interface name. - -If your chosen method does not allow unique interface identification on -the device you are querying, B will tell you about it. - -=item B<--ifdesc> B|B|B|B|B|B|B - -Select what to use as the description of the interface. The description -appears in the C property for the target as well as the text header -in the HTML code defined in the target's C. Default is to use -B which is just the interface number which isn't always useful -to the viewer of the graphs. - -There are 6 other properties which could be used. Use B if you want -to use the interface's IP-address. Use B if you want to use the -interface's ethernet address. If you want a better description, you can -use either B, B or B. Exactly what each of these do -varies between different equipment so you might need to experiment. For -instance, for a serial interface on a Cisco router running IOS using B -might result in C<"S0"> being the interface description , B might result -in C<"Serial0"> and B might result in C<"Link to HQ"> (provided that is -what is used as the interface's C in the router's configuration). - -Finally, if you want to describe the interface by it's Btype -(i.e C<"ethernetCSMA">, C<"propPointtoPoint"> etc) you can use B. - -=item B<--if-filter> 'B' - -First of all, this is under some developement and is experimental. - -Use this if you want to have better control over what interfaces gets -included into the configuration. The B is evaluated -as a piece of Perl code and is expected -to return a truth value. If true, include the interface and if false, -exclude the interface. - -For a further discussion on how these filters work, see the section -L
below. - -=item B<--if-template> B - -First of all, this is under some development and is experimental. - -Use this if you want to control what the line for each target should look -like in the configuration file. The contents of the file B -will be evaluated as a Perl program which generates the lines using certain -variables for input and output. - -For a further discussion on how these templates work, see the section -L
below. - -=item B<--host-template> B - -First of all, this is under some development and is experimental. - -Use this if you want to have some extra targets related to the host itself -such as CPU utilization, ping response time to the host, number of busy -modems etc. The contents of the file B will be evaluated -once per host as a Perl program which generates the lines using certain -variables for input and output. - -For a further discussion on how these templates work, see the section -L
below. - -=item B<--community> B - -Use this to set the community for the routers following on the command -line to B. Individual routers might overrride this -community string by using the syntax BB<@>B. - -=item B<--enable-ipv6> - -This option enables IPv6 support. It requires the appropriate perl -modules; if they are not found then IPv6 is disabled (see the ipv6 -documentation). - -cfgmaker will use IPv6 or IPv4 depending on the target. If the target -is a numeric address, the protocol depends on the type of address. If the -target is a hostname, cfgmaker will try to resolve the name first to an -IPv6 address then to an IPv4 address. - -IPv6 numeric addresses must be specified between square braces. - -For example: - - cfgmaker --enable-ipv6 [2001:760:4::1]:165:::2 - -If the target has both an IPv6 address and an IPv4 address with the same -hostname, cfgmaker first queries the target using IPv6 and falls back to -IPv4 if it fails. This is useful for targets which don't support SNMP -over IPv6. - -=item B<--use-16bit> - -This option forces the use of 16bit SNMP request IDs. Some broken SNMP -agents do not accept 32bit request IDs. Try to avoid this option as much -as possible, complain to your agent vendor instead. - -=item B<--snmp-options> :[B][:[B][:[B][:[B][:B]]]] - -Use this to set the default SNMP options for all routers following on the -command line. Individual values might be omitted as well as trailing -colons. Note that routers might override individual (or all) values -specified by B<--snmp-options> by using the syntax - -B[:[B][:[B][:[B][:[B][:B]]]]] - -=item B<--global> B<">IB<"> - -Use this to add global options to the generated config file. -You can call B<--global> several times to add multiple options. -The line will appear in the configuration just before the config for -the next router appearing on the command line. - - --global "workdir: /home/mrtg" - -If you want some default Options you might want to put - - --global "options[_]: growright,bits" - -Specifying B<--global> after the last router on the command line will -create a line in the configuration file which will appear after all the -routers. - -=item B<--noreversedns> - -Do not try to reverse lookup IP numbers ... a must for DNS free environments. - -=item B<--no-down> - -Normally cfgmaker will not include interfaces which are marked -anything but administratively and operationally UP. With this -switch you get them all. - -=item B<--show-op-down> - -Include interfaces which are operatively down. - -=item B<--zero-speed> I - -Assign this speed in bits-per-second to all interfaces which return 0 -for ifSpeed and ifHighSpeed. Some switches, notably Foundry equipment, -return a speed of zero for some interfaces. For example, to have -all interfaces reporting zero set to 100Mbps, use ---zero-speed=100000000. - -=item B<--subdirs> I - -Give each router its own subdirectory for the HTML and graphics (or -.rrd) files. The directory name is the given I string with a -couple of pattern replacements. The string "HOSTNAME" will be -replaced by the hostname of the router (however you specified it on -the B commandline -- it may be an actual hostname or just an -IP address), and "SNMPNAME" will be replaced with the device's idea of -its own name (the same name that appears on the right side of the -"Title" lines). For instance, a call like: - - cfgmaker --subdirs=HOSTNAME__SNMPNAME public@10.10.0.18 - -would result in the generation of lines looking something like: - - Directory[10.10.0.18_1]: 10.10.0.18__fp2200-bothrip-1.3 - -=item B<--output> I - -Write the output from B into the file I. The default -is to use C. B<--output> is expected to appear only once on the -command line. If used multiple times, the file specified by the last -B<--output> will be used. - -=item B<--nointerfaces> - -Don't generate configuration lines for interfaces. - -This makes cfgmaker skip all steps related to interfaces which means -it will not do any polling of the router to retrieve interface -information which speeds up the execution of cfgmaker and it will -neither run any interface templates. - -=item B<--interfaces> - -This makes cfgmaker generate configuration lines for interfaces (the -default behaviour). - -The main usage of this option is to negate an --nointerfaces appearing -earlier on the command line. - - -=back - -=head2 SNMP V3 Options - -B supports SNMP V3. There are optional parameters affecting SNMP operation. - - -=head3 SNMPv3 Arguments - -A SNMP context is a collection of management information accessible by a SNMP -entity. An item of management information may exist in more than one context -and a SNMP entity potentially has access to many contexts. The combination of -a contextEngineID and a contextName unambiguously identifies a context within -an administrative domain. In a SNMPv3 message, the contextEngineID and -contextName are included as part of the scopedPDU. All methods that generate -a SNMP message optionally take a B<--contextengineid> and B<--contextname> -argument to configure these fields. - -=over - -=item Context Engine ID - -The B<--contextengineid> argument expects a hexadecimal string representing -the desired contextEngineID. The string must be 10 to 64 characters (5 to -32 octets) long and can be prefixed with an optional "0x". Once the -B<--contextengineid> is specified it stays with the object until it is changed -again or reset to default by passing in the undefined value. By default, the -contextEngineID is set to match the authoritativeEngineID of the authoritative -SNMP engine. - -=item Context Name - -The contextName is passed as a string which must be 0 to 32 octets in length -using the B<--contextname> argument. The contextName stays with the object -until it is changed. The contextName defaults to an empty string which -represents the "default" context. - -=back - -=head3 User-based Security Model Arguments - -The User-based Security Model (USM) used by SNMPv3 requires that a securityName -be specified using the B<--username> argument. The creation of a Net::SNMP -object with the version set to SNMPv3 will fail if the B<--username> argument -is not present. The B<--username> argument expects a string 1 to 32 octets -in length. - -Different levels of security are allowed by the User-based Security Model which -address authentication and privacy concerns. A SNMPv3 target will -derive the security level (securityLevel) based on which of the following -arguments are specified. - -By default a securityLevel of 'noAuthNoPriv' is assumed. If the B<--authkey> -or B<--authpassword> arguments are specified, the securityLevel becomes -'authNoPriv'. The B<--authpassword> argument expects a string which is at -least 1 octet in length. Optionally, the B<--authkey> argument can be used so -that a plain text password does not have to be specified in a script. The -B<--authkey> argument expects a hexadecimal string produced by localizing the -password with the authoritativeEngineID for the specific destination device. -The C utility included with the Net::SNMP distribution can be used to create -the hexadecimal string (see L). - -Two different hash algorithms are defined by SNMPv3 which can be used by the -Security Model for authentication. These algorithms are HMAC-MD5-96 "MD5" -(RFC 1321) and HMAC-SHA-96 "SHA-1" (NIST FIPS PUB 180-1). The default -algorithm used by the module is HMAC-MD5-96. This behavior can be changed by -using the B<--authprotocol> argument. This argument expects either the string -'md5' or 'sha' to be passed to modify the hash algorithm. - -By specifying the arguments B<--privkey> or B<--privpassword> the securityLevel -associated with the object becomes 'authPriv'. According to SNMPv3, privacy -requires the use of authentication. Therefore, if either of these two -arguments are present and the B<--authkey> or B<--authpassword> arguments are -missing, the creation of the object fails. The B<--privkey> and -B<--privpassword> arguments expect the same input as the B<--authkey> and -B<--authpassword> arguments respectively. - -The User-based Security Model described in RFC 3414 defines a single encryption -protocol to be used for privacy. This protocol, CBC-DES "DES" (NIST FIPS PUB -46-1), is used by default or if the string 'des' is passed to the -B<--privprotocol> argument. By working with the Extended Security Options -Consortium http://www.snmp.com/eso/, the module also supports additional -protocols which have been defined in draft specifications. The draft -http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt -defines the support of CBC-3DES-EDE "Triple-DES" (NIST FIPS 46-3) in the -User-based Security Model. This protocol can be selected using the -B<--privprotocol> argument with the string '3desede'. The draft -http://www.snmp.com/eso/draft-blumenthal-aes-usm-04.txt -describes the use of CFB128-AES-128/192/256 "AES" (NIST FIPS PUB 197) in the -USM. The three AES encryption protocols, differentiated by their key sizes, -can be selected by passing 'aescfb128', 'aescfb192', or 'aescfb256' to the -B<-privprotocol> argument. - -=head2 Details on Filters - -The purpose of the filters is to decide which interfaces to accept and -which interfaces to reject. This decision is done for each interface by -evaluating the filter expression as a piece of Perl code and investigating -the result of the evaluation. If true, accept the interface otherwise -reject it. - -When working with filters, remember that Perl has it's own idea of what truth -and false is. The empty string "" and the string "0" are false, all other -strings are true. This further imples that any integer value of 0 is -false as well as any undef value. It also implies that all references -are considered true. - -As the filter is evaluated as a Perl expression, several useful constructs -in Perl are worth mentioning: - -Expressions might be grouped by using parentheses "()". Expressions might -be combined using boolean operators such as the following: - -=over - -=item "B" (equivalent with "B<&&>") - -Boolean "and" of the two expressions, is only true if both expressions are -true. Example: I B I - -=item "B" (equivalent with "B<||>") - -Boolean "or" of the two expressions, is true if either or both expressions -are true. Example: I B I - -=item "B" (equivalent with "B") - -Boolean negation of a single expression. Example: B I . -Yet another example: BI - -=back - -(For more details on this I recommend a book on Perl) - -=head3 Predefined Filter Variables - -To facilitate, there are a number of predefined values available to use -in the filter. Note that these variables are also available when templates -interfaces are evaluated (but not host templates). - -Caveat: All these variables' names begin with a dollar sign ($), which -is a syntactic requirement for scalar variables in Perl. The danger here -is that the dollar sign in many shells is an active character (often -used for shell variables exactly as in Perl variables) so it is important -to ensure that the Perl expression isn't evaluated by the command line -shell as shell code before being passed to cfgmaker as command line -arguments. In shells like Bourne shell, ksh shell or bash shell, placing -the entire expression within single qoutes will avoid such accidental -evaluation: - - '--if-filter=($default_iftype && $if_admin)' - -=over - -=item B<$if_type> - -This is an integer specifying the interface type as -per the SNMP standards and as reported by the polled device. A complete list -of interface types would be impractical for this document , but there are -a number predefined varables below. Normally, cfgmaker puts in the target's -PageTop this iftype value within paranthesis after the name of the interface -type. (e.g "propPointToPointSerial (22)"). - -Here's a list of some of the most common interface types by number: - - 6 ethernetCsmacd - 7 iso88023Csmacd - 9 iso88025TokenRing - 15 fddi - 19 E1 - 20 basicISDN - 21 primaryISDN - 22 propPointToPointSerial - 23 ppp - 24 softwareLoopback - 30 ds3 - 32 frame-relay - 33 rs232 - 37 atm - 39 sonet - 44 frameRelayService - 46 hssi - 49 aal5 - 53 propVirtual - 62 Fast Ethernet (100BaseT) - 63 ISDN & X.25 - 69 Full Duplex Fast Ethernet (100BaseFX) - 94 Asymetric Digital Subscriber Loop (ADSL) - 117 Gigabit Ethernet - 134 ATM Sub Interface - -=item B<$default> - -True if and only if cfgmaker normally should -accepted the interface based on the interfaces administrative and -operational state (taking the flags B<--no-down> and B<--show-op-down> into -account) and it's type (and a few other things). - -=item B<$default_ifstate> - -True if and only if cfgmaker would have accepted the -interface based on it's operational and administrative states (also taking -into account the presence of the flags B<--no-down> and B<--show-op-down>). - -=item B<$default_iftype> - -True if and only if cfgmaker would have accepted the -interface based on it's type (and a few type specific details in addition). - -=item B<$if_admin> - -True if and only if the interface is in an adminstrative up -state. - -=item B<$if_oper> - -True if and only if the interface is in an operational up -state. - -=back - -A number of variables are also predefined to easily decide if an interface -belong to a certain cathegory or not. Below is all those variables listed -together with which if_type numbers each variable will be true for. Note -that some variables refer to other variables as well. - -=over - -=item B<$if_is_ethernet> - -True for ethernet interfaces (nr 6, 7, 26, 62, 69 and 117). - -=item B<$if_is_isdn> - -True for various ISDN interface types (nr 20, 21, 63, 75, 76 and 77) - -=item B<$if_is_dialup> - -True for dial-up interfaces such as PPP as well -as ISDN. (nr 23, 81, 82 and 108 in addition to the numbers of -B<$if_is_isdn>). - -=item B<$if_is_atm> - -True for miscellaneous ATM related interface types (nr 37, 49, 107, 105, -106, 114 and 134). - -=item B<$if_is_wan> - -True for WAN interfaces point to point, Frame Relay and High Speed Serial ( 22,32,44,46) - -=item B<$if_is_lan> - -True for LAN interfaces (8, 9, 11, 15, 26, 55, 59, 60 and 115 in addition -to the numbers of B<$if_is_ethernet>). - -=item B<$if_is_dsl> - -True for ADSL, RDSL, HDSL and SDSL (nr 94, 95, 96, 97) - -=item B<$if_is_loopback> - -True for software loopback interfaces (nr 24) - -=item B<$if_is_ciscovlan> - -True for Cisco VLAN interfaces (interfaces with the -word Vlan or VLAN in their ifdescs) - -=item B<$if_vlan_id> - -Returns the vlan id associated with a specific port -on Cisco Catalyst switches under both Catalyst OS -and IOS. If it is not a vlan interface, will return undef. - -=item B<$if_MTU> - -Returns the Maximum Transfer Unit associated with a specific port. - -=back - -Besides that, you can also use the variables defined for templates below. -Further, all the variables available in cfgmaker is at the scripts disposal -even if the use of such features is discouraged. More "shortcuts" in the -form of variables and functions will be made avaiable in the future instead. - -=head3 Examples on Filters - -The following filter will not affect which interfaces get's included or -excluded, it will make cfgmaker behave as normally. - - '--if-filter=$default' - -The following filter will make cfgmaker exclude PPP (23) interfaces: - - '--if-filter=$default && $if_type!=23' - -The following filter will make cfgmaker behave as usual except that it will -consider the operational state of an interface irrelevant but still reject -all interfaces which are administratively down. - - '--if-filter=$if_admin && $default_iftype' - -=head2 Details on Templates - -The contents of the template files are evaluated as a Perl program. A -number or Perl variables are available for the program to read and others -are used to be written to. - -As quite a few of the predefined variables has values which are are supposed -to be used in HTML code some of them have an "HTML-escaped" variant, e.g -$html_syslocation is the HTML escaped variant of $syslocation. The HTML -escaping means that the chars "<", ">" and "&" are replaced by "<", -">" and "&" and that newlines embedded in the string are prepended -with "
" and appended with a space character (if a newline is last in the -string it is not touched). - -=head3 Writable Template Variables - -These are the variables available to store the configuration lines in. -Some of them are initialized prior to the evaluation of the template but -such content normally is comments for inclusion in the final configuration -file so those variables might be reset to the empty string in the template -code to eliminate the comments. The other way around is also possible, the -contents of these variables might be extended with further information -for various reasons such as debugging etc. - -Once the template has been evaluated, the following happens: if the -template is a interface template and the actual interface for some reason -is rejected and thus needs to be commented out, all the lines in the -variable B<$target_lines> are turned into comments by adding a hash mark -("#") at their beginning. Then all the variables B<$head_lines>, -B<$problem_lines> , B<$target_lines> and B<$separator_lines> -are concatenated together to form the lines to add to the configuration file. - -=over - -=item B<$target_lines> - -This variable is the placeholder for the configuration lines created -by the template. B<$target_lines> is predefined to be empty when -the template code is evaluated. - -=item B<$head_lines> - -This variable is intended to be the placeholder for the comment line -appearing just before the target in the configuration file. It is -initialized with that comment line before the evaluation of the template -code and if the template doesn't modify B<$head_lines> during evaluation, -the comment will look like usual in the config file. - -=item B<$problem_lines> - -This variable is intended to be the placholder for the comment lines -describing any problems which might have been encountered when trying -to add the target into the configuration. For host templates it's -normally not used and for those it's predefined as the empty string. -For interface templates B<$problem_lines> is predefined with -the error description comments which cfgmaker normally would use for -rejected interfaces or as the empty string for accepted interfaces. - -It is possible to test against B<$problem_lines> to find out if -an interface will be included or rejected but this is not recommended. -Test against B<$if_ok> instead. - -=item B<$separator_lines> - -This variable is the placeholder for the string to use as the separator -between the code for individual targets. The contents of this variable -is put after each target (so the lines will appear after the end of the -last target in the config as well). - -=back - -=head3 Predefined Template Variables - -All the variables below are available for interface templates to use. -For host templates, only those listed under L -are available. - -For interface templates the variables listed under -L are also available. - -=head3 Host and System Variables - -=over - -=item B<$router_name> - -This is the fully qualified name for the router. It is affected by the -following items on the command line: the router name itself and -B<--dns-domain>. - -=item B<$router_connect> - -This is the reference string for the router being polled. It is on the -form community@router possibly followed by some snmp options. It is -affected by the following items on the command line: the router name -itself, B<--community>, B<--snmp-options> and B<--dns-domain>. -(There's no HTML escaped variant available) - -=item B<$directory_name> - -This variable should contain the directory name as cfgmaker normally would -use as the value for the "Directory[]" directive. The value is determined -by the B<--subdirs> command line option. If B<--subdirs> isn't specified -B<$directory_name> will be the empty string. (There's no HTML escaped -variant available) - -=item B<$syscontact> - -This variable is the router's SNMP sysContact value. (HTML escaped -variant: B<$html_syscontact>) - -=item B<$sysname> - -This variable is the router's SNMP sysName value. (No HTML escaped -variant available) - -=item B<$syslocation> - -This variable is the router's SNMP sysLocation value. (HTML escaped -variant: B<$html_syslocation>) - -=item B<$sysdescr> - -This variable is the router's SNMP sysDescr value. It is normally not used -by cfgmaker but might be useful in a template. (HTML escaped variant: -B<$html_sysdescr>) - -=back - -=head3 Interface Target Related Variables - -=over - -=item B<$target_name> - -This is what cfgmaker normally would use as the the name of the target. -The target name is what is found within the square brackets, "[]", for target -directives. (There's no HTML escaped variant available) - -=item B<$if_ref> - -This the reference string for the interface. It is expected to be used -in the "Target[xyz]" directive to distinguish what interface to use. The -value of this variable is affected by the B<--ifref> command line option. -It is normally used together with B<$router_connect>. -(There's no HTML escaped variant available) - -=item B<$if_ok> - -This variable is true if the interface is going to be included into the -configuration file, otherwise false. Don't test against other variables -such as B<$problem_lines> to find out if an interface will be rejected -or not, use this B<$if_ok> instead. - -=item B<$default_target_lines> - -This variable contains all the target lines which cfgmaker by default outputs -for this interface. It's useful if you want to have the "standard target" -but want to add some extra lines to it by using a template. - -=back - -By default cfgmaker uses the following directives for each target it -generates: Target[], SetEnv[], MaxBytes[], Title[], PageTop[] and if -there is any directory specified also the Directory[] directive. - -To facilitate the creation of templates which generates target configs -which are similar to the default one, each of the above mentioned -directive lines have a corresponding variable containing the line as -cfgmaker would have output it by default. - -Note that none of these have a HTML escaped variant, text in them is -HTML escaped where needed. Also note that they do not have any newline -at the end. - -=over - -=item B<$default_target_directive> - -This variable contains the default string for the Target[] directive line. - -=item B<$default_setenv_directive> - -This variable contains the default string for the SetEnv[] directive line. - -=item B<$default_directory_directive> - -This variable contains the default string for the Directory[] directive line -which means it is an empty string (with no newline) if there's no directory. - -=item B<$default_maxbytes_directive> - -This variable contains the default string for the MaxBytes[] directive line. - -=item B<$default_title_directive> - -This variable contains the default string for the Title[] directive line. - -=item B<$default_pagetop_directive> - -This variable contains the default string for the PageTop[] directive lines. - -=back - -=head3 Interface Network Configuration Variables - -=over - -=item B<$if_ip> - -This variable should contain the IP-address of the interface, if any has -been assigned to it. (There's no HTML escaped variant available) - -=item B<$ifindex> - -This variable is the SNMP ifIndex for the interface which per definition -always is an integer. (There's no HTML escaped variant available) - -=item B<$if_index> - -Equivalent with B<$ifindex>. - -=item B<$if_eth> - -Contains the ethernet address of the interface, if any. (There's no HTML -escaped variant available) - -=item B<$if_speed> - -This variable is the speed in bytes/second (with prefixes). (There's no -HTML escaped variant available) - -=item B<$if_speed_str> - -This variable is a cooked speed description which is either in bits or -bytes depending on wether or not the bits option is active and also with -the proper prefix for the speed (k, M, G etc). (No HTML escaped variant -available) - -=item B<$if_type_desc> - -This variable is a textual description of the interface type. (HTML -escaped variant: B<$html_if_type_desc>) - -=item B<$if_type_num> - -This variable the integer value corresponding to the interface type (for a -listing for the value for the more common interface types, see the section -DETAILS ON FILTERS above). (No HTML escaped variant available) - -=item B<$if_dns_name> - -This is the DNS name for the interface. (No HTML escaped variant available) - -=back - -=head3 Interface Name, Description and Alias Variables - -It might seem confusing with both I, I and I in -this context and to some extent it is. I and I are -usually supported on most equipment but how they are used varies, both -between manufacturers as well as between different cathegories of equipment -from the same manufacturer. The I is at least supported by Cisco -IOS, and that variable contains whatever is used in the IOS statement -called "description" for the interface (not to be confused with the SNMP -variables for I). - -For better control from the command line consider B<$if_title_desc> which contents -are controlled by the B<--if-descr> command line option. - -=over - -=item B<$if_snmp_descr> - -This variable should contain the "raw" description of the interface as -determined by the SNMP polling of the router. (HTML escaped variant: -B<$html_if_snmp_descr>) - -=item B<$if_snmp_name> - -The "raw" name for the interface as provided by SNMP polling. (HTML escaped -variant: B<$html_if_snmp_name>) - -=item B<$if_snmp_alias> - -The "raw" ifAlias for the interface as provided by SNMP polling. (HTML -escaped variant: B<$html_if_snmp_alias>) - -=item B<$if_cisco_descr> - -The "raw" CiscolocIfDescr for the interface as provided by SNMP polling. -(HTML escaped variant: B<$html_if_cisco_descr>) - -=item B<$if_description> - -This is the "cooked" description string for the interface, taking into account -the SNMP values found for the interface's RDescr, ifAlias and -CiscolocIfDescr. (HTML escaped variant: B<$html_if_description>) - -=item B<$if_title> - -The full string cfgmaker by default would have used for the Title[] directive -in the configuration as well as the content of the topmost H1 tag in the -PageTop[]. Is composed by the contents of B<$desc_prefix>, -B<$if_title_desc> and B<$sysname>. - -As B<$if_title> depends on B<$if_title_desc>, it is possible to indirectly -control B<$if_title> by using the command line option B<--if-descr>. - -(HTML escaped variant: B<$html_if_title>) - -=item B<$if_port_name> - -If the host is a Cisco Catalyst LAN switch, this variable is the name of -that port. (No HTML escaped variant available) - -=item B<$desc_prefix> - -This variable is a prefix of the description of what the target is to use in -the "Title[]" directive and in the H1 section of the "PageTop[]". Default is -"Traffic analysis for ". (HTML escaped variant: B<$html_desc_prefix>) - -=item B<$if_title_desc> - -This is the description of the interface normally used by cfgmaker as part -of the variable B<$if_title>. The latter is used as the full string in the -"Title[]" directove and the H1 section in the PageTop[]. - -B<$if_title_desc> is controlled by the command line option B<--if-descr> -which indirectly controls the contents of B<$if_title> - -(HTML escaped variant: B<$html_if_title_desc>) - -=back - -=head3 Help Functions for Templates - -The following functions exists to facilitate the writing of host and -interface templates. - -=over - -=item B)> - -B takes a string as an argument and returns a new string -where the following substitutions has been done: the chars "<", ">" and -"&" are replaced by "<", ">" and "&" and that newlines embedded -in the string are prepended with "
" and appended with a space character -(newlines at the end of the string are not touched). - -=back - -=head3 Example Template Files - -=head4 Template Example 1: Eliminating Rejected Targets From Appearing - -This template file generates exactly the same configuration code per -interface as cfgmaker does by default, with the exception that it eliminates -all lines (comments as well as config code) for an interface if the -interface happens to be rejected. - - if(not $problem_lines) - { - $target_lines .= <$html_desc_prefix$html_if_title_desc -- $sysname -
- - - - - - - - - - - - - - - - - - - - - - ECHO - - $target_lines .= < - - - - ECHO - - $target_lines .= < - - - - ECHO - - $target_lines .= < - - - - ECHO - - $target_lines .= < - - ECHO - } else { - $head_lines=""; - $problem_lines=""; - $target_lines=""; - $separator_lines=""; - } - -=head3 Template Example 2: Simplier Version of Example 1 - -Example 1 was partly intended to demonstrate how to customize the generation -of interface targets but also to provide a hint of how the variables are -used in the "default" template which one could consider that cfgmaker -normally uses. - -If you're only intrested in the easiest way of entirely eliminating those -reject interfaces, the template below would do the job as well by using -B<$default_target_lines>. - - if($if_ok) { - $target_lines = $default_target_lines; - } else { - $head_lines=""; - $problem_lines=""; - $target_lines=""; - $separator_lines=""; - } - -=head3 Template Example 3: Creating CPU Targets for Hosts - -Below is an example of a host template. - - $head_lines .= <$router_name CPU load -
-
System:$sysname in $html_syslocation
Maintainer:$html_syscontact
Description:$html_if_description
ifType:$html_if_type_desc ($if_type_num)
ifName:$html_if_snmp_name
Port Name:$if_port_name
Max Speed:$if_speed_str
Ip:$if_ip ($if_dns_name)
- - - - - - - - - - - - - - - - -
System:$router_name in $html_syslocation
Maintainer:$html_syscontact
Description:$html_sysdescr
Resource:CPU.
-
- ECHO - - -=head1 EXAMPLES - -The first example creates a config file for I: the router -has the community name I. Interfaces get identified by their -IP number. Two global options get added to the config file. The -config file gets redirected to I. The '\' signs at the end -of the line mean that this command should be written on a single line. - - cfgmaker --global "WorkDir: /home/tobi" \ - --global "Options[_]: growright,bits" \ - --ifref=ip \ - public@router.place.xyz > mrtg.cfg - -Note: if cfgmaker is not in your path, but you are in the directory where -cfgmaker is stored, you can start it with ./cfgmaker - -The next example creates a config file for four devices: -I, I, I and -I all with the community I. - -The two routers will have B<--ifref> set to B whilst the two -switches will use B<--ifref> set to B. Further the routers will -use B<--ifdesc> set to B and I will use -B<--ifdesc> set to B whilst I use B instead. - -Finally, there will be two Options lines inserted in the configuration: -One will be in the beginning, whilst the other will be inserted after -the lines related to the two routers but before those lines related -to the switches. - - cfgmaker --global "WorkDir: /home/tobi" \ - --global "Options[_]: growright,bits" \ - --ifref=descr \ - --ifdesc=alias \ - public@router1.place.xyz \ - public@router2.place.xyz \ - --global "Options[_]: growright" \ - --ifref=name \ - --ifdesc=descr \ - public@switch1.place.xyz \ - --ifdesc=name \ - public@switch2.place.xyz > mrtg.cfg - - -The next example demonstrates how to use the B<--community>, -B<--snmp-options> and B<--dns-domain> to make the command line -simpler. All the equipment will use the community I, except for -the ppp-server which use community I. All equipment uses these -SNMP options: B<1s timeout>, B<1 retry> and B (B and -B is unspecified which means they use the default values). -The exception again is the ppp-server which uses B. -Finally, all the equipment is part of the domain I, except -for the ppp-server which is part of the domain I. -Note that the latter is achieved simply by specifying the name -of the ppp-server to be I> . - - cfgmaker --global "WorkDir: /home/tobi" \ - --global "Options[_]: growright,bits" \ - --dns-domain=place.xyz \ - --community=hidden \ - --snmp-options=::1:1::2 \ - router1 \ - router2 \ - router3 \ - router4 \ - router5 \ - switch1 \ - switch2 \ - switch3 \ - switch4 \ - switch5 \ - switch6 \ - switch7 \ - access@ppp-server.remote:::::1 > mrtg.cfg - - -=head1 SEE ALSO - -L - -=head1 AUTHOR - -Tobias Oetiker Etobi@oetiker.chE and -Jakob Ilves Ejakob.ilves@oracle.comE - - -=head1 LICENSE - -GNU General Public License - -=head1 COPYRIGHT - -Cfgmaker is Copyright 2000 by Tobias Oetiker Etobi@oetiker.chE - -=cut diff -Nru mrtg-2.14.7/debian/old_temp_pod/indexmaker.pod mrtg-2.16.1/debian/old_temp_pod/indexmaker.pod --- mrtg-2.14.7/debian/old_temp_pod/indexmaker.pod 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/old_temp_pod/indexmaker.pod 1970-01-01 01:00:00.000000000 +0100 @@ -1,837 +0,0 @@ -#! /usr/bin/perl -w -# -*- mode: Perl -*- -################################################################## -# MRTG 2.14.5 --- Index Generator -################################################################## -# -# This reads a mrtg.cfg file form std input or cmdline argument -# and it takes a regexp on the cmdline to specify which -# targets to look at. -# -# from this info it produces a router index on stdout or -# on the filename specified by the --output option -# -################################################################## -# Distributed under the GNU General Public License -# Copyright 2000 by Tobias Oetiker -################################################################## - -$main::GRAPHFMT="png"; - -require 5.005; -use strict; - -# DEBUG TARGETS -# base - basic program flow -#@main::DEBUG=qw(base); - -BEGIN { - # Automatic OS detection ... do NOT touch - if ( $^O =~ /^(?:(ms)?(dos|win(32|nt)?))/i ) { - $main::OS = 'NT'; - $main::SL = '\\'; - $main::PS = ';'; - } elsif ( $^O =~ /^NetWare$/i ) { - $main::OS = 'NW'; - $main::SL = '/'; - $main::PS = ';'; - } elsif ( $^O =~ /^VMS$/i ) { - $main::OS = 'VMS'; - $main::SL = '.'; - $main::PS = ':'; - } else { - $main::OS = 'UNIX'; - $main::SL = '/'; - $main::PS = ':'; - } -} - -use FindBin; -use lib "${FindBin::Bin}"; -use lib "${FindBin::Bin}${main::SL}..${main::SL}lib${main::SL}mrtg2"; - -use MRTG_lib "2.100016"; -use Getopt::Long; -use Pod::Usage; - -my @argv = @ARGV; -my $argz = "$0"; -foreach my $ar (@argv) { - if ($ar =~ /[ |()]/ ) { - $ar = sprintf "\"%s\"", $ar; - } - $argz .= " $ar"; -} - - -main(); -exit 0; - -sub main { - # default options - my %opt = ( - sort => 'original', - show => 'day', - section => 'h1', - columns => 2, - addhead => '', - bodyopt => 'bgcolor="#ffffff" text="#000000" '. - 'link="#000000" vlink="#000000" alink="#000000"', - title => 'MRTG Index Page', - headlevel => 1, - pagetopend => '', - pagetop => '', - pageend => '', - prefix => '', - rrdviewer => '/cgi-bin/14all.cgi', - optlog => 1, - bold => 1, - boldon => '', - boldoff => '', - div => 'DIV', - imgborder => 1, - cellspacing => 10, - nolegend => 0, - ); - $opt{headon} = ""; - $opt{headoff} = ""; - # load real options - options(\%opt); - - #adapt some defaults to the current options - die "ERROR: --autoprefix requires --output" - if ($opt{autoprefix} and !defined $opt{output}); - $opt{pageend} = $opt{pagetopend} if (defined $opt{pagetopend} and not $opt{pageend}); - $opt{pagetop} = $opt{pagetopend} if (defined $opt{pagetopend} and not $opt{pagetop}); - $opt{boldon} = $opt{boldoff} = "" if (!$opt{bold}); - $opt{picfirst} = (defined $opt{picfirst}?1:0); - if ($opt{compact}) { - $opt{imgborder} = 0; - $opt{cellspacing} = 0; - $opt{headon} = $opt{boldon}; - $opt{headoff} = $opt{boldoff}; - } - if ($opt{sidebyside}) { - $opt{div} = 'td'; - } - - # slurp config files - my %rcfg; - my %cfg; - my @target; - my @routers; - my $cfgfile; - my %files; - while (@ARGV) { - $cfgfile = shift @ARGV; - readcfg($cfgfile,\@routers,\%cfg,\%rcfg); - if (($opt{sectionhost}) or ($opt{perhost})) { - #We need to cache the "hostname" as appeared in cfgfile, - #since it does change in cfgcheck (for ex. if multiple - #overlapping cfgfiles are specified) - for my $targ (@routers) { - if ( !defined $rcfg{host}{$targ} and - !($rcfg{target}{$targ} =~ m/(?{$targ} = $pref - if (! defined $rcfg{prefixes}->{$targ}); - } - } - } - # generate index page - genindex(\@routers, \%cfg, \%rcfg, \%opt, \%files); -} - -sub cleanurl ($) { - my $url = shift; - $url =~ s|([^/.][^/.]*/)\.\./\1|$1|g; - return $url; -} - -#Take a path the mrtg (usually the mrtg output directory) and the overview -#file, find the relative path from the overview to the directory -sub subpath ($$) { - my $sub = shift; - my $out = shift; - my @s=split /$main::SL/,$sub; - my @o=split /$main::SL/,$out; - pop @o; #Last is a filename; - for my $i (0..$#s) { #cut common dirs - if (defined $s[0] and - defined $o[0] and - $s[0] eq $o[0] ) { - shift @s; - shift @o; - } - } - my $ret = join $main::SL,@s; - for my $i (0..$#o) { - $ret = "..$main::SL$ret"; # ".." == "Directory below this one" for - # dos, windows, unix. What about VMS ? - # Is this correct ? HEH - } - $ret .= $main::SL; #Possibly this should be "/" in order not - #to break on platforms !unix, since it will be - #used for generating urls ? - #Don't degenerate in "/" when really no prefix is needed. - $ret = "" if ($ret eq $main::SL); - return $ret; -} - -sub genindex ($$$$) { - my $routers = shift; - my $cfg = shift; - my $rcfg = shift; - my $opt = shift; - my $cfgfile = shift; - my $index; - my $metaCmdLine; - # ----------------------------------------------------------- - # keep only the items our users want (--filter) - # ----------------------------------------------------------- - my @filtered; - ITEM: foreach my $item (@{$routers}) { - foreach my $filter (@{$$opt{filter}}) { - if ($filter =~ /(.+)([=!]~)(.+)/) { - my ($area,$comp,$regex) = ($1,$2,$3); - my $value; - for ($area) { - /^title|pagetop$/ && - do { $value = $$rcfg{$area}{$item}; last }; - - /^name$/ && - do { $value = $item; last }; - - die "ERROR: unknown filter area $_\n"; - }; - for ($comp) { - /^=~$/ && - do { next ITEM unless $value =~ /$regex/; last }; - /^!~$/ && - do { next ITEM unless $value !~ /$regex/; last }; - die "ERROR: unknown comparison operator $_\n"; - }; - } else { - die "ERROR: invalid filter expression $filter\n"; - } - } - push @filtered, $item; - }; - - # ----------------------------------------------------------- - # get items into proper order (--sort) - # ----------------------------------------------------------- - my @order; - for ($$opt{sort}) { - /^original$/ && do {@order = @filtered; last}; - /^name$/ && do { @order = sort @filtered; last}; - /^title$/ && do { @order = - sort { $$rcfg{title}{$a} cmp $$rcfg{title}{$b} || $a cmp $b } - @filtered; - last; - }; - /^descr(iption)?$/ && - do { - @order = - sort { - $$rcfg{pagetop}{$a} =~ - m[Description:\s*(?:\S+\s+)?(.+?)]i; - my $aval = lc $1; - $$rcfg{pagetop}{$b} =~ - m[Description:\s*(?:\S+\s+)?(.+?)]i; - my $bval = lc $1; - $aval cmp $bval; - } @filtered; - last; - }; - die "ERROR: unknown sort order '$$opt{sort}'\n"; - } - - # ----------------------------------------------------------- - # issue page top - # ----------------------------------------------------------- - my $interval =$$cfg{'interval'} ? $$cfg{'interval'} : 5; - my $expiration = &expistr($interval); - my $refresh = $$cfg{'refresh'} ? $$cfg{'refresh'} : 300; - for ($$opt{show}) { - $refresh = /^week$/ && 1800 - || /^month$/ && 7200 - || /^year$/ && 86400 - || $refresh ; - } - - my $gifPath = ''; - - if ($$cfg{icondir} || $$opt{icondir}) { - $gifPath = $$opt{icondir} || $$cfg{icondir}; - #lets make sure there is a trailing path separator - $gifPath =~ s|/*$|/|; - } else { - $gifPath = "$$cfg{imagehtml}"; - } - - -if ($$opt{optlog}) { - $metaCmdLine = $argz; -} else { - $metaCmdLine = ""; -} - -$metaCmdLine =~ s/&/&/g; # Must be first, otherwise it will affect the following changes -$metaCmdLine =~ s/"/"/g; -$metaCmdLine =~ s//>/g; - my $headeradd = $$opt{headeradd} || ""; - $index = < - - - $$opt{title} - - - - - - - - - $headeradd -ECHO - $index .= < - - -ECHO - - $index .= < - - -ECHO - $index .= <$$opt{subtitle}

-ECHO - - $index .= < - -ECHO - - # ----------------------------------------------------------- - # print the graph items - # ----------------------------------------------------------- - my $itemnr = 0; - my $first = $order[0]; - my $host = $$rcfg{host}{$first}; - if ($host){ - $index .= "
$$opt{headon}Interfaces of $host $$opt{headoff}" if $$opt{perhost}; - } else { - $index .= "$$opt{headon}Special Items$$opt{headoff}" if $$opt{perhost}; - } - foreach my $item (@order) { - - if ($$opt{perhost}) { - my $newhost = $$rcfg{host}{$item} || 'unspecified host'; - if (!($host eq $newhost)) { - $host = $newhost; - if ($host){ - $index .= "$$opt{headon}Interfaces of $host $$opt{headoff}\n"; - } else { - $index .= "$$opt{headon}Special Items$$opt{headoff}\n"; - } - $index .= "\n"; - $itemnr=0; - } - } - $$opt{prefix} = $$rcfg{prefixes}->{$item} if ($$opt{autoprefix}); - $itemnr++; - $index .= ""; - my $dirrel = "../" x ($$rcfg{'directory_web'}{$item} =~ tr|/|/|); - - # --- produce graph section title --- - my $section; - for ($$opt{section}) { - /^h1$/ && - do{ - if ($$rcfg{pagetop}{$item} =~ m[+]*>(.+?)Description:\s*\Q$section\E\s*(.*?),i - and $section = $1; - last; - }; - /^portname$/ && - do{ - $section = "No Portname for $item"; - $$rcfg{pagetop}{$item} =~ m,Port Name:\s*(.*?),i - and $section = $1; - last; - }; - die "ERROR: unknown sectioning type $_\n"; - }; - if (defined $$rcfg{host}{$item} and - !($section =~ m/\b\Q$$rcfg{host}{$item}\E\b/i)) { - $section = ucfirst $$rcfg{host}{$item} . ": $section"; - } - - # --- write the actual graph ---- - die "ERROR: Unknown show type $$opt{show}\n" - unless $$opt{show} =~ /^day|week|month|year|none$/; - - my $image = "$item-$$opt{show}.${main::GRAPHFMT}" - if $$opt{show} ne 'none'; - - $index .= "<$$opt{div}>" if (!$$opt{sidebyside}); - - if (not $image) { - if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; - $index .= - "". - "$$opt{boldon}". - "$section$$opt{boldoff}"; - } else { - $index .= "$$opt{boldon}". - "". - "$section$$opt{boldoff}\n<$$opt{div}>"; - } - } else { - #loop used for reversing (text,images) to (images,text) if req. - for my $picfirstloop (1,0) { - if ( $picfirstloop^$$opt{picfirst} ) { - $index .= "$$opt{boldon}$itemnr. $$opt{boldoff}" - if $$opt{enumerate}; - if ($$opt{clicktext}) { - $index .= "$$opt{boldon}"; - $index .= $section; - $index .= "$$opt{boldoff}"; - } else { - $index .= "$$opt{boldon}$section$$opt{boldoff}"; - } - $index .= "\n<$$opt{div}>" if $picfirstloop; - } - - if ( !($picfirstloop^$$opt{picfirst}) ) { - # figure show name for rrd viewer - if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; - $index .= "". - "\"$item" - } else { - $index .= ""; - $index .= "\"$item"; - } - $index .= "\n<$$opt{div}>" if $picfirstloop; - } - } - } - - $index .= "" if (!$$opt{sidebyside}); - $index .= "\n"; - - # --- new table column if necessary ---- - if (($itemnr) % $$opt{columns} == 0) { - $index .= "\n\n"; - } - } - # ----------------------------------------------------------- - # print page end - # ----------------------------------------------------------- - - - my $VERSION = "2.14.5"; - $index .= < - - -ECHO - - $index .= < - - - - - - -
MRTGMulti Router Traffic Grapher
- - - - - -
- version $VERSION - Tobias Oetiker - <tobi\@oetiker.ch> - and Dave Rand <dlr\@bungi.com> -
-ECHO - $index .= < - -ECHO - - # ----------------------------------------------------------- - # write out the index page - # ----------------------------------------------------------- - if ($$opt{output}) { - debug ('base', "Writing $$opt{output}"); - open X, ">$$opt{output}" or die "ERROR: creating $$opt{output}: $!\n"; - print X $index; - close X; - } else { - print $index; - } - -} - -sub options ($) { - my $opt = shift; - my @options = ( - 'help|?', - 'man', - 'output=s', - 'filter=s@', - 'addhead=s', - 'title=s', - 'subtitle=s', - 'bodyopt=s', - 'pagetopend=s', - 'pagetop=s', - 'pageend=s', - 'columns=i', - 'perhost!', - 'sort=s', - 'enumerate', - 'width=i', - 'height=i', - 'show=s', - 'section=s', - 'version', - 'prefix=s', - 'headeradd=s', - 'clicktext!', - 'optlog!', - 'compact!', - 'headlevel=i', - 'bold!', - 'picfirst!', - 'sidebyside!', - 'nolegend', - 'autoprefix!', - 'sectionhost!', - 'icondir=s', - 'rrdviewer=s'); - - #generate --option-file from --option - for ( grep /=s$/,@options ) { - my $fileopt = $_; - $fileopt =~ s/=s$/-file=s/; - push @options, $fileopt; - } - - GetOptions( $opt, @options ) or pod2usage(-verbose => 1); - - if ($$opt{prefix}){ - $$opt{prefix} .= '/'; - $$opt{prefix} =~ s|/+$|/|; - } - die ("Indexmaker for mrtg-2.14.5\n") if $$opt{version}; - pod2usage(-exitval => 1, -verbose => 2) if $$opt{man}; - pod2usage(-verbose => 1) if not @ARGV; - - #take care of --fileoption --> --option - for my $fileopt ( grep /-file$/, keys %{$opt} ) { - my $orgopt = $fileopt; - $orgopt =~ s/-file$//; - $$opt{$orgopt} = &readfile($$opt{$fileopt}); - } -} - -#return the contents of a file -sub readfile($) { - my $file = shift; - open F,"<$file" or die "ERROR: can\'t open $file for read, $!"; - my $sl = $/; - $/ = undef; - my $string = ; - $/ = $sl; - close F; - return $string; -} - -__END__ - -=pod - -=head1 NAME - -indexmaker - Creates index files for mrtg web sites (mrtg-2.14.5) - -=head1 SYNOPSIS - -indexmaker [options] mrtg.cfg [other.cfg ...] - -=head1 OPTIONS - - --output=filename set output filename (default: stdout) - - --filter title=~regexp select targets by matching regexp against titles - --filter pagetop=~regexp select targets by matching regexp against pagetop - --filter name=~regexp select targets by matchin regexp against name - - --addhead=text insert this text between and - --title=text set title of generated index file - --subtitle=text add a subtitle to the generated index file - --bodyopt=text set body tag options - --headlevel=number use at top of page (default: 1) - --pagetop=text insert this text between and

...

- --pageend=text insert this text after the main body - --pagetopend=text use this text for pagetop or pageend if undefined - --nolegend do not add the Mrtg legend at the end of the page - - --columns=number show graphs in a table with x columns (default: 2) - --perhost show graphs of the same host on a row - --compact try to make a vertically more compact page - --optlog log the used command line in the page (default: log) - - --sort=title sort graphs by title - --sort=name sort graphs by their name - --sort=descr sort graphs by their description - --sort=original leave as is (default) - - --enumerate add a sequence number to the title of each graph - - --picfirst place pictures before text (default: text first) - --width=number set width of graphs (default: not set) - --height=number - --sidebyside place text / pictures side by side (default: above/below) - --bold use bold text (default: bold) - --clicktext make the text link to the inner page (like the image) - - --show=day pick which graph to show in the index (default) - --show=week - --show=month - --show=year - --show=none - - --section=h1 h1 tag from pagetop as section heading (default) - --section=title title as section headings for graphs - --section=name graph name as section heading - --section=descr graph description as section heading - --section=portname port name entry in pagetop as section heading - --sectionhost Try to prepend the host to the section heading if missing - - --rrdviewer=path path to rrdviewer (default: /cgi-bin/14all.cgi) - --icondir=path path to icondir - --prefix=path path from the location of the index.html to the graphs - --headeradd=string add string to the html page header - --autoprefix try to set prefix automatically - - ---file=file read string argument for option from file - -=head1 DESCRIPTION - -B can create web pages which display the status of an -array of mrtg interface status pages. - -=over - -=item B<--output> I - -set output filename (default: stdout) - -=item B<--filter> (B|B<pagetop>|B<name>)(B<=~>|B<!~>)I<regexp> - -Several filters may get set. Each filter can match agains the contents -of a specific section of the mrtg config file. B<Name> refers to the -bit in square brackets (option[name]: bla). - -Depending on the match operator chosen (B<=~> or B<!~>) the match will be -positive or negative. - -Note that some shells consider B<!> a special character. It may be -necessary to type B<\!~> instead. - -=item B<--title> I<text> - -Set title of generated index file (default: regexp) - -=item B<--bodyopt> I<text> - -The value of this argument gets appended to -the E<lt>BODYE<gt> tag. This allows to set document colors. -By default this option is set to - - bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000" - -=item B<--columns> I<number> - -Display graphs in a table with I<number> columns (default: 2) - -=item B<--sort> B<title>|B<name>|B<descr>|B<original> - -Sort the graphs in the page either by B<title>, by B<name>, by interface -B<descr>iption, or leave them as is. - -=item B<--enumerate> - -Add a sequence number to the title of each graph - -=item B<--width> I<number> - -Set width of graphs - -=item B<--height> I<number> - -Set the height of the graphs - -=item B<--show> B<day>|B<week>|B<month>|B<year>|B<none> - -Select which graph to show in the index page. You can supress images -completely with B<--show=none>. - -=item B<--section> B<h1>|B<title>|B<name>|B<description>|B<portname> - -Select what to use as the title for each graph in the page. B<h1> is -the H1 section from pagetop, B<title> is the graph title, B<name> is -the bit in square brackets (option[name]: bla), and B<descr> or -B<description> is the text from the Description field of the PageTop -(the Cisco description text if it's available, otherwise just the -interface description). B<portname> is the C<Port Name:> from pagetop. - -=item B<--sectionhost> - -Extract the hostname from the target line (this does not work if the -target is a mathematial expression). Prepend the hostname (and a colon) -to the section if not already present. - -=item B<--rrdviewer> I<path> - -If you have set the B<LogFormat: rrdtool> property in the mrtg.cfg -file, the index will take this into account. The only thing you must -tell it is the path to your grapher cgi. (default: /cgi-bin/14all.cgi) - -=item B<--prefix> I<path> - -By default we assume that the file generated by indexmaker is stored in -I<WorkDir>. If you want to store it somewhere else, specify how to reach -I<WorkDir> from the place where the Index is stored. Note that you have to -use '/' as path separator as this will be used in urls. Speaking of which, -you can even enter a whole url. - -=item B<--autoprefix> I<path> - -Requires --output. -Try to generate the prefix automatically by comparision of the path to the -output file set with --output and the Htmldir set in the configuration files. -Particulary useful when multiple configuration files are specified, with -different Htmldir settings. - -=item B<--optlog> - -Default is logging in the generated page the command line, suppress with ---nooptlog . Useful if the commandline contains a complex --pagetop=string -which could confuse simple browsers. - -=item B<--someoption-file> I<filename> - -For any someoption which takes a I<string> as parameter you can read the -string from a file by adding <-file> to the option keyword. The whole -content of the file will be read and used as the I<string>. The file must -exist. - -=back - -=head1 AUTHOR - -Tobias Oetiker E<lt>tobi@oetiker.chE<gt> - -=head1 LICENSE - -GNU General Public License - -=head1 COPYRIGHT - -2000-2001 Tobias Oetiker E<lt>tobi@oetiker.chE<gt> - -=cut diff -Nru mrtg-2.14.7/debian/old_temp_pod/mrtglib.pod mrtg-2.16.1/debian/old_temp_pod/mrtglib.pod --- mrtg-2.14.7/debian/old_temp_pod/mrtglib.pod 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/old_temp_pod/mrtglib.pod 1970-01-01 01:00:00.000000000 +0100 @@ -1,2194 +0,0 @@ -# -*- mode: Perl -*- -package MRTG_lib; - -################################################################### -# MRTG 2.14.5 Support library MRTG_lib.pm -################################################################### -# Created by Tobias Oetiker <tobi@oetiker.ch> -# and Dave Rand <dlr@bungi.com> -# -# For individual Contributers check the CHANGES file -# -################################################################### -# -# Distributed under the GNU General Public License -# -################################################################### - -require 5.005; -use strict; -use vars qw($OS $SL $PS @EXPORT @ISA $VERSION %timestrpospattern); - -if (eval {local $SIG{__DIE__}; require Net_SNMP_util} ) { - import Net_SNMP_util; -} else { - require SNMP_util; - import SNMP_util; -} - -my %mrtgrules; - -BEGIN { - # Automatic OS detection ... do NOT touch - if ( $^O =~ /^(?:(ms)?(dos|win(32|nt)?))/i ) { - $OS = 'NT'; - $SL = '\\'; - $PS = ';'; - } elsif ( $^O =~ /^NetWare$/i ) { - $OS = 'NW'; - $SL = '/'; - $PS = ';'; - } elsif ( $^O =~ /^VMS$/i ) { - $OS = 'VMS'; - $SL = '.'; - $PS = ':'; - } elsif ( $^O =~ /^os2$/i ) { - $OS = 'OS2'; - $SL = '/'; - $PS = ';'; - } else { - $OS = 'UNIX'; - $SL = '/'; - $PS = ':'; - } -} - -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(readcfg cfgcheck setup_loghandlers - datestr expistr ensureSL timestamp - create_pid demonize_me debug log2rrd storeincache readfromcache clearfromcache cleanhostkey - populateconfcache readconfcache writeconfcache - v4onlyifnecessary); - -$VERSION = 2.100016; - -%timestrpospattern = - ( - 'NO' => 0, - 'LU' => 1, - 'RU' => 2, - 'LL' => 3, - 'RL' => 4 - ); - -%mrtgrules = - ( # General CFG - 'workdir' => - [sub{$_[0] && (-d $_[0])}, sub{"Working directory $_[0] does not exist"}], - - 'htmldir' => - [sub{$_[0] && (-d $_[0])}, sub{"Html directory $_[0] does not exist"}], - - 'imagedir' => - [sub{$_[0] && (-d $_[0])}, sub{"Image directory $_[0] does not exist"}], - - 'logdir' => - [sub{$_[0] && (-d $_[0] )}, sub{"Log directory $_[0] does not exist"}], - - 'forks' => - [sub{$_[0] && (int($_[0]) > 0 and $MRTG_lib::OS eq 'UNIX')}, - sub{"Less than 1 fork or not running on Unix/Linux"}], - - 'refresh' => - [sub{int($_[0]) >= 300}, sub{"$_[0] should be 300 seconds or more"}], - - 'enablesnmpv3' => - [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], - - 'enableipv6' => - [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], - - 'interval' => - [sub{int($_[0]) >= 1 and int($_[0]) <= 60}, sub{"$_[0] should be at least 1 Minute and no more than 60 Minutes"}], - - 'writeexpires' => - [sub{1}, sub{"Internal Error"}], - - 'nomib2' => - [sub{1}, sub{"Internal Error"}], - - 'singlerequest' => - [sub{1}, sub{"Internal Error"}], - - 'icondir' => - [sub{$_[0]}, sub{"Directory argument missing"}], - - 'language' => - [sub{1}, sub{"Mrtg not localized for $_[0] - defaulting to english"}], - - 'loadmibs' => - [sub{$_[0]}, sub{"No MIB Files specified"}], - - 'userrdtool' => - [sub{0}, sub{"UseRRDtool is not valid any more. Use LogFormat, PathAdd and LibAdd instead"}], - - 'userrdtool[]' => - [sub{0}, sub{"UseRRDtool[] is not valid any more. Check the new xyz*bla[] syntax for passing parameters to tool xyz who reads the mrtg.cfg"}], - - 'logformat' => - [sub{$_[0] =~ /^(rateup|rrdtool)$/}, sub{"Invalid Logformat '$_[0]'"}], - - 'pathadd' => - [sub{-d $_[0]}, sub{"$_[0] is not the name of a directory"}], - - 'libadd' => - [sub{-d $_[0]}, sub{"$_[0] is not the name of a directory"}], - - 'runasdaemon' => - [sub{1}, sub{"Internal Error"}], - - 'nodetach' => - [sub{1}, sub{"Internal Error"}], - - 'maxage' => - [sub{(($_[0] =~ /^[0-9]+$/) and ($_[0] > 0)) }, - sub{"$_[0] must be a Number bigger than 0"}], - - 'nospacechar' => - [sub{length($_[0]) == 1}, sub{"$_[0] must be one character long"}], - - 'snmpoptions' => - [sub{ eval( 'local $SIG{__DIE__};{'.$_[0].'}' ); return not $@}, - sub{"Must have the format \"OptA => Number, OptB => 'String', ... \""}], - - 'conversioncode' => - [sub{-r $_[0]}, sub{"Cannot read conversion code file $_[0]"}], - - # Per Router CFG - 'target[]' => - [sub{1}, sub{"Internal Error"}], #will test this later - - 'snmpoptions[]' => - [sub{ eval( 'local $SIG{__DIE__};{'.$_[0].'}' ); return not $@}, - sub{"Must have the format \"OptA => Number, OptB => 'String', ... \""}], - - 'routeruptime[]' => - [sub{1}, sub{"Internal Error"}], #will test this later - - 'routername[]' => - [sub{1}, sub{"Internal Error"}], #will test this later - - 'maxbytes[]' => - [sub{(($_[0] =~ /^[0-9]+$/) && ($_[0] > 0)) }, - sub{"$_[0] must be a Number bigger than 0"}], - - 'maxbytes1[]' => - [sub{(($_[0] =~ /^[0-9]+$/) && ($_[0] > 0))}, - sub{"$_[0] must be numerical and larger than 0"}], - - 'maxbytes2[]' => - [sub{(($_[0] =~ /^[0-9]+$/) && ($_[0] > 0))}, - sub{"$_[0] must a number bigger than 0"}], - - 'ipv4only[]' => - [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], - - 'absmax[]' => - [sub{($_[0] =~ /^[0-9]+$/)}, sub{"$_[0] must be a Number"}], - - 'title[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'directory[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'clonedirectory[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'pagetop[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'bodytag[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'pagefoot[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'addhead[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'rrdrowcount[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'extension[]' => - [sub{1}, sub{"Internal Error"}], #what ever the user chooses. - - 'unscaled[]' => - [sub{$_[0] =~ /[ndwmy]+/i}, sub{"Must be a string of [n]one, [d]ay, [w]eek, [m]onth, [y]ear"}], - - 'weekformat[]' => - [sub{$_[0] =~ /[UVW]/}, sub{"Must be either W, V, or U"}], - - 'withpeak[]' => - [sub{$_[0] =~ /[ndwmy]+/i}, sub{"Must be a string of [n]one, [d]ay, [w]eek, [m]onth, [y]ear"}], - - 'suppress[]' => - [sub{$_[0] =~ /[ndwmy]+/i}, sub{"Must be a string of [n]one, [d]ay, [w]eek, [m]onth, [y]ear"}], - - 'xsize[]' => - [sub{((int($_[0]) >= 30) && (int($_[0]) <= 600))}, sub{"$_[0] must be between 30 and 600 pixels"}], - - 'ysize[]' => - [sub{(int($_[0]) >= 30)}, sub{"Must be >= 30 pixels"}], - - 'ytics[]' => - [sub{(int($_[0]) >= 1) }, sub{"Must be >= 1"}], - - 'yticsfactor[]' => - [sub{$_[0] =~ /[-+0-9.efg]+/}, sub{"Should be a numerical value"}], - - 'factor[]' => - [sub{$_[0] =~ /[-+0-9.efg]+/}, sub{"Should be a numerical value"}], - - 'step[]' => - [sub{(int($_[0]) >= 0)}, sub{"$_[0] must be > 0"}], - - 'timezone[]' => - [sub{1}, sub{"Internal Error"}], - - 'options[]' => - [sub{1}, sub{"Internal Error"}], - - 'colours[]' => - [sub{1}, sub{"Internal Error"}], - - 'background[]' => - [sub{1}, sub{"Internal Error"}], - - 'kilo[]' => - [sub{($_[0] =~ /^[0-9]+$/)}, sub{"$_[0] must be a Integer Number"}], - #define whatever k should be (1000, 1024, ???) - - 'kmg[]' => - [sub{1}, sub{"Internal Error"}], - - 'pngtitle[]' => - [sub{1}, sub{"Internal Error"}], - - 'ylegend[]' => - [sub{1}, sub{"Internal Error"}], - - 'shortlegend[]' => - [sub{1}, sub{"Internal Error"}], - - 'legend1[]' => - [sub{1}, sub{"Internal Error"}], - - 'legend2[]' => - [sub{1}, sub{"Internal Error"}], - - 'legend3[]' => - [sub{1}, sub{"Internal Error"}], - - 'legend4[]' => - [sub{1}, sub{"Internal Error"}], - - 'legend5[]' => - [sub{1}, sub{"Internal Error"}], - - 'legendi[]' => - [sub{1}, sub{"Internal Error"}], - - 'legendo[]' => - [sub{1}, sub{"Internal Error"}], - - 'setenv[]' => - [sub{$_[0] =~ /^(?:[-\w]+=\"[^"]*"(?:\s+|$))+$/}, - sub{"$_[0] must be XY=\"dddd\" AASD=\"kjlkj\" ... "}], - - 'xzoom[]' => - [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, - sub{"$_[0] must be a Number xxx.xxx"}], - - 'yzoom[]' => - [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, - sub{"$_[0] must be a Number xxx.xxx"}], - - 'xscale[]' => - [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, - sub{"$_[0] must be a Number xxx.xxx"}], - - 'yscale[]' => - [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, - sub{"$_[0] must be a Number xxx.xxx"}], - - 'threshdir' => - [sub{$_[0] && (-d $_[0])}, sub{"Threshold directory $_[0] does not exist"}], - - 'threshmini[]' => - [sub{1}, sub{"Internal Threshold Config Error"}], - - 'threshmino[]' => - [sub{1}, sub{"Internal Threshold Config Error"}], - - 'threshmaxi[]' => - [sub{1}, sub{"Internal Threshold Config Error"}], - - 'threshmaxo[]' => - [sub{1}, sub{"Internal Threshold Config Error"}], - - 'threshdesc[]' => - [sub{1}, sub{"Internal Threshold Config Error"}], - - 'threshprogi[]' => - [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], - - 'threshprogo[]' => - [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], - - 'threshprogoki[]' => - [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], - - 'threshprogoko[]' => - [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], - - 'timestrpos[]' => - [sub{$_[0] =~ /^(no|[lr][ul])$/i}, sub{"Must be a string of NO, LU, RU, LL, RL"}], - - 'timestrfmt[]' => - [sub{1}, sub{"Internal Error"}] #what ever the user chooses. -); - - -# config file reading - -sub readcfg ($$$$;$$) { - my $cfgfile = shift; - my $routers = shift; - my $cfg = shift; - my $rcfg = shift; - my $extprefix = shift || ''; - my $extrules = shift; - my ($first,$second,$key,$userules); - my (%seen); - my (%pre,%post,%deflt,%defaulted); - unless ($cfgfile) { - die "ERROR: readfg: no configfile specified\n"; - } - unless (ref($routers) eq 'ARRAY' and ref($cfg) eq 'HASH' - and ref($rcfg) eq 'HASH') { - die "ERROR: readcfg called with wrong arguments\n"; - } - if ($extprefix and ref($extrules) ne 'HASH') { - die "ERROR: readcfg called with wrong args for mrtg extension\n"; - } - my $hand; - my $file; - my @filestack; - local *CFG; - if ($cfgfile eq '-'){$cfgfile = '<&STDIN'}; - open (CFG, $cfgfile) || die "ERROR: unable to open config file: $cfgfile\n"; - $hand = *CFG; - my @handstack; - my $nextfile = $cfgfile; - my %routerhash; - while (1) { - if (eof $hand || not defined ($_ = <$hand>) ) { - close $hand; - if (scalar @handstack){ - $hand = pop @handstack; - $nextfile = pop @filestack; - next; - } else { - last; - } - } - $file=$nextfile; - chomp; - my $line = $.; - if (/^include:\s*(.*?\S)\s*$/i){ - push @filestack, $file; - push @handstack, $hand; - $nextfile = $1; - local *FH; - open (FH, $nextfile) - || open (FH, ($cfgfile =~ m#(.+)${MRTG_lib::SL}[^${MRTG_lib::SL}]+$#)[0] . ${MRTG_lib::SL} . $nextfile) - || do { die "ERROR: unable to open include file: $nextfile\n"}; - $hand = *FH; - next; - } - - debug('cfg',"$file\[$.\]: $_"); - - s/\t/ /g; #replace tab by space - s/\r$//; # kill dos newlines ... - s/ +$//g; #remove space at the end of the line - next if /^ *\#/; #ignore comment lines - next if /^ *$/; #ignore empty lines - # oops spelling error - s/^supress/suppress/gi; - - - # the line we got starts with white space so it is to be appended to what ever - # was on the previous line. - - if (defined $first && /^\s+(.*\S)\s*$/) { - if (defined $second) { - $second eq '^' && do { $pre{$first} .= "\n".$1; next}; - $second eq '$' && do { $post{$first} .= "\n".$1; next}; - $second eq '_' && do { $deflt{$first} .= "\n".$1; next}; - $$rcfg{$first}{$second} .= " ".$1; - } else { - $$cfg{$first} .= "\n".$1; - } - next; - } - - if (defined $first && defined $second && defined $post{$first} && ($second !~ /^[\$^_]$/)) { - if (defined $defaulted{$first}{$second}) { - $$rcfg{$first}{$second} = $post{$first}; - delete $defaulted{$first}{$second}; - } else { - $$rcfg{$first}{$second} .= ( defined $$cfg{nospacechar} and $post{$first} =~ /(.*)\Q$$cfg{nospacechar}\E$/) ? $1 : " ".$post{$first} ; - } - } - - if (defined $first and $first =~ m/^([^*]+)\*(.+)$/) { - $userules = ($1 eq $extprefix ? $extrules : ''); - } else { - $userules = \%mrtgrules; - } - - if ($first && defined $deflt{$first} && ($second eq '_')) { - quickcheck($first,$second,$deflt{$first},$file,$line,$userules) - } elsif ($first && $second && ($second !~ /^[\$^_]$/)) { - quickcheck($first,$second,$$rcfg{$first}{$second},$file,$line,$userules) - } elsif ($first && not $second) { - quickcheck($first,0,$$cfg{$first},$file, $line,$userules) - } - - if (/^([A-Za-z0-9*]+)\[(\S+)\]\s*:\s*(.*\S?)\s*$/) { - $first = lc($1); - $second = lc($2); - # For us spelling-handicapped Americans. ;) - # James Overbeck, grendel@gmo.jp, 2003/01/19 - if ($first eq 'colors') { $first = 'colours' }; - if ($second eq '^') { - if ($3 ne '') { - $pre{$first}=$3; - } else { - delete $pre{$first}; - } - next; - } - if ($second eq '$') { - if ($3 ne '') { - $post{$first}=$3; - } else { - delete $post{$first}; - } - next; - } - if ($second eq '_') { - if ($3 ne '') { - $deflt{$first}=$3; - } else { - delete $deflt{$first}; - } - next; - } - - if (not defined $routerhash{$second}) { - push (@{$routers}, $second); - $routerhash{$second} = 1; - } - - # make sure that default tags spring into existance upon first - # call of a router - - foreach $key (keys %deflt) { - if (! defined $$rcfg{$key}{$second}) { - $$rcfg{$key}{$second} = $deflt{$key}; - $defaulted{$key}{$second} = 1; - } - } - - # make sure that prefix-only tags spring into existance upon first - # call of a router - - foreach $key (keys %pre) { - if (! defined $$rcfg{$key}{$second}) { - delete $defaulted{$key}{$second} if $defaulted{$key}{$second}; - $$rcfg{$key}{$second} = ( defined $$cfg{nospacechar} && $pre{$key} =~ m/(.*)\Q$$cfg{nospacechar}\E$/ ) ? $1 : $pre{$key}." "; - } - } - - if ($seen{$first}{$second}) { - die ("ERROR: Line $line ($_) in CFG file ($file)\n". - "contains a duplicate definition for $first\[$second].\n". - "First definition is on line $seen{$first}{$second}\n") - } else { - $seen{$first}{$second} = $line; - } - - if ($defaulted{$first}{$second}) { - $$rcfg{$first}{$second} = ''; - delete $defaulted{$first}{$second}; - } - $$rcfg{$first}{$second} .= $3; - - next; - - } - if (/^(\S+):\s*(.*\S)\s*$/) { - $first = lc($1); - $$cfg{$first} = $2; - $second = ''; - next; - } - die "ERROR: Line $line ($_) in CFG file ($file) does not make sense\n"; - } - - # append $ stuff to the very last tag in cfg file if necessary - if (defined $first && defined $second && defined $post{$first} && ($second !~ /^[\$^_]$/)) { - if ($defaulted{$first}{$second}) { - $$rcfg{$first}{$second} = $post{$first}; - delete $defaulted{$first}{$second}; - } else { - $$rcfg{$first}{$second} .= - ( defined $$cfg{'nospacechar'} && $post{$first} =~ /(.*)\Q$$cfg{nospacechar}\E$/ ) ? $1 : " ".$post{$first} ; - } - } - - #check the last input line - if ($first =~ m/^([^*]+)\*(.+)$/) { - $userules = ($1 eq $extprefix ? $extrules : ''); - } else { - $userules = \%mrtgrules; - } - if ($first && defined $deflt{$first} && ($second eq '_')) { - quickcheck($first,$second,$deflt{$first},$file,$.,$userules) - } elsif ($first && $second && ($second !~ /^[\$^_]$/)) { - quickcheck($first,$second,$$rcfg{$first}{$second},$file,$.,$userules) - } elsif ($first && not $second) { - quickcheck($first,0,$$cfg{$first},$file,$.,$userules) - } - - close (CFG); -} - -# quick checks - -sub quickcheck ($$$$$$) { - my ($first,$second,$arg,$file,$line,$rules) = @_; - return unless ref($rules) eq 'HASH'; - my $braces = $second ? '[]':''; - if (exists $rules->{$first.$braces}) { - if (&{$rules->{$first.$braces}[0]}($arg)) { - return 1; - } else { - if ($second) { - die "ERROR: CFG Error in \"$first\[$second\]\", line $line: ". - &{$rules->{$first.$braces}[1]}($arg)."\n\n"; - } else { - die "ERROR: CFG Error in \"$first\", line $line: ". - &{$rules->{$first.$braces}[1]}($arg)."\n\n"; - } - } - } - die "ERROR: CFG Error Unknown Option \"$first\" on line $line or above.\n". - " Check doc/reference.txt for Help\n\n"; -} - -# complex config checks - -sub mkdirhier ($){ - my @dirs = split /\Q${MRTG_lib::SL}\E+/, shift; - my $path = ""; - while (@dirs){ - $path .= shift @dirs; - $path .= ${MRTG_lib::SL}; - if (! -d $path){ - warn ("WARNING: $path did not exist I will create it now\n"); - mkdir $path, 0777 or die ("ERROR: mkdir $path: $!\n"); - } - } -} - -sub cfgcheck ($$$$;$) { - my $routers = shift; - my $cfg = shift; - my $rcfg = shift; - my $target = shift; - my $opts = shift || {}; - my ($rou, $confname, $one_option); - # Target index hash. Keys are "int:community@router" target definition - # strings and values are indices of the @$target array. Used to avoid - # duplicate entries in @$target. - my $targIndex = { }; - my $error="no"; - my(@known_options) = qw(growright bits noinfo absolute gauge nopercent avgpeak derive - integer perhour perminute transparent dorelpercent - unknaszero withzeroes noborder noarrow noi noo - nobanner nolegend logscale secondmean pngdate printrouter); - - snmpmapOID('hrSystemUptime' => '1.3.6.1.2.1.25.1.1'); - - if (defined $$cfg{workdir}) { - die ("ERROR: WorkDir must not contain spaces when running on Windows. (Yeat another reason to get Linux)\n") - if ($OS eq 'NT' or $OS eq 'OS2') and $$cfg{workdir} =~ /\s/; - ensureSL(\$$cfg{workdir}); - $$cfg{logdir}=$$cfg{htmldir}=$$cfg{imagedir}=$$cfg{workdir}; - mkdirhier "$$cfg{workdir}" unless $opts->{check}; - - } elsif ( not (defined $$cfg{logdir} or defined $$cfg{htmldir} or defined $$cfg{imagedir})) { - die ("ERROR: \"WorkDir\" not specified in mrtg config file\n"); - $error = "yes"; - } else { - if (! defined $$cfg{logdir}) { - warn ("WARNING: \"LogDir\" not specified\n"); - $error = "yes"; - } else { - ensureSL(\$$cfg{logdir}); - mkdirhier $$cfg{logdir} unless $opts->{check}; - } - if (! defined $$cfg{htmldir}) { - warn ("WARNING: \"HtmlDir\" not specified\n"); - $error = "yes"; - } else { - ensureSL(\$$cfg{htmldir}); - mkdirhier $$cfg{htmldir} unless $opts->{check}; - } - if (! defined $$cfg{imagedir}) { - warn ("WARNING: \"ImageDir\" not specified\n"); - $error = "yes"; - } else { - ensureSL(\$$cfg{imagedir}); - mkdirhier $$cfg{imagedir} unless $opts->{check}; - } - } - # build relativ path from htmldir to image dir. - my @htmldir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{htmldir}; - my @imagedir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{imagedir}; - while (scalar @htmldir > 0 and $htmldir[0] eq $imagedir[0]) { - shift @htmldir; shift @imagedir; - } - # this is for the webpages so we use / path separator always - $$cfg{imagehtml} = ""; - foreach my $dir ( @htmldir ) { - $$cfg{imagehtml} .= "../" if $dir; - } - map {$$cfg{imagehtml} .= "$_/" } @imagedir; - # relative path is built - debug('dir', "imagehtml = $$cfg{imagehtml}"); - - $SNMP_util::CacheFile = "$$cfg{'logdir'}oid-mib-cache.txt"; - - if (defined $$cfg{loadmibs}) { - my($mibFile); - foreach $mibFile (split /[,\s]+/, $$cfg{loadmibs}) { - snmpQueue_MIB_File($mibFile); - } - } - if(defined $$cfg{pathadd}){ - ensureSL(\$$cfg{pathadd}); - $ENV{PATH} = "$$cfg{pathadd}${MRTG_lib::PS}$ENV{PATH}"; - } - if(defined $$cfg{libadd}){ - ensureSL(\$$cfg{libadd}); - eval 'local $SIG{__DIE__};'."use lib qw($$cfg{libadd})"; - my @match; - foreach my $dir (@INC){ - push @match, $dir if -f "$dir/RRDs.pm"; - } - warn "WARN: found several copies of RRDs.pm in your path: ". - (join ", ", @match)." I will be using $match[0]. This could ". - "be a problem if this is an old copy and you think I would be using a newer one!\n" - if $#match > 0; - } - $$cfg{logformat} = 'rateup' unless defined $$cfg{logformat}; - - if($$cfg{logformat} eq 'rrdtool') { - my ($name); - if ($MRTG_lib::OS eq 'NT' or $MRTG_lib::OS eq 'OS2'){ - $name = "rrdtool.exe"; - } elsif ($MRTG_lib::OS eq 'NW'){ - $name = "rrdtool.nlm"; - } else { - $name = "rrdtool"; - } - foreach my $path (split /\Q${MRTG_lib::PS}\E/, $ENV{PATH}) { - ensureSL(\$path); - -f "$path$name" && do { - $$cfg{'rrdtool'} = "$path$name"; - last;} - }; - die "ERROR: could not find $name. Use PathAdd: in mrtg.cfg to help mrtg find rrdtool\n" - unless defined $$cfg{rrdtool}; - debug ('rrd',"found rrdtool in $$cfg{rrdtool}"); - my $found; - foreach my $path (@INC) { - ensureSL(\$path); - -f "${path}RRDs.pm" && do { - $found=1; - last;} - }; - die "ERROR: could not find RRDs.pm. Use LibAdd: in mrtg.cfg to help mrtg find RRDs.pm\n" - unless defined $found; - } - if (defined $$cfg{snmpoptions}) { - $cfg->{snmpoptions} = eval('local $SIG{__DIE__};{'.$cfg->{snmpoptions}.'}'); - } - - # default interval is 5 minutes - $$cfg{interval} = 5 unless defined $$cfg{interval}; - unless ($$cfg{logformat} eq 'rrdtool') { - # interval has to be 5 minutes at least without userrdtool - if ($$cfg{interval} < 5) { - die "ERROR: CFG Error in \"Interval\": should be at least 5 Minutes (unless you use rrdtool)"; - } - } - - # Check for a Conversion Code file and evaluate its contents, which - # should consist of one or more subroutine definitions. The code goes - # into the MRTGConversion name space. - if( exists $cfg->{ conversioncode } ) { - open CONV, $cfg->{ conversioncode } - or die "ERROR: Can't open file $cfg->{ conversioncode }\n"; - my $code = "local $SIG{__DIE__};package MRTGConversion;\n". join( '', <CONV> ) . "1;\n"; - close CONV; - die "ERROR: File $cfg->{ conversioncode } conversion code evaluation failed\n$@\n" - unless eval $code; - } - - foreach $rou (@$routers) { - # and now for the testing - - if (! defined $rcfg->{snmpoptions}{$rou}) { - $rcfg->{snmpoptions}{$rou} = {%{$cfg->{snmpoptions}}} - if defined $cfg->{snmpoptions}; - } else { - $rcfg->{snmpoptions}{$rou} = eval('local $SIG{__DIE__};{'.$rcfg->{snmpoptions}{$rou}.'}'); - } - $rcfg->{snmpoptions}{$rou}{avoid_negative_request_ids} = 1; - # $rcfg->{snmpoptions}{$rou}{domain} = 'udp'; - - if (! defined $$rcfg{"title"}{$rou}) { - warn ("WARNING: \"Title[$rou]\" not specified\n"); - $error = "yes"; - } - if (defined $$rcfg{'directory'}{$rou} and $$rcfg{'directory'}{$rou} ne "") { - # They specified a directory for this router. Append the - # pathname seperator to it (so that it can either be present or - # absent, and the rules for including it are the same). - ensureSL(\$$rcfg{'directory'}{$rou}); - for my $x (qw(imagedir logdir htmldir)) { - mkdirhier $$cfg{$x}.$$rcfg{directory}{$rou} unless $opts->{check}; - } - $$rcfg{'directory_web'}{$rou} = $$rcfg{'directory'}{$rou}; - $$rcfg{'directory_web'}{$rou} =~ s/\Q${MRTG_lib::SL}\E+/\//g; - debug('dir', "directory for $rou '$$rcfg{'directory_web'}{$rou}'"); - } else { - $$rcfg{'directory'}{$rou}=""; - $$rcfg{'directory_web'}{$rou}=""; - } - - if (defined $$rcfg{"pagetop"}{$rou}) { - $$rcfg{"pagetop"}{$rou} =~ s/\\n/\n/g; - } - - - if (defined $$rcfg{"pagefoot"}{$rou}) { - # allow for linebreaks - $$rcfg{"pagefoot"}{$rou} =~ s/\\n/\n/g; - } - - $$rcfg{"maxbytes1"}{$rou} = $$rcfg{"maxbytes"}{$rou} unless defined $$rcfg{"maxbytes1"}{$rou}; - $$rcfg{"maxbytes2"}{$rou} = $$rcfg{"maxbytes"}{$rou} unless defined $$rcfg{"maxbytes2"}{$rou}; - - if ( not defined $$rcfg{"maxbytes"}{$rou} - and not defined $$rcfg{"maxbytes1"}{$rou} - and not defined $$rcfg{"maxbytes2"}{$rou}) { - warn ("WARNING: \"MaxBytes[$rou]\" not specified\n"); - $error = "yes"; - } else { - - if (not defined $$rcfg{"maxbytes1"}{$rou}) { - warn ("WARNING: \"MaxBytes1[$rou]\" not specified\n"); - $error = "yes"; - } - if (not defined $$rcfg{"maxbytes2"}{$rou}) { - warn ("WARNING: \"MaxBytes2[$rou]\" not specified\n"); - $error = "yes"; - } - } - # set default extension - if (! defined $$rcfg{"extension"}{$rou}) { - $$rcfg{"extension"}{$rou}="html"; - } - - # set default size - if (! defined $$rcfg{"xsize"}{$rou}) { - $$rcfg{"xsize"}{$rou}=400; - } - if (! defined $$rcfg{"ysize"}{$rou}) { - $$rcfg{"ysize"}{$rou}=100; - } - if (! defined $$rcfg{"ytics"}{$rou}) { - $$rcfg{"ytics"}{$rou}=4; - } - if (! defined $$rcfg{"yticsfactor"}{$rou}) { - $$rcfg{"yticsfactor"}{$rou}=1; - } - if (! defined $$rcfg{"factor"}{$rou}) { - $$rcfg{"factor"}{$rou}=1; - } - - if (defined $$rcfg{"options"}{$rou}) { - my $opttemp = lc($$rcfg{"options"}{$rou}); - delete $$rcfg{"options"}{$rou}; - foreach $one_option (split /[,\s]+/, $opttemp) { - if (grep {$one_option eq $_} @known_options) { - $$rcfg{'options'}{$one_option}{$rou} = 1; - } else { - warn ("WARNING: Option[$rou]: \"$one_option\" is unknown\n"); - $error="yes"; - } - } - if ($rcfg->{'options'}{derive}{$rou} and not $cfg->{logformat} eq 'rrdtool'){ - warn ("WARNING: Option[$rou]: \"derive\" works only with rrdtool logformat\n"); - $error="yes"; - } - } - # - # Check out routeruptime definition - # - if (defined $$rcfg{"routeruptime"}{$rou}) { - ($$rcfg{"community"}{$rou},$$rcfg{"router"}{$rou}) = - split(/@/,$$rcfg{"routeruptime"}{$rou}); - } - # - # Check out target definition - # - if (defined $$rcfg{"target"}{$rou}) { - $$rcfg{targorig}{$rou} = $$rcfg{target}{$rou}; - debug ('tarp',"Starting $rou -> $$rcfg{target}{$rou}"); - # Decide whether to turn on IPv6 support for this target. - # IPv6 support is turned on only if the EnableIPv6 global - # setting is yes and the IPv4Only per-target setting is no. - # If IPv6 is disabled, we set IPv4Only to true for all - # targets, thus disabling all IPv6-related code. - my $ipv4only = 1; - if ($$cfg{enableipv6} and $$cfg{enableipv6} eq 'yes') { - # IPv4Only is off by default - $ipv4only = 0 - unless (defined $$rcfg{ipv4only}{$rou}) && (lc($$rcfg{ipv4only}{$rou}) eq 'yes'); - } - ( $$rcfg{target}{$rou}, $$rcfg{uniqueTarget}{$rou} ) = - targparser( $$rcfg{target}{$rou}, $target, $targIndex, $ipv4only, $rcfg->{snmpoptions}{$rou} ); - } else { - warn ("WARNING: I can't find a \"target[$rou]\" definition\n"); - $error = "yes"; - } - - # colors format: name#hexcol, - if (defined $$rcfg{"colours"}{$rou}) { - if ($$rcfg{'options'}{'dorelpercent'}{$rou}) { - if ($$rcfg{"colours"}{$rou} =~ - /^([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})/ix) { - ($$rcfg{'col1'}{$rou}, $$rcfg{'rgb1'}{$rou}, - $$rcfg{'col2'}{$rou}, $$rcfg{'rgb2'}{$rou}, - $$rcfg{'col3'}{$rou}, $$rcfg{'rgb3'}{$rou}, - $$rcfg{'col4'}{$rou}, $$rcfg{'rgb4'}{$rou}, - $$rcfg{'col5'}{$rou}, $$rcfg{'rgb5'}{$rou}) = - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10); - } else { - warn ("WARNING: \"colours[$rou]\" for colour definition\n". - " use the format: Name#hexcolour, Name#Hexcolour,...\n", - " note, that dorelpercent requires 5 colours"); - $error="yes"; - } - } else { - if ($$rcfg{"colours"}{$rou} =~ - /^([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})\s*,\s* - ([^\#]+)(\#[0-9a-f]{6})/ix) { - ($$rcfg{'col1'}{$rou}, $$rcfg{'rgb1'}{$rou}, - $$rcfg{'col2'}{$rou}, $$rcfg{'rgb2'}{$rou}, - $$rcfg{'col3'}{$rou}, $$rcfg{'rgb3'}{$rou}, - $$rcfg{'col4'}{$rou}, $$rcfg{'rgb4'}{$rou}) = - ($1, $2, $3, $4, $5, $6, $7, $8); - } else { - warn "WARNING: \"colours[$rou]\" for colour definition\n". - " use the format: Name#hexcolour, Name#Hexcolour,...\n"; - $error="yes"; - } - } - } else { - if (defined $$rcfg{'options'}{'dorelpercent'}{$rou}) { - ($$rcfg{'col1'}{$rou}, $$rcfg{'rgb1'}{$rou}, - $$rcfg{'col2'}{$rou}, $$rcfg{'rgb2'}{$rou}, - $$rcfg{'col3'}{$rou}, $$rcfg{'rgb3'}{$rou}, - $$rcfg{'col4'}{$rou}, $$rcfg{'rgb4'}{$rou}, - $$rcfg{'col5'}{$rou}, $$rcfg{'rgb5'}{$rou}) = - ("GREEN","#00cc00", - "BLUE","#0000ff", - "DARK GREEN","#006600", - "MAGENTA","#ff00ff", - "AMBER","#ef9f4f"); - } else { - ($$rcfg{'col1'}{$rou}, $$rcfg{'rgb1'}{$rou}, - $$rcfg{'col2'}{$rou}, $$rcfg{'rgb2'}{$rou}, - $$rcfg{'col3'}{$rou}, $$rcfg{'rgb3'}{$rou}, - $$rcfg{'col4'}{$rou}, $$rcfg{'rgb4'}{$rou}) = - ("GREEN","#00cc00", - "BLUE","#0000ff", - "DARK GREEN","#006600", - "MAGENTA","#ff00ff"); - } - } - # Background color, format: #rrggbb - if (! defined $$rcfg{'background'}{$rou}) { - $$rcfg{'background'}{$rou} = "#ffffff"; - } - if ($$rcfg{'background'}{$rou} =~ /^(\#[0-9a-f]{6})/i) { - $$rcfg{'backgc'}{$rou} = "$1"; - } else { - warn "WARNING: \"background[$rou]: ". - "$$rcfg{'background'}{$rou}\" for colour definition\n". - " use the format: #rrggbb\n"; - $error="yes"; - } - - if (! defined $$rcfg{'kilo'}{$rou}) { - $$rcfg{'kilo'}{$rou} = 1000; - } - if (defined $$rcfg{'kmg'}{$rou}) { - $$rcfg{'kmg'}{$rou} =~ s/\s+//g; - } - - if (! defined $$rcfg{'xzoom'}{$rou}) { - $$rcfg{'xzoom'}{$rou} = 1.0; - } - if (! defined $$rcfg{'yzoom'}{$rou}) { - $$rcfg{'yzoom'}{$rou} = 1.0; - } - if (! defined $$rcfg{'xscale'}{$rou}) { - $$rcfg{'xscale'}{$rou} = 1.0; - } - if (! defined $$rcfg{'yscale'}{$rou}) { - $$rcfg{'yscale'}{$rou} = 1.0; - } - if (! defined $$rcfg{'timestrpos'}{$rou}) { - $$rcfg{'timestrpos'}{$rou} = 'NO'; - } - if (! defined $$rcfg{'timestrfmt'}{$rou}) { - $$rcfg{'timestrfmt'}{$rou} = "%Y-%m-%d %H:%M"; - } - if ($error eq "yes") { - die "ERROR: Please fix the error(s) in your config file\n"; - } - } -} - -# make sure string ends with a slash. -sub ensureSL($) { -# return; - my $ref = shift; - return if $$ref eq ""; - debug('dir',"ensure path IN: '$$ref'"); - if (${MRTG_lib::SL} eq '\\'){ - # two slashes at the start of the string are OK - $$ref =~ s/(.)\Q${MRTG_lib::SL}\E+/$1${MRTG_lib::SL}/g; - } else { - $$ref =~ s/\Q${MRTG_lib::SL}\E+/${MRTG_lib::SL}/g; - } - $$ref =~ s/\Q${MRTG_lib::SL}\E*$/${MRTG_lib::SL}/; - debug('dir',"ensure path OUT: '$$ref'"); -} - -# convert current supplied time into a nice date string - -sub datestr ($) { - my ($time) = shift || return 0; - my ($wday) = ('Sunday','Monday','Tuesday','Wednesday', - 'Thursday','Friday','Saturday')[(localtime($time))[6]]; - my ($month) = ('January','February' ,'March' ,'April' , - 'May' , 'June' , 'July' , 'August' , 'September' , - 'October' , - 'November' , 'December' )[(localtime($time))[4]]; - my ($mday,$year,$hour,$min) = (localtime($time))[3,5,2,1]; - if ($min<10) { - $min = "0$min"; - } - return "$wday, $mday $month ".($year+1900)." at $hour:$min"; -} - - -# create expire date for expiery in ARG Minutes - -sub expistr ($) { - my ($time) = time+$_[0]*60+5; - my ($wday) = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat')[(gmtime($time))[6]]; - my ($month) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep', - 'Oct','Nov','Dec')[(gmtime($time))[4]]; - my ($mday,$year,$hour,$min,$sec) = (gmtime($time))[3,5,2,1,0]; - if ($mday<10) { - $mday = "0$mday"; - } - ; - if ($hour<10) { - $hour = "0$hour"; - } - ; - if ($min<10) { - $min = "0$min"; - } - if ($sec<10) { - $sec = "0$sec"; - } - return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; -} - -sub create_pid ($) { - my $pidfile = shift; - return if ($OS eq 'NT' ); - return if -e $pidfile; - if ( open(PIDFILE,">$pidfile")) { - close PIDFILE; - } else { - warn "cannot write to $pidfile: $!\n"; - } -} - -sub demonize_me ($) { - my $pidfile = shift; - my $cfgfile = shift; - print "Daemonizing MRTG ...\n"; - if ( $OS eq 'NT' ) { - print "Do Not close this window. Or MRTG will die\n"; -# require Win32::Console; -# my $CONSOLE = new Win32::Console; - # detach process from Console -# $CONSOLE->Flush(); -# $CONSOLE->Free(); -# $CONSOLE->Alloc(); -# $CONSOLE->Mode() - } - elsif( $OS eq 'OS2') - { - require OS2::Process; - if (my_type() eq 'VIO'){ - $main::Cleanfile3 = $pidfile; - - print "MRTG detached. PID=".system(P_DETACH,$^X." ".$0." ".$cfgfile); - exit; - } - } else { - # Check out if there is another mrtg running before forking - if (defined $pidfile && open(READPID, "<$pidfile")){ - if (not eof READPID) { - chomp(my $input = <READPID>); # read process id in pidfile - if ($input && kill 0 => $input) {# oops - the pid actually exists - die "ERROR: I Quit! Another copy of mrtg seems to be running. Check $pidfile\n"; - } - } - close READPID; - } - - defined (my $pid = fork) or die "Can't fork: $!"; - if ($pid) { - exit; - } else { - if (defined $pidfile){ - $main::Cleanfile3 = $pidfile; - if (open(PIDFILE,">$pidfile")) { - print PIDFILE "$$\n"; - close PIDFILE; - } else { - warn "cannot write to $pidfile: $!\n"; - } - } - require 'POSIX.pm'; - POSIX::setsid() or die "Can't start a new session: $!"; - open STDOUT,'>/dev/null' or die "ERROR: Redirecting STDOUT to /dev/null: $!"; - open STDIN, '</dev/null' or die "ERROR: Redirecting STDIN from /dev/null: $!"; - } - } -} - -# Create a new SNMP target entry for the @$target array and return a -# reference to it -sub newSnmpTarg( $$ ) { - my $t = shift; # target string - my $if = shift; # interface match strings - my $targ = { }; # New target closure - $targ->{ Methode } = 'SNMP'; - $targ->{ Community } = $if->{ComStr}; - $targ->{ Host } = ( defined $if->{HostIPv6} ) ? $if->{HostIPv6} : $if->{HostName}; - $targ->{ SnmpOpt } = $if->{SnmpInfo}; - $targ->{ snmpoptions} = $if->{snmpoptions}; - $targ->{ Conversion } = ( defined $if->{ConvSub} ) ? $if->{ConvSub} : ''; - for my $i( 0..1 ) { - die 'ERROR: Malformed ', $i ? 'output ' : 'input ', "ifSpec in '$t'\n" - if not defined $if->{OID}[$i] and not defined $if->{Alt}[$i]; - $targ->{OID}[$i] = $if->{OID}[$i]; - if( defined $if->{Alt}[$i] ) { - if( defined $if->{Num}[$i] ) { - $targ->{IfSel}[$i] = 'If'; - $targ->{Key}[$i] = $if->{Num}[$i]; - } elsif( defined $if->{IP}[$i] ) { - $targ->{IfSel}[$i] = 'Ip'; - $targ->{Key}[$i] = $if->{IP}[$i]; - } elsif( defined $if->{Desc}[$i] ) { - $targ->{IfSel}[$i] = 'Descr'; - $targ->{Key}[$i] = $if->{Desc}[$i]; - } elsif( defined $if->{Name}[$i] ) { - $targ->{IfSel}[$i] = 'Name'; - $targ->{Key}[$i] = $if->{Name}[$i]; - } elsif( defined $if->{Eth}[$i] ) { - $targ->{IfSel}[$i] = 'Eth'; - $targ->{Key}[$i] = join( '-', map( { sprintf '%02x', hex $_ } split( /-/, $if->{Eth}[$i] ) ) ); - } elsif( defined $if->{Type}[$i] ) { - $targ->{IfSel}[$i] = 'Type'; - $targ->{Key}[$i] = $if->{Type}[$i]; - } else { - die "ERROR: Internal error parsing ifSpec in '$t'\n"; - } - } else { - $targ->{IfSel}[$i] = 'None'; - $targ->{Key}[$i] = ''; - } - # Remove escaped characters and trailing space from Descr or Name Key - $targ->{Key}[$i] =~ s/\\([\s:&@])/$1/g - if $targ->{IfSel}[$i] eq 'Descr' or $targ->{IfSel}[$i] eq 'Name'; - $targ->{Key}[$i] =~ s/[\0- ]+$//; - } - # Remove escaped characters from community - $targ->{ Community } =~ s/\\([ @])/$1/g; - return $targ; # Return new target closure -} - -# ( $string, $unique ) = targparser( $string, $target, $targIndex, $ipv4only ) -# Walk amd analyze the target string $string. $target is a reference to the -# array of targets being built. $targIndex is a reference to a hash of targets -# previously encountered indexed by target string. When $ipv4only is nonzero, -# only IPv4 is in use. Returns the modifed target string and the index of the -# @$target array to which the target refers if that index is unique. If the -# index is not unique, i.e. the target definition is a calculation involving -# two or more different targets, then the value -1 is returned for $unique. -# Targparser updates the target array avoiding duplicate targets. The goal is -# to substitute all target definitions with strings of the form -# "$t1$thisTarg$t2", where $thisTarg is the target index, and $t1 and $t2 are -# as defined below. The intended result is a target string that can be eval'ed -# in its entirety later on when monitoring data has been collected. This -# evaluation occurs in sub getcurrent in the main mrtg script. - -# Note: In the regular expressions in &targparser, we have avoided m/.../i -# and the variables &`, $&, and $'. Use of these makes regex processing less -# efficient. See Friedl, J.E.F. Mastering Regular Expressions. O'Reilly. -# p. 273 - -sub targparser( $$$$$ ) { - # Target string (int:community@router, etc.) - my $string = shift; - # Reference to target array - my $target = shift; - # Reference to target index hash - my $targIndex = shift; - # Nonzero if only IPv4 is in use - my $ipv4only = shift; - # options passed per target. - my $snmpoptions = shift; - - # Next available index in the @$target array - my $idx = @$target; - # Common match strings: pre-target, target, post-target - my( $pre, $t, $post ); - # Portion of string already parsed - my $parsed = ''; - # Initialize $unique to undefined. It will take on the $targIndex value - # of the first target encountered. $otherTargCount will count the - # number of other targets (targets with different values of $targIndex) - # encountered during the parse. $unique will be returned as undef - # unless $otherTargCount remains 0. - my $unique = -1; - my $otherTargCount = 0; - - # Components of the target expression that are substituted into the - # target string each time a target is identified. The substitution - # string is the interpolated value of "$t1$targIndex$t2". At present - # $t1 and $t2 are set to create a new BigFloat object. -# my $t1 = ' Math::BigFloat->new($target->['; -# my $t2 = ']{$mode}) '; - # this gives problems with perl 5.005 so bigfloat is introduces in mrtg itself - my $t1 = ' $target->['; - my $t2 = ']{$mode} '; - - # Find and substitute all external program targets - while( ( $pre, $t, $post ) = $string =~ m< - ^(.*?) # capture pre-target string - ` # beginning of program target - ((?:\\`|[^`])+) # capture target contents (\` allowed) - ` # end of program target - (.*)$ # capture post-target string - >x ) { # Total of 3 captures - my $thisTarg; - if( exists $targIndex->{ $t } ) { - # This program target has been encountered previously - $thisTarg = $targIndex->{ $t }; - debug( 'tarp', "Existing program target [$thisTarg]" ); - } else { - # A new program target is needed - my $targ = { }; - $targ->{ Methode } = 'EXEC'; - $targ->{ Command } = $t; - # Remove escaped backticks - $targ->{ Command } =~ s/\\\`/\`/g; - $target->[ $idx ] = $targ; - $thisTarg = $idx++; - $targIndex->{ $t } = $thisTarg; - debug( 'tarp', "New program target [$thisTarg] '$t'" ); - } - $parsed .= "$pre$t1$thisTarg$t2"; - $string = $post; - if( $unique < 0 ) { - $unique = $thisTarg; - } else { - $otherTargCount++ unless $thisTarg == $unique; - } - }; - # Reset $string for new target type search - $string = $parsed . $string; - $parsed = ''; - debug( 'tarp', "&targparser external done: '$string'" ); - - # Common interface specification regex components - - # Simple interface specification regex component. Matches interface - # specification by IPv4 address, description, name, Ethernet address, or - # type. - my $ifSimple = - ' (\d+)|' . # by number ($if->{Num}) - ' / (\d+(?:\.\d+)+)|' . # by IPv4 address ($if->{IP}) - ' \\\\ ((?:\\\\[\s:&@]|[^\s:&@])+)|' . # by description (allow \ \: \& \@) ($if->{Desc}) - ' \# ((?:\\\\[\s:&@]|[^\s:&@])+)|' . # by name (allow \ \: \& \@) ($if->{Name}) - ' ! ([a-fA-F0-9]+(?:-[a-fA-F0-9]+)+)|' . # by Ethernet address ($if->{Eth}) - ' % (\d+)'; # by type ($if->{Type}) - - # Complex interface specification regex component. Note that a null string - # will match. Therefore the match must be postprocessed to check that - # $ifOID and $ifAlt are not both null. - my $ifComplex = - '([-a-zA-Z0-9]*(?:\.\d+)*?)' . # OID possibly starting with a MIB name ($if->{OID}) - '(' . # Interface specification alternatives: ($if->{Alt}) - '\.' . # separator - $ifSimple . # simple alternatives (6 variables) - ')?'; # maybe none of the above - - # Community-host interface specification regex component. - my $ifComHost = - '((?:\\\\[@ ]|[^\s@])+)' . # community string ('\@' and '\ ' allowed) ($if->{ComStr}) - '@' . # separator - '(?:(\[[a-fA-F0-9:]*\])|' . # hostname as IPv6 address ($if->{HostIPv6}) - '([-\w]+(?:\.[-\w]+)*))' . # or DNS name ($if->{HostName}) - '((?::[\d.!]*)*)' . # SNMP session configuration ($if->{SnmpInfo}) - '(?:\|([a-zA-Z_][\w]*))?'; # numeric conversion subroutine ($if->{ConvSub}) - - # Match strings for simple and complex interface specifications. Entries - # are of the form $if->{k1}[i], where k1 is OID, Alt, Num, IP, Desc, - # Name, Eth, or Type, and i is 0 or 1 (input or output). Entries may also - # have the form $if->{k1}, where k1 is Rev, ComStr, HostIPv6, HostName, - # SnmpInfo, or ConvSub, with no [i] in these cases. - my $if; - - # Find and substitute all complex OID targets - - while( ( $pre, $t, $if->{OID}[0], $if->{Alt}[0], $if->{Num}[0], - $if->{IP}[0], $if->{Desc}[0], $if->{Name}[0], $if->{Eth}[0], - $if->{Type}[0], $if->{OID}[1], $if->{Alt}[1], $if->{Num}[1], - $if->{IP}[1], $if->{Desc}[1], $if->{Name}[1], $if->{Eth}[1], - $if->{Type}[1], $if->{ComStr}, $if->{HostIPv6}, $if->{HostName}, - $if->{SnmpInfo}, $if->{ConvSub}, $post ) = $string =~ m< - ^(.*?) # capture pre-target string - ( # capture entire target - ${ifComplex} # input interface specification (8 captures) - & # separator - ${ifComplex} # output interface specification (8 captures) - : # separator - ${ifComHost} # community-host specification (5 captures) - ) # end of entire target capture - (.*)$ # capture post-target string - >x ) { # Total of 24 captures - my $thisTarg; - # Exception: skip and try to parse later as a simple target if - # $if->{Desc}[0], $if->{Name}[0], $if->{Desc}[1], or $if->{Name}[1] - # ends with a backslash character - if( ( defined $if->{Desc}[0] and $if->{Desc}[0] =~ m<\\$> ) or - ( defined $if->{Name}[0] and $if->{Name}[0] =~ m<\\$> ) or - ( defined $if->{Desc}[1] and $if->{Desc}[1] =~ m<\\$> ) or - ( defined $if->{Name}[1] and $if->{Name}[1] =~ m<\\$> ) ) { - $parsed .= "$pre$t"; - $string = $post; - next; - } - if( exists $targIndex->{ $t } ) { - # This complex target has been encountered previously - $thisTarg = $targIndex->{ $t }; - debug( 'tarp', "Existing complex target [$thisTarg]" ); - } else { - # A new complex target is needed - my $targ = newSnmpTarg( $t, $if ); - $targ->{ ipv4only } = $ipv4only; - $targ->{ snmpoptions } = $snmpoptions; - $target->[ $idx ] = $targ; - $thisTarg = $idx++; - $targIndex->{ $t } = $thisTarg; - debug( 'tarp', "New complex target [$thisTarg] '$t':\n" . - " Comu: $targ->{Community}, Host: $targ->{Host}\n" . - " Opt: $targ->{SnmpOpt}, IPv4: $targ->{ipv4only}\n" . - " Conv: $targ->{Conversion}\n" . - " OID: $targ->{OID}[0], $targ->{OID}[1]\n" . - " IfSel: $targ->{IfSel}[0], $targ->{IfSel}[1]\n" . - " Key: $targ->{Key}[0], $targ->{Key}[1]" ); - } - $parsed .= "$pre$t1$thisTarg$t2"; - $string = $post; - if( $unique < 0 ) { - $unique = $thisTarg; - } else { - $otherTargCount++ unless $thisTarg == $unique; - } - } - # Reset $string and $parsedfor new target type search - $string = $parsed . $string; - $parsed = ''; - debug( 'tarp', "&targparser complex done: '$string'" ); - - # Find and substitute all simple targets - - while( ( $pre, $t, $if->{Rev}, $if->{Num}[0], $if->{IP}[0], - $if->{Desc}[0], $if->{Name}[0], $if->{Eth}[0], $if->{Type}[0], - $if->{ComStr}, $if->{HostIPv6}, $if->{HostName}, $if->{SnmpInfo}, - $if->{ConvSub}, $post ) = $string =~ m< - ^(.*?) # capture pre-target string - ( # capture entire target - (-)? # capture direction reversal - (?: ${ifSimple} ) # simple interface specification (6 captures) - : # separator - ${ifComHost} # community-host specification (5 captures) - ) # end of entire target capture - (.*)$ # capture post-target string - >x ) { # Total of 15 captures - my $thisTarg; - if( exists $targIndex->{ $t } ) { - # This simple target has been encountered previously - $thisTarg = $targIndex->{ $t }; - debug( 'tarp', "Existing simple target [$thisTarg]" ); - } else { - # A new simple target is needed - # Reverse interface directions if indicated by $if->{Rev}. - # The sense of $d1 and $d2 is 0 for input and 1 for output - my $d1 = ( defined $if->{Rev} and $if->{Rev} eq '-' ) ? 1 : 0; - my $d2 = 1 - $d1; - # Set the OIDs depending on whether SNMPv2 has been specified - # and on the direction - if( $if->{SnmpInfo} =~ m/(?::[^:]*){4}:[32][Cc]?/ ) { - $if->{OID}[$d1] = 'ifHCInOctets'; - $if->{OID}[$d2] = 'ifHCOutOctets'; - } else { - $if->{OID}[$d1] = 'ifInOctets'; - $if->{OID}[$d2] = 'ifOutOctets'; - } - # Give $if->{Alt}[i] an arbitrary defined value so that - # &newSnmpTarg works correctly - $if->{Alt}[0] = 1; - $if->{Alt}[1] = 1; - # Copy input specification to output - $if->{Num}[1] = $if->{Num}[0]; - $if->{IP}[1] = $if->{IP}[0]; - $if->{Desc}[1] = $if->{Desc}[0]; - $if->{Name}[1] = $if->{Name}[0]; - $if->{Eth}[1] = $if->{Eth}[0]; - $if->{Type}[1] = $if->{Type}[0]; - my $targ = newSnmpTarg( $t, $if ); - $targ->{ snmpoptions} = $snmpoptions; - $targ->{ ipv4only } = $ipv4only; - $target->[ $idx ] = $targ; - $thisTarg = $idx++; - $targIndex->{ $t } = $thisTarg; - debug( 'tarp', "New simple target [$thisTarg] '$t':\n" . - " Comu: $targ->{Community}, Host: $targ->{Host}\n" . - " Opt: $targ->{SnmpOpt}, IPv4: $targ->{ipv4only}\n" . - " Conv: $targ->{Conversion}\n" . - " OID: $targ->{OID}[0], $targ->{OID}[1]\n" . - " IfSel: $targ->{IfSel}[0], $targ->{IfSel}[1]\n" . - " Key: $targ->{Key}[0], $targ->{Key}[1]" ); - } - $parsed .= "$pre$t1$thisTarg$t2"; - $string = $post; - if( $unique < 0 ) { - $unique = $thisTarg; - } else { - $otherTargCount++ unless $thisTarg == $unique; - } - } - # Assemble string to be returned - $string = $parsed . $string; - # Set $unique undefined if more than one target is referred to in the - # target string - $unique = -1 if $otherTargCount; - debug( 'tarp', "&targparser simple done: '$string'" ); - debug( 'tarp', "&targparser returning: unique = $unique" ); - return ( $string, $unique ); -} - -# Display of &targparser intermediate values for debugging purposes. Call as -# showMatch( $string, $pre, $t, $post, $if ) from within &targparser. -sub showMatch( $$$$$ ) { - my( $string, $pre, $t, $post, $if ) = @_; - warn "# Matching on string '$string'\n"; - warn "# Prematch: '$pre'\n"; - warn "# Target: '$t'\n"; - warn "# Postmatch: '$post'\n"; - warn "# Captured:\n"; - foreach my $k( keys %$if ) { - if( ref( $if->{$k} ) eq 'ARRAY' ) { - warn "# \$if->{$k}[0,1]: '", - ( defined $if->{$k}[0] ) ? $if->{$k}[0] : 'undef', "', '", - ( defined $if->{$k}[1] ) ? $if->{$k}[1] : 'undef', "'\n"; - } else { - warn "# \$if->{$k}: '", - ( defined $if->{$k} ) ? $if->{$k} : 'undef', "'\n"; - } - } -} - -sub readconfcache ($) { - my $cfgfile = shift; - my %confcache; - if (open (CFGOK,"<$cfgfile")) { - while (<CFGOK>) { - chomp; - next unless /\t/; #ignore odd lines - next if /^\S+:/; #ignore legacy lines - my ($host,$method,$key,$if) = split (/\t/, $_); - $key =~ s/[\0- ]+$//; # no trailing whitespace in keys realy ! - $key =~ s/[\0- ]/ /g; # all else becomes a normal space ... get a life - $confcache{$host}{$method}{$key} = $if; - } - close CFGOK; - } - return \%confcache; -} - -sub writeconfcache ($$) { - my $confcache = shift; - my $cfgfile = shift; - if ($cfgfile ne '&STDOUT'){ - open (CFGOK,">$cfgfile") or die "ERROR: writing $cfgfile.ok: $!"; - } - my @hosts; - if (defined $$confcache{___updated}) { - @hosts = @{$$confcache{___updated}} ; - delete $$confcache{___updated}; - } else { - @hosts = grep !/^___/, keys %{$confcache} - } - foreach my $host (sort @hosts) { - foreach my $method (sort keys %{$$confcache{$host}}) { - foreach my $key (sort keys %{$$confcache{$host}{$method}}) { - if ($cfgfile ne '&STDOUT'){ - print CFGOK "$host\t$method\t$key\t". - $$confcache{$host}{$method}{$key},"\n"; - } else { - print "$host\t$method\t$key\t". - $$confcache{$host}{$method}{$key},"\n"; - } - } - } - } - close CFGOK; -} - -sub cleanhostkey ($){ - my $host = shift; - return undef unless defined $host; - $host =~ s/(:\d*)(?:(:\d*)(?:(:\d*)(?:(:\d*)(?:(:\d*)))))$/$1$5/ - or - $host =~ s/(:\d*)(?:(:\d*)(?:(:\d*)(?:(:\d*)?)?)?)$/$1/; - $host =~ s/:/_/g; # make sure that double invocations do not kill us - return $host; -} - -sub storeincache ($$$$$){ - my($confcache,$host,$method,$key,$value) = @_; - $host = cleanhostkey $host; - if (not defined $value ){ - $$confcache{$host}{$method}{$key} = undef; - return; - } - $value =~ s/[\0- ]/ /g; # all else becomes a normal space ... get a life - $value =~ s/ +$//; # no trailing spaces - if (defined $$confcache{$host}{$method}{$key} and - $$confcache{$host}{$method}{$key} ne $value) { - $$confcache{$host}{$method}{$key} = "Dup"; - debug('coca',"store in confcache $host $method $key --> $value (duplicate)"); - } else { - $$confcache{$host}{$method}{$key} = $value; - debug('coca',"store in confcache $host $method $key --> $value"); - } - -} - -sub readfromcache ($$$$){ - my($confcache,$host,$method,$key) = @_; - $host = cleanhostkey $host; - return $$confcache{$host}{$method}{$key}; -} - - -sub clearfromcache ($$){ - my($confcache,$host) = @_; - $host = cleanhostkey $host; - delete $$confcache{$host}; - debug('coca',"clear confcache $host"); -} - - -sub populateconfcache ($$$$$) { - my $confcache = shift; - my $host = shift; - my $ipv4only = shift; - my $reread = shift; - my $snmpoptions = shift || {}; - my $hostkey = cleanhostkey $host; - return if defined $$confcache{$hostkey} and not $reread; - my $snmp_errlevel = $SNMP_Session::suppress_warnings; - $SNMP_Session::suppress_warnings = 3; - debug('coca',"populate confcache $host"); - - # clear confcache for host; - delete $$confcache{$hostkey}; - - my @ret; - my %tables = ( ifDescr => 'Descr', - ifName => 'Name', - ifType => 'Type', - ipAdEntIfIndex => 'Ip' ); - my @nodes = qw (ifName ifDescr ifType ipAdEntIfIndex); - # it seems that some devices only give back sensible data if their tables - # are walked in the right ordere .... - foreach my $node (@nodes) { - next if $confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300; - $SNMP_Session::errmsg = undef; - @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, $node); - unless ( $SNMP_Session::errmsg){ - foreach my $ret (@ret) - { - my ($oid, $desc) = split(':', $ret, 2); - if ($tables{$node} eq 'Ip') { - storeincache($confcache,$host,$tables{$node},$oid,$desc); - } else { - $desc =~ s/[\0- ]+$//; #trailing whitespace is too sick for us - $desc =~ s/[\0- ]/ /g; #whitespace is just whitespace - storeincache($confcache,$host,$tables{$node},$desc,$oid); - } - }; - } else { - $confcache->{___deadhosts}{$hostkey} = time - if $SNMP_Session::errmsg =~ /no response received/; - debug('coca',"Skipping $node scanning because $host does not seem to support it"); - } - } - if ($confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300){ - $SNMP_Session::suppress_warnings = $snmp_errlevel; - return; - } - $SNMP_Session::errmsg = undef; - @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, "ifPhysAddress"); - unless ( $SNMP_Session::errmsg){ - foreach my $ret (@ret) - { - my ($oid, $bin) = split(':', $ret, 2); - my $eth = unpack 'H*', $bin; - my @eth; - while ($eth =~ s/^..//){ - push @eth, $&; - } - my $phys=join '-', @eth; - storeincache($confcache,$host,"Eth",$phys,$oid); - } - } else { - debug('coca',"Skipping ifPhysAddress scanning because $host does not seem to support it"); - } - - if (ref $$confcache{___updated} ne 'ARRAY') { - $$confcache{___updated} = []; #init to empty array - } - push @{$$confcache{___updated}}, $hostkey; - - $SNMP_Session::suppress_warnings = $snmp_errlevel; -} - -sub log2rrd ($$$) { - my $router = shift; - my $cfg = shift; - my $rcfg = shift; - my %mark; - my %incomp; - my %elapsed_time; - my %rate; - my %store; - my %first_step; - my %cur; - my %next; - my $rrd; - my @steps = qw(300 1800 7200 86400); - my %sizes = ( 300 => 600, 1800 => 700, 7200 => 775, 86400 => 797); - - open R, "<$$cfg{logdir}$$rcfg{'directory'}{$router}$router.log" or - die "ERROR: opening $$cfg{logdir}$$rcfg{'directory'}{$router}$router.log: $!"; - debug('rrd',"converting $$cfg{logdir}$$rcfg{'directory'}{$router}$router.log"); - my $latest_timestamp; - my %latest_counter; - chomp($_ = <R>); - my $time; - my $next_time; - ($latest_timestamp,$latest_counter{in},$latest_counter{out}) = split /\s+/; - chomp($_ = <R>); - ($time,$cur{in},$cur{out},$cur{maxin},$cur{maxout}) = split /\s+/; - - foreach my $s (@steps) { - $mark{$s} = $latest_timestamp - ($latest_timestamp % $s) + $s; - $first_step{$s} = $latest_timestamp - ($mark{$s} - $s); - $elapsed_time{$s} = $s - $first_step{$s}; - $rate{in}{$s}=$cur{in}; - $rate{out}{$s}=$cur{out}; - $rate{maxin}{$s}=$cur{maxin}; - $rate{maxout}{$s}=$cur{maxout}; - } - - while(<R>){ - chomp; - ($next_time,$next{in},$next{out},$next{maxin},$next{maxout}) = - split /\s+/; - foreach my $s (@steps) { - # bail if we have enough entries - next if ref $store{in}{$s} and - scalar @{$store{in}{$s}} > $sizes{$s}; - - # ok we are still here. If next mark is before the next time - # we take a short step, else we gobble up - my $next_stop; - do { - if ($elapsed_time{$s} + $time - $next_time > $s) { - $next_stop = $mark{$s}-$s; - } else { - $next_stop = $next_time; - } - my $time_diff = $time-$next_stop; - foreach my $d (qw(in out)) { - $rate{$d}{$s} = ($rate{$d}{$s} * $elapsed_time{$s} - + $cur{$d} * $time_diff) / - ($elapsed_time{$s} + $time_diff); - } - foreach my $d (qw(maxin maxout)){ - $rate{$d}{$s} = $cur{$d} if $rate{$d}{$s} < $cur{$d}; - } - $elapsed_time{$s} += $time_diff; -# print "$time $next_stop\n" if $s == 300; - if ($next_stop == $mark{$s}-$s) { - foreach my $t (qw(in out maxin maxout)){ - $rate{$t}{$s}/=3600 - if (defined $$rcfg{'options'}{'perhour'}{$router}); - $rate{$t}{$s}/=60 - if (defined $$rcfg{'options'}{'perminute'}{$router}); - push @{$store{$t}{$s}}, int($rate{$t}{$s}); - } - $mark{$s} -= $s; - $rate{maxin}{$s} = 0; - $rate{maxout}{$s} = 0; - $elapsed_time{$s} = 0; - } - } while ($next_stop > $next_time ); - } - ($time,$cur{in},$cur{out},$cur{maxin},$cur{maxout}) = - ($next_time,$next{in},$next{out},$next{maxin},$next{maxout}); - } - close R; - # lets see if we have rrdtool 1.2 at our hands - my $VERSION = '0001'; - if ($RRDs::VERSION >= 1.2){ - $VERSION = '0003'; - } - my $DST; - my $pdprepin = (shift @{$store{in}{300}})*($first_step{300}); - my $pdprepout = (shift @{$store{out}{300}})*($first_step{300}); - - if (defined $$rcfg{'options'}{'absolute'}{$router}) { - $DST = 'ABSOLUTE' - } elsif (defined $$rcfg{'options'}{'gauge'}{$router}) { - $DST = 'GAUGE' - } else { - $DST = 'COUNTER' - } - - my $MHB = $$cfg{interval} * 60 * 2; - - my $MAX1 = - $$rcfg{'absmax'}{$router} - || $$rcfg{'maxbytes1'}{$router} - || 'U'; - - my $MAX2 = - $$rcfg{'absmax'}{$router} - || $$rcfg{'maxbytes2'}{$router} - || 'U'; - - $rrd = <<RRD; -<!-- MRTG Log converted to RRD --> -<rrd> - <version> $VERSION </version> - <step> 300 </step> - <lastupdate> $latest_timestamp </lastupdate> - - <ds> - <name> ds0 </name> - <type> $DST </type> - <minimal_heartbeat> $MHB </minimal_heartbeat> - <min> 0 </min> - <max> $MAX1 </max> - - <!-- PDP Status --> - <last_ds> $latest_counter{in} </last_ds> - <value> $pdprepin </value> - <unknown_sec> 0 </unknown_sec> - </ds> - - <ds> - <name> ds1 </name> - <type> $DST </type> - <minimal_heartbeat> $MHB </minimal_heartbeat> - <min> 0 </min> - <max> $MAX2 </max> - - <!-- PDP Status --> - <last_ds> $latest_counter{out} </last_ds> - <value> $pdprepout </value> - <unknown_sec> 0 </unknown_sec> - </ds> -RRD - $first_step{300} = 0; # invalidate - addarch(1,'AVERAGE','in','out',\%store,\%first_step,\$rrd); - addarch(6,'AVERAGE','in','out',\%store,\%first_step,\$rrd); - addarch(24,'AVERAGE','in','out',\%store,\%first_step,\$rrd); - addarch(288,'AVERAGE','in','out',\%store,\%first_step,\$rrd); - addarch(1,'MAX','maxin','maxout',\%store,\%first_step,\$rrd); - addarch(6,'MAX','maxin','maxout',\%store,\%first_step,\$rrd); - addarch(24,'MAX','maxin','maxout',\%store,\%first_step,\$rrd); - addarch(288,'MAX','maxin','maxout',\%store,\%first_step,\$rrd); - $rrd .= <<RRD; -</rrd> -RRD - - if ( $OS eq 'NT' or $OS eq 'OS2') { - open (R, "|$$cfg{rrdtool} restore - $$cfg{logdir}$$rcfg{'directory'}{$router}$router.rrd"); - } else { - open (R, "|-") or exec "$$cfg{rrdtool}","restore","-","$$cfg{logdir}$$rcfg{'directory'}{$router}$router.rrd"; - } - print R $rrd; - close R; -} - - -sub addarch($$$$$$$){ - my $steps = shift; - my $cons = shift; - my $in = shift; - my $out = shift; - my $store = shift; - my $first_step = shift; - my $rrd = shift; - my $cdpin = 'NaN'; - my $cdpout = 'NaN'; - - my $param_start = ''; - my $param_end = ''; - my $extra_ds = ''; - if ($RRDs::VERSION >= 1.2){ - $param_start = '<params>'; - $param_end = '</params>'; - $extra_ds = '<primary_value> 0.0000000000e+00 </primary_value> <secondary_value> 0.0000000000e+00 </secondary_value>'; - } - - if ($steps != 300) { - $cdpin = shift @{$$store{$in}{300*$steps}}; - $cdpout = shift @{$$store{$out}{300*$steps}}; - }; - $$rrd .= <<RRD; -<!-- Round Robin Archive --> - <rra> - <cf> $cons </cf> - <pdp_per_row> $steps </pdp_per_row> - $param_start <xff> 0.5 </xff> $param_end - <cdp_prep> - <ds>$extra_ds <value> $cdpin </value> <unknown_datapoints> 0 </unknown_datapoints></ds> - <ds>$extra_ds <value> $cdpout </value> <unknown_datapoints> 0 </unknown_datapoints></ds> - </cdp_prep> - - <database> -RRD - while (@{$$store{$in}{$steps*300}}){ - # we take zero as UNKNOWN - my $inr = pop @{$$store{$in}{$steps*300}} || 'NaN'; - my $outr = pop @{$$store{$out}{$steps*300}} || 'NaN'; - $$rrd .= <<RRD; - <row><v> $inr </v><v> $outr </v></row> -RRD - } - $$rrd .= <<RRD; - </database> - </rra> -RRD -} - - - - -# debug if the relevant debug tag is active print the debug message -sub debug ($$) { - return unless scalar @main::DEBUG; - my $tag = shift; - my $msg = shift; - return unless grep {$_ eq $tag} @main::DEBUG; - warn "--",$tag,": ",$msg,"\n"; - return; -} - -# timestamp -sub timestamp () { - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = - localtime(time); - $year += 1900; - $mon += 1; - return sprintf "%4d-%02d-%02d %02d:%02d:%02d", $year,$mon,$mday,$hour,$min,$sec; -} - -# configure __DIE__ and __WARN__ - -sub setup_loghandlers ($){ - $::global_logfile = $_[0]; - for($_[0]){ - /^eventlog$/i && do { - require Win32::EventLog; - $SIG{__WARN__} = sub { - my $EventLog = Win32::EventLog->new('MRTG'); - my $Type = ($_[0] =~ /warning/) ? - &Win32::EventLog::EVENTLOG_WARNING_TYPE : - &Win32::EventLog::EVENTLOG_INFORMATION_TYPE; - my $Msg = $_[0]; - $Msg =~ s/\n/\r\n/g; - $Msg =~ s/[\n\r]$//g; - $EventLog->Report({ - EventID => 1000, - Category => "WARN", - EventType => $Type, - Data => '', - Strings => $Msg }); - $EventLog->Close; - }; - $SIG{__DIE__} = sub { - my $EventLog = Win32::EventLog->new('MRTG'); - my $Msg = $_[0]; - $Msg =~ s/\n/\r\n/g; - $Msg =~ s/[\n\r]$//g; - $EventLog->Report({ - EventID => 1000, - Category => "ERROR", - EventType => &Win32::EventLog::EVENTLOG_ERROR_TYPE, - Data => '', - Strings => $Msg }); - $EventLog->Close; - exit 1; - }; - last; - }; - $SIG{__WARN__} = sub { - - if (open DEB, ">>$::global_logfile") { - print DEB timestamp." -- $_[0]"; - close DEB; - } else { - print STDERR timestamp." -- $_[0]" - } - }; - - - $SIG{__DIE__} = sub { - - if ( open DEB, ">>$::global_logfile") { - print DEB timestamp." -- $_[0]"; - close DEB; - } else { - print STDERR timestamp." -- $_[0]" - } - exit 1 - }; - - } -} - -# Adds the v4only attribute to a target if the caller requests it. -# (this includes targets specified using numeric IPv6 addresses...) -sub v4onlyifnecessary ($$) { - my $target = shift; - my $add = shift; - my ($v6addr, $temptarget); - - if($add) { - # Catch numeric IPv6 addresses - if ( $target =~ /(\[[\w:]*\])(.*)/) { - ($v6addr, $temptarget) = ($1,$2); - } else { - $temptarget = $target; - } - return $target.(":" x (5 - ($temptarget =~ tr/://))).":v4only"; - } else { - return $target; - } -} -__END__ - -=pod - -=head1 NAME - -MRTG_lib.pm - Library for MRTG and support scripts - -=head1 SYNOPSIS - - use MRTG_lib; - my ($configfile, @target_names, %globalcfg, %targetcfg); - readcfg($configfile, \@target_names, \%globalcfg, \%targetcfg); - my (@parsed_targets); - cfgcheck(\@target_names, \%globalcfg, \%targetcfg, \@parsed_targets); - -=head1 DESCRIPTION - -MRTG_lib is part of MRTG, the Multi Router Traffic Grapher. It was separated -from MRTG to allow other programs to easily use the same config files. The -main part of MRTG_lib is the config file parser but some other funcions are -there too. - -=over 4 - -=item C<$MRTG_lib::OS> - -Type of OS: WIN, UNIX, VMS - -=item C<$MRTG_lib::SL> - -I<Slash> in the current OS. - -=item C<$MRTG_lib::PS> - -Path separator in PATH variable - -=item C<readcfg> - -C<readcfg($file, \@targets, \%globalcfg, \%targetcfg [, $prefix, \%extrules])> - -Reads a config file, parses it and fills some arrays and hashes. The -mandatory arguments are: the name of the config file, a ref to an array which -will be filled with a list of the target names, a hashref for the global -configuration, a hashref for the target configuration. - -The configuration file syntax is: - - globaloption: value - targetoption[targetname]: value - aprefix*extglobal: value - aprefix*exttarget[target2]: value - -E.g. - - workdir: /var/stat/mrtg - target[router1]: 2:public@router1.local.net - 14all*columns: 2 - -The global config hash has the structure - - $globalcfg{configoption} = 'value' - -The target config hash has the structure - - $targetcfg{configoption}{targetname} = 'value' - -See L<mrtg-reference> for more information about the MRTG configuration syntax. - -C<readcfg> can take two additional arguments to extend the config file -syntax. This allows programs to put their configuration into the mrtg config -file. The fifth argument is the prefix of the extension, the sixth argument -is a hash with the checkrules for these extension settings. E.g. if the -prefix is "14all" C<readcfg> will check config lines that begin with -"14all*", i.e. all lines like - - 14all*columns: 2 - 14all*graphsize[target3]: 500 200 - -against the rules in %extrules. The format of this hash is: - - $extrules{option} = [sub{$_[0] =~ m/^\d+$/}, sub{"Error message for $_[0]"}] - i.e. - $extrules{option}[0] -> a test expression - $extrules{option}[1] -> error message if test fails - -The first part of the array is a perl expression to test the value of the -option. The test can access this value in the variable "$arg". The second -part of the array is an error message to display when the test fails. The -failed value can be integrated by using the variable "$arg". - -Config settings with an different prefix than the one given in the C<readcfg> -call are not checked but inserted into I<%globalcfg> and I<%targetcfg>. -Prefixed settings keep their prefix in the config hashes: - - $targetcfg{'14all*graphsize'}{'target3'} = '500 200' - -=item C<cfgcheck> - -C<cfgcheck(\@target_names, \%globalcfg, \%targetcfg, \@parsed_targets)> - -Checks the configuration read by C<readcfg>. Checks the values in the config -for syntactical and/or semantical errors. Sets defaults for some options. -Parses the "target[...]" options and filles the array @parsed_targets ready -for mrtg functions. - -The first three arguments are the same as for C<readcfg>. The fourth argument -is an arrayref which will be filled with the parsed target defs. - -C<cfgcheck> converts the values of target settings I<options>, e.g. - - options[router1]: bits, growright - -to a hash: - - $targetcfg{'option'}{'bits'}{'router1'} = 1 - $targetcfg{'option'}{'growright'}{'router1'} = 1 - -This is not done by C<readcfg> so if you don't use C<cfgcheck> you have to -check the scalar variable I<$targetcfg{'option'}{'router1'}> (MRTG allows -options to be separated by space or ','). - -=item C<ensureSL> - -C<ensureSL(\$pathname)> - -Checks that the I<pathname> does not contain double path separators and ends -with a path separator. It uses $MRTG_lib::SL as path separator which will be / -or \ depending on the OS. - -=item C<log2rrd> - -C<log2rrd ($router,\%globalcfg,\%targetcfg)> - -Convert log file to rrd format. Needs rrdtool. - -=item C<datestr> - -C<datestr(time)> - -Returns the time given in the argument as a nicely formated date string. -The argument has to be in UNIX time format (seconds since 1970-1-1). - -=item C<timestamp> - -C<timestamp()> - -Return a string representing the current time. - -=item C<setup_loghandlers> - -C<setup_loghandlers(filename)> - -Install signalhandlers for __DIE__ and __WARN__ making the errors -go the the specified destination. If filename is 'eventlog' -mrtg will log to the windows event logger. - -=item C<expistr> - -C<expistr(time)> - -Returns the time given in the argument formatted suitable for HTTP -Expire-Headers. - -=item C<create_pid> - -C<create_pid()> - -Creates a pid file for the mrtg daemon - -=item C<demonize_me> - -C<demonize_me()> - -Puts the running program into background, detaching it from the terminal. - -=item C<populatecache> - -C<populatecache(\%confcache, $host, $reread, $snmpoptshash)> - -Reads the SNMP variables I<ifDescr>, I<ipAdEntIfIndex>, I<ifPhysAddress>, I<ifName> from -the I<host> and stores the values in I<%confcache> as follows: - - $confcache{$host}{'Descr'}{ifDescr}{oid} = (ifDescr or 'Dup') - $confcache{$host}{'IP'}{ipAdEntIfIndex}{oid} = (ipAdEntIfIndex or 'Dup') - $confcache{$host}{'Eth'}{ifPhysAddress}{oid} = (ifPhysAddress or 'Dup') - $confcache{$host}{'Name'}{ifName}{oid} = (ifName or 'Dup') - $confcache{$host}{'Type'}{ifType}{oid} = (ifType or 'Dup') - -The value (at the right side of =) is 'Dup' if a value was retrieved -muliple times, the retrieved value else. - -=item C<readconfcache> - -C<my $confcache = readconfcache($file)> - -Preload the confcache from a file. - -=item C<readfromconfcache> - -C<writeconfcache($confcache,$file)> - -Store the current confcache into a file. - -=item C<writeconfcache> - -C<writeconfcache($confcache,$file)> - -Store the current confcache into a file. - -=item C<storeincache> - -C<storeincache($confcache,$host,$method,$key,$value)> - -=item C<readfromcache> - -C<readfromcache($confcache,$host,$method,$key)> - -=item C<clearfromcache> - -C<clearfromcache($confcache,$host)> - -=item C<debug> - -C<debug($type, $message)> - -Prints the I<message> on STDERR if debugging is enabled for type I<type>. -A debug type is enabled if I<type> is in array @main::DEBUG. - -=back - -=head1 AUTHORS - -Rainer Bawidamann E<lt>Rainer.Bawidamann@rz.uni-ulm.deE<gt> - -(This Manpage) - -=cut diff -Nru mrtg-2.14.7/debian/patches/ipacc.diff mrtg-2.16.1/debian/patches/ipacc.diff --- mrtg-2.14.7/debian/patches/ipacc.diff 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/patches/ipacc.diff 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -91c91 -< $exec_line="$ipfwadm -A out -a -P $prot -S $source_ip $source_port -D $dest_ip $dest_port; $ipfwadm -A in -a -P $prot -S $dest_ip $dest_port -D $source_ip $source_port"; ---- -> $exec_line="$ipfwadm -A in -a -P $prot -S $source_ip $source_port -D $dest_ip $dest_port; $ipfwadm -A out -a -P $prot -S $dest_ip $dest_port -D $source_ip $source_port"; diff -Nru mrtg-2.14.7/debian/po/cs.po mrtg-2.16.1/debian/po/cs.po --- mrtg-2.14.7/debian/po/cs.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/cs.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-07-21 22:00+0200\n" "Last-Translator: Miroslav Jezbera <jezberam@phoenix.inf.upol.cz>\n" "Language-Team: Czech <provoz@debian.cz>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Spouštět MRTG pod jeho vlastním uživatelem?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -45,13 +45,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "Udělat MRTG vlastníkem /etc/mrtg.cfg a jediným, kdo ho může číst?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -64,7 +64,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/da.po mrtg-2.16.1/debian/po/da.po --- mrtg-2.14.7/debian/po/da.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/da.po 2008-05-10 19:05:47.000000000 +0100 @@ -13,8 +13,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg debconf\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-01-16 11:34+0100\n" "Last-Translator: Claus Hindsgaul <claus_h@image.dk>\n" "Language-Team: Danish <dansk@klid.dk>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Křr MRTG som sin egen bruger?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,13 +46,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "Begrćns lćseadgang til /etc/mrtg.cfg til MRTG-brugeren?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -64,7 +64,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/de.po mrtg-2.16.1/debian/po/de.po --- mrtg-2.14.7/debian/po/de.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/de.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: lsh-utils\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-03-01 23:23-0800\n" "Last-Translator: Sebastian Feltel <sebastian@feltel.org>\n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "MRTG als eigener Benutzer ausführen?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,13 +46,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "Datei /etc/mrtg.cfg mit dem Eigner mrtg erstellen?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -64,7 +64,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/es.po mrtg-2.16.1/debian/po/es.po --- mrtg-2.14.7/debian/po/es.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/es.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-03-01 23:23-0800\n" "Last-Translator: Carlos Valdivia YagĂźe <valyag@teleline.es>\n" "Language-Team: Spanish <debian-l10n-spanish@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "żEjecutar MRTG con su propio usuario?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -45,13 +45,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "żHacer que /etc/mrtg.cfg sólo sea legible por el usuario MRTG?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -64,7 +64,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/eu.po mrtg-2.16.1/debian/po/eu.po --- mrtg-2.14.7/debian/po/eu.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/eu.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg_2.10.13-1.1_templates\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-01-17 17:58+0100\n" "Last-Translator: Piarres Beobide <pi@beobide.net>\n" "Language-Team: Librezale.org <librezale@librezale.org>\n" @@ -26,13 +26,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "MRTG bere erabiltzaileaz abiarazi?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -47,15 +47,15 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" -"/etc/mrtg.cfg MRTG erabiltzailearen jabetzara eta berak bakarrik irakur " -"ahal izateko egin?" +"/etc/mrtg.cfg MRTG erabiltzailearen jabetzara eta berak bakarrik irakur ahal " +"izateko egin?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -67,7 +67,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/fi.po mrtg-2.16.1/debian/po/fi.po --- mrtg-2.14.7/debian/po/fi.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/fi.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-01-15 14:52+0200\n" "Last-Translator: Tommi Vainikainen <thv+debian@iki.fi>\n" "Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Aja MRTG omana käyttäjänään?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,7 +46,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" "Asetetaanko /etc/mrtg.cfg omistajaksi ja ainoastaan luettavaksi MRTG-" @@ -54,7 +54,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -66,7 +66,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/fr.po mrtg-2.16.1/debian/po/fr.po --- mrtg-2.14.7/debian/po/fr.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/fr.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-04-09 07:49+0100\n" "Last-Translator: Christian Perrier <bubulle@debian.org>\n" "Language-Team: French <debian-l10n-french@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "MRTG doit-il ętre exécuté sans privilčge ?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,7 +46,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" "Le fichier /etc/mrtg.cfg doit-il ętre réservé ŕ l'utilisateur de MRTG ?" @@ -71,7 +71,7 @@ # > - ia64 netboot installs broken #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -84,7 +84,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/gl.po mrtg-2.16.1/debian/po/gl.po --- mrtg-2.14.7/debian/po/gl.po 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/debian/po/gl.po 2008-05-10 19:05:47.000000000 +0100 @@ -0,0 +1,66 @@ +# Galician translation of mrtg's debconf templates +# This file is distributed under the same license as the mrtg package. +# Jacobo Tarrio <jtarrio@debian.org>, 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: mrtg\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" +"PO-Revision-Date: 2007-02-27 09:16+0100\n" +"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n" +"Language-Team: Galician <proxecto@trasno.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mrtg.templates:1001 +msgid "Run MRTG with its own user?" +msgstr "ÂżExecutar MRTG co seu propio usuario?" + +#. Type: boolean +#. Description +#: ../mrtg.templates:1001 +msgid "" +"Traditionally, MRTG runs as root, but this can present a potential security " +"risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " +"will be used instead. If you have existing programs that read any of MRTG's " +"output files, you may need to update them." +msgstr "" +"Tradicionalmente, MRTG execĂştase coma administrador, pero isto pode " +"presentar un potencial risco de seguridade. Se decide que MRTG se execute co " +"seu propio usuario, hase empregar un usuario chamado \"mrtg\". Se ten " +"programas xa existentes que lean algĂşn dos ficheiros de saĂ­da de MRTG, ha " +"ter que os actualizar." + +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 +msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" +msgstr "" +"ÂżFacer que /etc/mrtg.cfg pertenza e sexa sĂł lexible ao usuario de MRTG?" + +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 +msgid "" +"If your MRTG configuration file is readable by users other than the user " +"MRTG runs as (typically either 'mrtg' or 'root') it can present a security " +"risk, as this file contains SNMP community names." +msgstr "" +"Se o seu ficheiro de configuraciĂłn de MRTG ĂŠ lexible por usuarios distintos " +"do usuario co que se executa MRTG (habitualmente \"mrtg\" ou \"root\"), isto " +"pode presentar un risco de seguridade, xa que este ficheiro contĂŠn nomes de " +"comunidades SNMP." + +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 +msgid "" +"It is recommended that you make the file owned by and readable only by the " +"MRTG user, unless you have specific reasons not to." +msgstr "" +"RecomĂŠndase que faga que este ficheiro pertenza ao usuario de MRTG e sĂł sexa " +"lexible para el, a menos que teĂąa bos motivos para non o facer." diff -Nru mrtg-2.14.7/debian/po/ja.po mrtg-2.16.1/debian/po/ja.po --- mrtg-2.14.7/debian/po/ja.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/ja.po 2008-05-10 19:05:47.000000000 +0100 @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg 2.10.13-1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-06-19 02:26+0900\n" "Last-Translator: Hideki Yamane <henrich@samba.gr.jp>\n" "Language-Team: Japanese <debian-japanese@lists.debian.org>\n" @@ -26,13 +26,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "MRTG ¤ňŔěÍѤμ楟Ľś¤ÇĆ°şî¤ľ¤ť¤Ţ¤š¤Ť?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,7 +46,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" "/etc/mrtg.cfg ¤ň MRTG ĽćĄźĽś¤Î˝ęÍ­¤Ë¤ˇ¤ĆĄ˘¤ł¤ÎĽćĄźĽś¤Ŕ¤ą¤ŹĆɤߟč¤ě¤ë¤č¤Ś¤Ë¤ˇ" @@ -54,7 +54,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -66,7 +66,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/nl.po mrtg-2.16.1/debian/po/nl.po --- mrtg-2.14.7/debian/po/nl.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/nl.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg 2.10.13-1.1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-01-17 14:33+0100\n" "Last-Translator: Luk Claes <luk.claes@ugent.be>\n" "Language-Team: Debian l10n Dutch <debian-l10n-dutch@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "MRTG draaien onder een eigen gebruiker?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,13 +46,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "/etc/mrtg.cfg enkel leesbaar maken voor de MRTG-gebruiker?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -65,7 +65,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/pt_BR.po mrtg-2.16.1/debian/po/pt_BR.po --- mrtg-2.14.7/debian/po/pt_BR.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/pt_BR.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-03-01 23:23-0800\n" "Last-Translator: Andre Luis Lopes <andrelop@ig.com.br>\n" "Language-Team: Portuguese <debian-l10n-purtuguese@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Executar o MRTG com seu próprio usuário ?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,14 +46,14 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" "Fazer /etc/mrtg.cfg propriedade de e legível somente pelo usuário MRTG ?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -66,7 +66,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/pt.po mrtg-2.16.1/debian/po/pt.po --- mrtg-2.14.7/debian/po/pt.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/pt.po 2008-05-10 19:05:47.000000000 +0100 @@ -1,19 +1,19 @@ # Portuguese translation of mrtg debconf messages. # This file is distributed under the same license as the mrtg package. # Manuel Padilha <m.padilha@ieee.org>, 2006. -# -# +# +# msgid "" msgstr "" "Project-Id-Version: mrtg 2.14.3-1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-09-09 13:12-0600\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2006-09-26 00:34+0100\n" "Last-Translator: Manuel Padilha <m.padilha@ieee.org>\n" "Language-Team: Native Portuguese <traduz@debianpt.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit" +"Content-Transfer-Encoding: 8bit\n" #. Type: boolean #. Description @@ -40,7 +40,8 @@ #. Description #: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" -msgstr "Tornar /etc/mrtg.cfg propriedade e legĂ­vel apenas pelo utilizador MRTG?" +msgstr "" +"Tornar /etc/mrtg.cfg propriedade e legĂ­vel apenas pelo utilizador MRTG?" #. Type: boolean #. Description @@ -50,9 +51,9 @@ "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " "risk, as this file contains SNMP community names." msgstr "" -"O ficheiro de configuração do MRTG ser legĂ­vel por outros utilizadores " -"para alĂŠm do usado pelo MRTG (tipicamente 'mrtg' ou 'root') pode representar " -"uma falha de segurança, uma vez que o ficheiro contĂŠm community names SNMP." +"O ficheiro de configuração do MRTG ser legĂ­vel por outros utilizadores para " +"alĂŠm do usado pelo MRTG (tipicamente 'mrtg' ou 'root') pode representar uma " +"falha de segurança, uma vez que o ficheiro contĂŠm community names SNMP." #. Type: boolean #. Description diff -Nru mrtg-2.14.7/debian/po/ru.po mrtg-2.16.1/debian/po/ru.po --- mrtg-2.14.7/debian/po/ru.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/ru.po 2008-05-10 19:05:47.000000000 +0100 @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: mrtg\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2004-03-01 23:23-0800\n" "Last-Translator: Ilgiz Kalmetev <i.kalmetev@bis.bashtelecom.ru>\n" "Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n" @@ -25,13 +25,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "úÁĐŐÓËÁÔŘ MRTG ĎÔ ÉÍĹÎÉ ĹÇĎ ÓĎÂÓÔ×ĹÎÎĎÇĎ ĐĎĚŘÚĎ×ÁÔĹĚŃ?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -46,14 +46,14 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" "óÄĹĚÁÔŘ /etc/mrtg.cfg ĐŇÉÎÁÄĚĹÖÁÝÉÍ É ŢÉÔÁĹÍŮÍ ÔĎĚŘËĎ ĐĎĚŘÚĎ×ÁÔĹĚĹÍ MRTG?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -65,7 +65,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/sv.po mrtg-2.16.1/debian/po/sv.po --- mrtg-2.14.7/debian/po/sv.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/sv.po 2008-05-10 19:05:47.000000000 +0100 @@ -8,59 +8,64 @@ # or http://www.debian.org/intl/l10n/po-debconf/README-trans # Developers do not need to manually edit POT or PO files. # , fuzzy -# -# +# +# msgid "" msgstr "" "Project-Id-Version: mrtg 2.12.1-1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-09-28 19:28-0700\n" "Last-Translator: Daniel Nylander <po@danielnylander.se>\n" "Language-Team: Swedish <sv@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" -"Content-Transfer-Encoding: 8bit" +"Content-Transfer-Encoding: 8bit\n" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Ska MRTG köras som sin egen användare?" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " "will be used instead. If you have existing programs that read any of MRTG's " "output files, you may need to update them." msgstr "" -"Traditionellt sett kör MRTG som 'root' men detta kan innebära en potentiell säkerhetsrisk. Om du väljer att köra MRTG med sin egen användare kommer användaren (kallad 'mrtg') att användas. Om du har existerande program som läser nĺgon av MRTG's filer mĺste du uppdatera dom." +"Traditionellt sett kör MRTG som 'root' men detta kan innebära en potentiell " +"säkerhetsrisk. Om du väljer att köra MRTG med sin egen användare kommer " +"användaren (kallad 'mrtg') att användas. Om du har existerande program som " +"läser nĺgon av MRTG's filer mĺste du uppdatera dom." #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "Göra /etc/mrtg.cfg ägd av och läsbar endast av MRTG-användaren?" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " "risk, as this file contains SNMP community names." msgstr "" -"Om din MRTG konfigurationsfil är läsbar av andra användare än den användaren som kör MRTG (normalt sett 'mrtg' eller 'root') kan det vara en säkerhetsrisk eftersom filen innehĺller SNMP community information." +"Om din MRTG konfigurationsfil är läsbar av andra användare än den användaren " +"som kör MRTG (normalt sett 'mrtg' eller 'root') kan det vara en " +"säkerhetsrisk eftersom filen innehĺller SNMP community information." #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." msgstr "" -"Det rekommenderas att du gör filen ägd av och läsbar endast av MRTG-användaren (om du inte har andra specifika anledningar)." - +"Det rekommenderas att du gör filen ägd av och läsbar endast av MRTG-" +"användaren (om du inte har andra specifika anledningar)." diff -Nru mrtg-2.14.7/debian/po/templates.pot mrtg-2.16.1/debian/po/templates.pot --- mrtg-2.14.7/debian/po/templates.pot 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/templates.pot 2008-05-10 19:05:47.000000000 +0100 @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -26,13 +26,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "" #. Type: boolean #. Description -#: ../mrtg.templates:4 +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " @@ -42,13 +42,13 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" msgstr "" #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " @@ -57,7 +57,7 @@ #. Type: boolean #. Description -#: ../mrtg.templates:13 +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." diff -Nru mrtg-2.14.7/debian/po/vi.po mrtg-2.16.1/debian/po/vi.po --- mrtg-2.14.7/debian/po/vi.po 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/po/vi.po 2008-05-10 19:05:47.000000000 +0100 @@ -1,12 +1,12 @@ # Vietnamese Translation for mrtg. # Copyright Š 2005 Free Software Foundation, Inc. # Clytie Siddall <clytie@riverland.net.au>, 2005. -# +# msgid "" msgstr "" "Project-Id-Version: mrtg 2.12.1-1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-15 15:32+0100\n" +"Report-Msgid-Bugs-To: mrtg@packages.debian.org\n" +"POT-Creation-Date: 2008-04-25 07:31+0200\n" "PO-Revision-Date: 2005-06-11 14:40+0930\n" "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n" "Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n" @@ -15,41 +15,51 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0\n" -#.Type: boolean -#.Description -#:../mrtg.templates:4 +#. Type: boolean +#. Description +#: ../mrtg.templates:1001 msgid "Run MRTG with its own user?" msgstr "Chấy MRTG với người dĂšng cᝧa chĂ­nh nĂł khĂ´ng?" -#.Type: boolean -#.Description -#:../mrtg.templates:4 +#. Type: boolean +#. Description +#: ../mrtg.templates:1001 msgid "" "Traditionally, MRTG runs as root, but this can present a potential security " "risk. If you chose to have MRTG run as its own user, a user called 'mrtg' " "will be used instead. If you have existing programs that read any of MRTG's " "output files, you may need to update them." -msgstr "Trước nĂ y, MRTG thường chấy lĂ  người chᝧ (root), nhĆ°ng mĂ  lĂ m nhĆ° tháşż cĂł thᝃ rᝧi ro bảo máş­t. Náşżu bấn chọn chấy MRTG lĂ  người dĂšng cᝧa chĂ­nh nĂł, thĂŹ sáş˝ sáť­ d᝼ng một người dĂšng tĂŞn ÂŤmrtgÂť thay vĂ o đó. Náşżu bấn đã cĂł chĆ°ĆĄng trĂŹnh nĂ o cĂł đọc táş­p tin xuẼt cᝧa MRTG, bấn cĂł láş˝ sáş˝ cần phải cáş­p nháş­t chĂşng. " +msgstr "" +"Trước nĂ y, MRTG thường chấy lĂ  người chᝧ (root), nhĆ°ng mĂ  lĂ m nhĆ° tháşż cĂł thᝃ " +"rᝧi ro bảo máş­t. Náşżu bấn chọn chấy MRTG lĂ  người dĂšng cᝧa chĂ­nh nĂł, thĂŹ sáş˝ sáť­ " +"d᝼ng một người dĂšng tĂŞn ÂŤmrtgÂť thay vĂ o đó. Náşżu bấn đã cĂł chĆ°ĆĄng trĂŹnh nĂ o cĂł " +"đọc táş­p tin xuẼt cᝧa MRTG, bấn cĂł láş˝ sáş˝ cần phải cáş­p nháş­t chĂşng. " -#.Type: boolean -#.Description -#:../mrtg.templates:13 +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 msgid "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" -msgstr "Láş­p chỉ người dĂšng MRTG sở hᝯu vĂ  cĂł đọc được táş­p tin ÂŤ/etc/mrtg.cfgÂť khĂ´ng?" +msgstr "" +"Láş­p chỉ người dĂšng MRTG sở hᝯu vĂ  cĂł đọc được táş­p tin ÂŤ/etc/mrtg.cfgÂť khĂ´ng?" -#.Type: boolean -#.Description -#:../mrtg.templates:13 +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 msgid "" "If your MRTG configuration file is readable by users other than the user " "MRTG runs as (typically either 'mrtg' or 'root') it can present a security " "risk, as this file contains SNMP community names." -msgstr "Náşżu người khĂĄc với người dĂšng thường chấy MRTG (hầu nhĆ° ÂŤmrtgÂť hay ÂŤrootÂť) cĂł đọc được táş­p tin cẼu hĂŹnh MRTG, thĂŹ cĂł thᝃ rᝧi ro bảo máş­t, vĂŹ táş­p tin nĂ y chᝊa nhiᝁu tĂŞn cᝧa cộng đồng SNMP." +msgstr "" +"Náşżu người khĂĄc với người dĂšng thường chấy MRTG (hầu nhĆ° ÂŤmrtgÂť hay ÂŤrootÂť) cĂł " +"đọc được táş­p tin cẼu hĂŹnh MRTG, thĂŹ cĂł thᝃ rᝧi ro bảo máş­t, vĂŹ táş­p tin nĂ y " +"chᝊa nhiᝁu tĂŞn cᝧa cộng đồng SNMP." -#.Type: boolean -#.Description -#:../mrtg.templates:13 +#. Type: boolean +#. Description +#: ../mrtg.templates:2001 msgid "" "It is recommended that you make the file owned by and readable only by the " "MRTG user, unless you have specific reasons not to." -msgstr "Đệ nghị bấn láş­p chỉ người dĂšng MRTG sở hᝯu vĂ  cĂł đọc đươc táş­p tin Ẽy, trᝍ bấn cĂł lĂ˝ do khĂ´ng lĂ m nhĆ° tháşż." +msgstr "" +"Đệ nghị bấn láş­p chỉ người dĂšng MRTG sở hᝯu vĂ  cĂł đọc đươc táş­p tin Ẽy, trᝍ " +"bấn cĂł lĂ˝ do khĂ´ng lĂ m nhĆ° tháşż." diff -Nru mrtg-2.14.7/debian/postinst.debhelper mrtg-2.16.1/debian/postinst.debhelper --- mrtg-2.14.7/debian/postinst.debhelper 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/postinst.debhelper 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -# Automatically added by dh_installdocs -if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then - install-docs -i /usr/share/doc-base/mrtg-configuration -fi -# End automatically added section -# Automatically added by dh_installdocs -if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then - install-docs -i /usr/share/doc-base/mrtg-manual -fi -# End automatically added section diff -Nru mrtg-2.14.7/debian/postrm mrtg-2.16.1/debian/postrm --- mrtg-2.14.7/debian/postrm 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/postrm 1970-01-01 01:00:00.000000000 +0100 @@ -1,43 +0,0 @@ -#! /bin/sh -# postrm script for #PACKAGE# -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * <postrm> `remove' -# * <postrm> `purge' -# * <old-postrm> `upgrade' <new-version> -# * <new-postrm> `failed-upgrade' <old-version> -# * <new-postrm> `abort-install' -# * <new-postrm> `abort-install' <old-version> -# * <new-postrm> `abort-upgrade' <old-version> -# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version> -# for details, see /usr/share/doc/packaging-manual/ - -case "$1" in - purge) - rm -rf /var/lib/mrtg/ - rm -rf /var/log/mrtg/ - if [ -e /etc/mrtg.ok ]; then - rm -f /etc/mrtg.ok - fi - ;; - - remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 0 - -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - - diff -Nru mrtg-2.14.7/debian/postrm.debhelper mrtg-2.16.1/debian/postrm.debhelper --- mrtg-2.14.7/debian/postrm.debhelper 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/postrm.debhelper 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -# Automatically added by dh_installdebconf -if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge -fi -# End automatically added section diff -Nru mrtg-2.14.7/debian/prerm.debhelper mrtg-2.16.1/debian/prerm.debhelper --- mrtg-2.14.7/debian/prerm.debhelper 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/prerm.debhelper 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -# Automatically added by dh_installdocs -if [ "$1" = remove ] || [ "$1" = upgrade ] && \ - which install-docs >/dev/null 2>&1; then - install-docs -r mrtg-configuration -fi -# End automatically added section -# Automatically added by dh_installdocs -if [ "$1" = remove ] || [ "$1" = upgrade ] && \ - which install-docs >/dev/null 2>&1; then - install-docs -r mrtg-manual -fi -# End automatically added section diff -Nru mrtg-2.14.7/debian/README.Debian mrtg-2.16.1/debian/README.Debian --- mrtg-2.14.7/debian/README.Debian 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/README.Debian 2008-05-10 19:05:47.000000000 +0100 @@ -1,11 +1,16 @@ -MRTG for Debian ---------------- + + +o Image files used by the generated HTML are now located in + /usr/share/mrtg. Please symlink these files to your hosting location. + + -- Adam Majer <adamm@zombino.com> May 7, 2008 + + This package was originally developed by Dermot Bradley <bradley@debian.org> -and is currently maintained by Shiju p. Nair <madhu@debian.hn.org>. Important Notes: -o The default Debian snmpd config is simply to paranoid. This will cause +o The default Debian snmpd config is simply too paranoid. This will cause mrtg to fail. Change following portion of the snmpd.conf file com2sec paranoid default public diff -Nru mrtg-2.14.7/debian/rules mrtg-2.16.1/debian/rules --- mrtg-2.14.7/debian/rules 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/rules 2008-05-10 19:05:47.000000000 +0100 @@ -32,9 +32,10 @@ dh_testroot rm -f build-stamp - -$(MAKE) clean + [ ! -f Makefile ] || $(MAKE) clean rm -f Makefile config.log config.status rm -f bin/rateup.o # not (always?) cleaned by make clean + rm -f config.h dh_clean @@ -44,6 +45,9 @@ dh_testroot dh_clean -k dh_installdirs + dh_installdocs + dh_installman + dh_install # Manual install :( @@ -58,7 +62,6 @@ install -m 755 bin/mrtg $(TMP)/usr/bin install -m 755 bin/rateup $(TMP)/usr/bin install -m 644 debian/sample-mrtg.cfg $(TMP)/etc/mrtg.cfg - install -m 644 images/*.png $(TMP)/var/www/mrtg #dh_installdocs doc/*.html doc/*.txt doc/*.pod README ANNOUNCE #dh_installexamples -p$(PACKAGE)-contrib contrib/* debian/exim-stats @@ -68,35 +71,6 @@ # Remove the extra COPYING files in some contrib files rm $(TMP)/usr/share/doc/mrtg/examples/GetSNMPLinesUP/COPYING || true rm $(TMP)/usr/share/doc/mrtg/examples/mrtg-blast/COPYING || true - # Patch ipacc - patch $(TMP)/usr/share/doc/mrtg/examples/mrtg-ipacc/ipacc debian/patches/ipacc.diff - - cp -a doc/*.txt $(TMP)/usr/share/doc/mrtg - # cp -a doc/*.html $(TMP)/usr/share/doc/mrtg/html - cp -a doc/*.pod $(TMP)/usr/share/doc/mrtg/pod - cp -a doc/*.1 $(TMP)/usr/share/man/man1 - cp -a debian/rateup.1 $(TMP)/usr/share/man/man1 - - # TEMPORARY FIX - these files are form 2.14.5 as they are messed currently - for i in debian/old_temp_pod/*.pod; do \ - rm -f $(TMP)/usr/share/doc/mrtg/pod/`basename $$i`; \ - cp -a $$i $(TMP)/usr/share/doc/mrtg/pod; \ - done - - - # Images for HTML docs - for i in mrtg-ti.gif mrtg-l.png mrtg-m.png mrtg-r.png mrtg-r.gif; \ - do \ - cp -a images/$$i $(TMP)/usr/share/doc/mrtg/html; \ - done - - # Its already renamed! - # Rename manpages - #for i in contrib.1 faq.1 forum.1 logfile.1 mibhelp.1 reference.1 squid.1 unix-guide.1 webserver.1; \ - #do \ - # mv $(TMP)/usr/share/man/man1/$$i $(TMP)/usr/share/man/man1/mrtg-$$i; \ - #done - rm $(TMP)/usr/share/man/man1/mrtg-nt-guide.1 # Fix some #! lines find $(TMP)/usr/share/doc/mrtg/examples -type f | xargs -r \ @@ -110,10 +84,6 @@ # logrotate cp -a debian/logrotate $(TMP)/etc/logrotate.d/mrtg - # These don't work - # find debian/tmp/usr/share/doc/mrtg/examples -type f -print0 | xargs -0 -r -n 1 sh -c 'if head -1 "$$1"|grep -q "^#!" ; then chmod 0755 "$$1"; fi' - # find debian/tmp/usr/share/doc/mrtg/examples -type f | while read f; do if head -1 $f | grep '^#!' >/dev/null; then chmod +x $f; fi; done - mv ${TMP}/usr/share/doc/mrtg/examples/* ${TMP}/../mrtg-contrib/usr/share/doc/mrtg/examples # Clean empty dir diff -Nru mrtg-2.14.7/debian/watch mrtg-2.16.1/debian/watch --- mrtg-2.14.7/debian/watch 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/debian/watch 2008-05-10 19:05:47.000000000 +0100 @@ -1,2 +1,2 @@ -version=2 -http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/mrtg-(.*)\.tar\.gz debian uupdate +version=3 +http://oss.oetiker.ch/mrtg/pub/?M=D mrtg-(.*)\.tar\.gz debian uupdate diff -Nru mrtg-2.14.7/doc/cfgmaker.1 mrtg-2.16.1/doc/cfgmaker.1 --- mrtg-2.14.7/doc/cfgmaker.1 2006-09-06 14:42:54.000000000 +0100 +++ mrtg-2.16.1/doc/cfgmaker.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,36 +129,37 @@ .\" ======================================================================== .\" .IX Title "CFGMAKER 1" -.TH CFGMAKER 1 "2006-09-06" "2.14.7" "mrtg" +.TH CFGMAKER 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" -cfgmaker \- Creates mrtg.cfg files (for mrtg\-2.14.7) +cfgmaker \- Creates mrtg.cfg files (for mrtg\-2.16.1) .SH "SYNOPSIS" .IX Header "SYNOPSIS" cfgmaker [options] [community@]router [[options] [community@]router ...] .SH "OPTIONS" .IX Header "OPTIONS" .Vb 6 -\& --ifref=nr interface references by Interface Number (default) -\& --ifref=ip ... by Ip Address -\& --ifref=eth ... by Ethernet Number -\& --ifref=descr ... by Interface Description -\& --ifref=name ... by Interface Name -\& --ifref=type ... by Interface Type +\& \-\-ifref=nr interface references by Interface Number (default) +\& \-\-ifref=ip ... by Ip Address +\& \-\-ifref=eth ... by Ethernet Number +\& \-\-ifref=descr ... by Interface Description +\& \-\-ifref=name ... by Interface Name +\& \-\-ifref=type ... by Interface Type .Ve .PP -.Vb 8 -\& --ifdesc=nr interface description uses Interface Number (default) -\& --ifdesc=ip ... uses Ip Address -\& --ifdesc=eth ... uses Ethernet Number -\& --ifdesc=descr ... uses Interface Description -\& --ifdesc=name ... uses Interface Name -\& --ifdesc=catname ... uses CatOS Interface Name -\& --ifdesc=alias ... uses Interface Alias -\& --ifdesc=type ... uses Interface Type +.Vb 9 +\& \-\-ifdesc=nr interface description uses Interface Number (default) +\& \-\-ifdesc=ip ... uses Ip Address +\& \-\-ifdesc=eth ... uses Ethernet Number +\& \-\-ifdesc=descr ... uses Interface Description +\& \-\-ifdesc=name ... uses Interface Name +\& \-\-ifdesc=catname ... uses CatOS Interface Name +\& \-\-ifdesc=ppname ... uses Passport Port Name +\& \-\-ifdesc=alias ... uses Interface Alias +\& \-\-ifdesc=type ... uses Interface Type .Ve .PP .Vb 6 -\& --if-filter=f Test every interface against filter f to decide wether +\& \-\-if\-filter=f Test every interface against filter f to decide wether \& or not to include that interface into the collection. \& Currently f is being evaluated as a Perl expression \& and it's truth value is used to reject or accept the @@ -167,7 +168,7 @@ .Ve .PP .Vb 7 -\& --if-template=templatefile +\& \-\-if\-template=templatefile \& Replace the normal target entries for the interfaces \& with an entry as specified by the contents in the file \& templatefile. The file is supposed to contain Perl @@ -177,98 +178,98 @@ .Ve .PP .Vb 9 -\& --host-template=templatefile +\& \-\-host\-template=templatefile \& In addition to creating targets for a host's interfaces \& do also create targets for the host itself as specified \& by the contents in the file templatefile. The file is \& supposed to contain Perl code to be executed to generate \& the lines for the host related targets (such as CPU, -\& ping response time measurements etc.) in the config- +\& ping response time measurements etc.) in the config\- \& uration file. \& (Experimental, under development, might change) .Ve .PP .Vb 1 -\& --global "x: a" add global config entries +\& \-\-global "x: a" add global config entries .Ve .PP .Vb 1 -\& --no-down do not look at admin or opr status of interfaces +\& \-\-no\-down do not look at admin or opr status of interfaces .Ve .PP .Vb 1 -\& --show-op-down show interfaces which are operatively down +\& \-\-show\-op\-down show interfaces which are operatively down .Ve .PP .Vb 3 -\& --zero-speed=spd use this speed in bits-per-second as the interface +\& \-\-zero\-speed=spd use this speed in bits\-per\-second as the interface \& speed for all interfaces that return a speed of 0 \& via ifSpeed/ifHighSpeed. 100Mbps = 100000000 .Ve .PP .Vb 4 -\& --subdirs=format give each router its own subdirectory, naming each per +\& \-\-subdirs=format give each router its own subdirectory, naming each per \& "format", in which HOSTNAME and SNMPNAME will be -\& replaced by the values of those items -- for instance, -\& --subdirs=HOSTNAME or --subdirs="HOSTNAME (SNMPNAME)" +\& replaced by the values of those items \-\- for instance, +\& \-\-subdirs=HOSTNAME or \-\-subdirs="HOSTNAME (SNMPNAME)" .Ve .PP .Vb 1 -\& --noreversedns do not reverse lookup ip numbers +\& \-\-noreversedns do not reverse lookup ip numbers .Ve .PP .Vb 2 -\& --community=cmty Set the default community string to "cmty" instead of +\& \-\-community=cmty Set the default community string to "cmty" instead of \& "public". .Ve .PP .Vb 3 -\& --enable-ipv6 Enable IPv6 support, if the required libraries are +\& \-\-enable\-ipv6 Enable IPv6 support, if the required libraries are \& present. Numeric IPv6 addresses must be enclosed \& in square brackets, e.g. public@[2001:760:4::1]:161 .Ve .PP .Vb 1 -\& --use-16bit Use 16bit SNMP request IDs to query all routers. +\& \-\-use\-16bit Use 16bit SNMP request IDs to query all routers. .Ve .PP .Vb 1 -\& --snmp-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]] +\& \-\-snmp\-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]] .Ve .PP .Vb 4 \& Specify default SNMP options to be appended to all \& routers following. Individual fields can be empty. \& Routers following might override some or all of the -\& options given to --snmp-options. +\& options given to \-\-snmp\-options. .Ve .PP .Vb 3 -\& --dns-domain=domain +\& \-\-dns\-domain=domain \& Specifies a domain to append to the name of all \& routers following. .Ve .PP .Vb 3 -\& --nointerfaces Don't do generate any configuration lines for interfaces, +\& \-\-nointerfaces Don't do generate any configuration lines for interfaces, \& skip the step of gathering interface information and \& don't run any interface template code. .Ve .PP .Vb 3 -\& --interfaces Generate configuration lines for interfaces (this is the +\& \-\-interfaces Generate configuration lines for interfaces (this is the \& default). The main purpose of this option is to negate -\& an --nointerfaces appearing earlier on the command line. +\& an \-\-nointerfaces appearing earlier on the command line. .Ve .PP .Vb 3 -\& --help brief help message -\& --man full documentation -\& --version print the version of cfgmaker +\& \-\-help brief help message +\& \-\-man full documentation +\& \-\-version print the version of cfgmaker .Ve .PP .Vb 1 -\& --output=file output filename default is STDOUT +\& \-\-output=file output filename default is STDOUT .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -422,7 +423,7 @@ For example: .Sp .Vb 1 -\& cfgmaker --enable-ipv6 [2001:760:4::1]:165:::2 +\& cfgmaker \-\-enable\-ipv6 [2001:760:4::1]:165:::2 .Ve .Sp If the target has both an IPv6 address and an IPv4 address with the same @@ -451,13 +452,13 @@ the next router appearing on the command line. .Sp .Vb 1 -\& --global "workdir: /home/mrtg" +\& \-\-global "workdir: /home/mrtg" .Ve .Sp If you want some default Options you might want to put .Sp .Vb 1 -\& --global "options[_]: growright,bits" +\& \-\-global "options[_]: growright,bits" .Ve .Sp Specifying \fB\-\-global\fR after the last router on the command line will @@ -493,13 +494,13 @@ \&\*(L"Title\*(R" lines). For instance, a call like: .Sp .Vb 1 -\& cfgmaker --subdirs=HOSTNAME__SNMPNAME public@10.10.0.18 +\& cfgmaker \-\-subdirs=HOSTNAME__SNMPNAME public@10.10.0.18 .Ve .Sp would result in the generation of lines looking something like: .Sp .Vb 1 -\& Directory[10.10.0.18_1]: 10.10.0.18__fp2200-bothrip-1.3 +\& Directory[10.10.0.18_1]: 10.10.0.18__fp2200\-bothrip\-1.3 .Ve .IP "\fB\-\-output\fR \fIfile\fR" 4 .IX Item "--output file" @@ -524,7 +525,13 @@ earlier on the command line. .Sh "\s-1SNMP\s0 V3 Options" .IX Subsection "SNMP V3 Options" -\&\fBCfgmaker\fR supports \s-1SNMP\s0 V3. There are optional parameters affecting \s-1SNMP\s0 operation. +\&\fBCfgmaker\fR supports \s-1SNMP\s0 V3 using the \fBNet:SNMP\fR perl module. There are optional +parameters affecting \s-1SNMP\s0 operation. +.IP "\-\-enablesnmpv3 {yes|no}" 4 +.IX Item "--enablesnmpv3 {yes|no}" +The \fB\-\-enablesnmpv3\fR option is an optional flag to check for the presence of +the \fBNet::SNMP\fR libraries. \fBCfgmaker\fR will try to determine whether this flag is +required and will set the values automatically. .PP \fISNMPv3 Arguments\fR .IX Subsection "SNMPv3 Arguments" @@ -662,7 +669,7 @@ evaluation: .PP .Vb 1 -\& '--if-filter=($default_iftype && $if_admin)' +\& '\-\-if\-filter=($default_iftype && $if_admin)' .Ve .IP "\fB$if_type\fR" 4 .IX Item "$if_type" @@ -687,7 +694,7 @@ \& 23 ppp \& 24 softwareLoopback \& 30 ds3 -\& 32 frame-relay +\& 32 frame\-relay \& 33 rs232 \& 37 atm \& 39 sonet @@ -766,7 +773,12 @@ .IX Item "$if_vlan_id" Returns the vlan id associated with a specific port on Cisco Catalyst switches under both Catalyst \s-1OS\s0 -and \s-1IOS\s0. If it is not a vlan interface, will return undef. +and \s-1IOS\s0, and 3Com switches. If it is not a vlan interface, will return undef. +.IP "\fB$if_cisco_trunk\fR" 4 +.IX Item "$if_cisco_trunk" +Returns the trunking state of a specific port +on Cisco Catalyst switches under both Catalyst \s-1OS\s0 +and \s-1IOS\s0. Returns \*(L"1\*(R" if the interface is a trunk, undef otherwise. .IP "\fB$if_MTU\fR" 4 .IX Item "$if_MTU" Returns the Maximum Transfer Unit associated with a specific port. @@ -783,13 +795,13 @@ excluded, it will make cfgmaker behave as normally. .PP .Vb 1 -\& '--if-filter=$default' +\& '\-\-if\-filter=$default' .Ve .PP The following filter will make cfgmaker exclude \s-1PPP\s0 (23) interfaces: .PP .Vb 1 -\& '--if-filter=$default && $if_type!=23' +\& '\-\-if\-filter=$default && $if_type!=23' .Ve .PP The following filter will make cfgmaker behave as usual except that it will @@ -797,7 +809,7 @@ all interfaces which are administratively down. .PP .Vb 1 -\& '--if-filter=$if_admin && $default_iftype' +\& '\-\-if\-filter=$if_admin && $default_iftype' .Ve .Sh "Details on Templates" .IX Subsection "Details on Templates" @@ -1061,6 +1073,10 @@ .IX Item "$if_port_name" If the host is a Cisco Catalyst \s-1LAN\s0 switch, this variable is the name of that port. (No \s-1HTML\s0 escaped variant available) +.IP "\fB$if_pp_port_name\fR" 4 +.IX Item "$if_pp_port_name" +If the host is a Nortel Passport \s-1LAN\s0 switch, this variable is the name of +that port. (No \s-1HTML\s0 escaped variant available) .IP "\fB$desc_prefix\fR" 4 .IX Item "$desc_prefix" This variable is a prefix of the description of what the target is to use in @@ -1089,6 +1105,12 @@ \&\*(L"&\*(R" are replaced by \*(L"<\*(R", \*(L">\*(R" and \*(L"&\*(R" and that newlines embedded in the string are prepended with \*(L"<\s-1BR\s0>\*(R" and appended with a space character (newlines at the end of the string are not touched). +.ie n .IP "\fBoid_pick($router_connect,$v3opt,""oid1"",""oid2""...)\fR" 4 +.el .IP "\fBoid_pick($router_connect,$v3opt,``oid1'',``oid2''...)\fR" 4 +.IX Item "oid_pick($router_connect,$v3opt,oid1,oid2...)" +This function will try to poll each of the oids specified until +it is successful or has run out of oids. It will return the name of the +first oid that worked or undef if it is not successful .PP \fIExample Template Files\fR .IX Subsection "Example Template Files" @@ -1122,8 +1144,8 @@ .Vb 27 \& $target_lines .= <<ECHO; \& MaxBytes[$target_name]: $if_speed -\& Title[$target_name]: $html_desc_prefix$html_if_title_desc -- $sysname -\& PageTop[$target_name]: <h1>$html_desc_prefix$html_if_title_desc -- $sysname</h1> +\& Title[$target_name]: $html_desc_prefix$html_if_title_desc \-\- $sysname +\& PageTop[$target_name]: <h1>$html_desc_prefix$html_if_title_desc \-\- $sysname</h1> \& <div id="sysdetails"> \& <table> \& <tr> @@ -1159,6 +1181,15 @@ .Ve .PP .Vb 6 +\& $target_lines .= <<ECHO if defined $if_pp_port_name; +\& <tr> +\& <td>Port Name:</td> +\& <td>$if_pp_port_name</td> +\& </tr> +\& ECHO +.Ve +.PP +.Vb 6 \& $target_lines .= <<ECHO; \& <tr> \& <td>Max Speed:</td> @@ -1219,7 +1250,7 @@ .PP .Vb 3 \& $head_lines .= <<ECHO; -\& #--------------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& ECHO .Ve .PP @@ -1277,9 +1308,9 @@ of the line mean that this command should be written on a single line. .PP .Vb 4 -\& cfgmaker --global "WorkDir: /home/tobi" \e -\& --global "Options[_]: growright,bits" \e -\& --ifref=ip \e +\& cfgmaker \-\-global "WorkDir: /home/tobi" \e +\& \-\-global "Options[_]: growright,bits" \e +\& \-\-ifref=ip \e \& public@router.place.xyz > mrtg.cfg .Ve .PP @@ -1301,17 +1332,17 @@ to the switches. .PP .Vb 12 -\& cfgmaker --global "WorkDir: /home/tobi" \e -\& --global "Options[_]: growright,bits" \e -\& --ifref=descr \e -\& --ifdesc=alias \e +\& cfgmaker \-\-global "WorkDir: /home/tobi" \e +\& \-\-global "Options[_]: growright,bits" \e +\& \-\-ifref=descr \e +\& \-\-ifdesc=alias \e \& public@router1.place.xyz \e \& public@router2.place.xyz \e -\& --global "Options[_]: growright" \e -\& --ifref=name \e -\& --ifdesc=descr \e +\& \-\-global "Options[_]: growright" \e +\& \-\-ifref=name \e +\& \-\-ifdesc=descr \e \& public@switch1.place.xyz \e -\& --ifdesc=name \e +\& \-\-ifdesc=name \e \& public@switch2.place.xyz > mrtg.cfg .Ve .PP @@ -1328,11 +1359,11 @@ of the ppp-server to be \fIppp\-server.\f(BIremote\fI\fR . .PP .Vb 18 -\& cfgmaker --global "WorkDir: /home/tobi" \e -\& --global "Options[_]: growright,bits" \e -\& --dns-domain=place.xyz \e -\& --community=hidden \e -\& --snmp-options=::1:1::2 \e +\& cfgmaker \-\-global "WorkDir: /home/tobi" \e +\& \-\-global "Options[_]: growright,bits" \e +\& \-\-dns\-domain=place.xyz \e +\& \-\-community=hidden \e +\& \-\-snmp\-options=::1:1::2 \e \& router1 \e \& router2 \e \& router3 \e @@ -1345,7 +1376,7 @@ \& switch5 \e \& switch6 \e \& switch7 \e -\& access@ppp-server.remote:::::1 > mrtg.cfg +\& access@ppp\-server.remote:::::1 > mrtg.cfg .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" diff -Nru mrtg-2.14.7/doc/cfgmaker.pod mrtg-2.16.1/doc/cfgmaker.pod --- mrtg-2.14.7/doc/cfgmaker.pod 2008-05-10 19:05:46.000000000 +0100 +++ mrtg-2.16.1/doc/cfgmaker.pod 2008-05-10 19:05:47.000000000 +0100 @@ -1,7 +1,7 @@ #! /usr/bin/perl # -*- mode: Perl -*- ################################################################## -# MRTG 2.14.7 -- Config file creator +# MRTG 2.16.1 -- Config file creator ################################################################## # Created by Tobias Oetiker <tobi@oetiker.ch> # this produces an mrtg config file for one router or more routers @@ -15,7 +15,7 @@ # base - basic program flow # snpo - SNMP Polling # snpd - SNMP Detail -#@main::DEBUG=qw(base snpo coca); +#@main::DEBUG=qw(base); @main::DEBUG=qw(); require 5.005; @@ -54,14 +54,17 @@ sub main { - my %opt; + # assign defaults + my %opt = ( +# 'snmp-options' => ':::::2' + ); my %routers; my %confcache; my $ipv4only; my %v3opt; $opt{fullcmd} = "$0 ".(join " ", - map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? "'$_'" : $_ } @ARGV); + map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? qq{"$_"} : $_ } @ARGV); $opt{community}="public"; $opt{interfaces}=1; options(\%opt,\%routers); @@ -85,7 +88,7 @@ } # Check for SNMP V3 # - if (lc($opt{enablesnmpv3}) eq "yes") { + if (exists($opt{username}) or lc($opt{enablesnmpv3}) eq "yes" ) { if (eval {local $SIG{__DIE__};require Net_SNMP_util;}) { import Net_SNMP_util; debug('base', "SNMP V3 libraries found, SNMP V3 enabled."); @@ -119,6 +122,7 @@ $routers{$router}{'snmp-options'} = join(":",@snmpopt); } else { die "SNMP V3 requires a --username parameter as part of the User Security Model for router $routers{$router}{routerkey}" if $opt{enablesnmpv3} eq "no"; + $routers{$router}{enablesnmpv3} = $opt{enablesnmpv3}; %v3opt = parsev3(\%opt); } } else { @@ -165,6 +169,7 @@ $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|force10|3com|extremenetworks)/) { push @Variables, "ifAlias"; } @@ -175,6 +180,13 @@ push @Variables, "CiscoCatalystPortName"; push @Variables, "vmVlan"; } + if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' && + $descr =~ m/Catalyst/ ) { + push @Variables, "vlanTrunkPortDynamicStatus"; + } + if ($descr =~ m/Passport-8610/ ) { + push @Variables, "ppPortName"; + } foreach my $var (@Variables) { debug('base',"Walking $var"); @@ -413,6 +425,7 @@ or die "File $$router_opt{'host-template'} couldn't be opened.\n"; my @template_lines = readline *IF_TEMPLATE; + close IF_TEMPLATE; $@ = undef; eval ('local $SIG{__DIE__};'.join("", @template_lines)); @@ -472,7 +485,7 @@ my $if_is_loopback = $if_type == 24; my $if_is_ciscovlan = ($$router_dev{Vendor} eq 'cisco' - and $$i{Descr} =~ /^(unrouted )?V(LAN|lan)\d+$/); + and $$i{Descr} =~ /^(unrouted )?[- ]?VLAN[- ]?\d*$/i); my $if_ip = $$i{Ip}; my $if_snmp_descr = $$i{Descr}; @@ -485,6 +498,7 @@ my $if_cisco_descr = $$i{CiscolocIfDescr}; my $if_dns_name = $$i{DNSName}; my $if_vlan_id = $$i{vmVlan}; + my $if_cisco_trunk = ($$i{vlanTrunkPortDynamicStatus} ==1); my $if_MTU = $$i{ifMtu}; # For Nokia IPSO, find non-ethernet interfaces with IP addresses @@ -614,10 +628,15 @@ } my $message; + my $nohc =0; if ($message = IsCounterBroken($ifindex, $router_ref,$v3opt)) { # set snmpopt_current to working snmp options - push @prob, "got '$message' from interface when trying to query"; + if ($message ==1) { + $nohc = 1; + } else { + push @prob, "got '$message' from interface when trying to query"; $if_ok = 0; + } } my $community = $$router_ref{community}; @@ -667,6 +686,7 @@ my $port_dot = $$i{Name}; $port_dot =~ s/\//./g; my $if_port_name = $$router_ref{$port_dot}{CiscoCatalystPortName}; + my $if_pp_port_name = $$router_ref{$ifindex}{ppPortName}; if (defined $$router_opt{ifdesc}) { $desc_prefix = ''; @@ -679,6 +699,7 @@ last}; /^name$/ && do {$if_title_desc = "#".$$i{Name} if $$i{Name}; last}; /^catname$/ && do {$if_title_desc = "$if_port_name"; last}; + /^ppname$/ && do {$if_title_desc = "$if_pp_port_name"; last}; /^type$/ && do {$if_title_desc = "%".$$i{Type} if $$i{Type}; last}; /^nr$/ && do {$if_title_desc = "Interface $ifindex"; last}; /^$/ && do {$if_title_desc = $if_type_desc; @@ -715,6 +736,7 @@ $if_ref =~ s/([& :])/\\$1/g; my $default_target_directive = "Target[$target_name]: $if_ref:$router_connect"; $default_target_directive .= "\nSnmpOptions[$target_name]: $v3options" if $$router_ref{snmpopt_current} =~ /(?=:.*?){4}:3/ ; + $default_target_directive .= "\nnoHC[$target_name]: yes" if $nohc == 1; my $if_snmp_descr_save = $if_snmp_descr; $if_snmp_descr_save =~ s/"/'/g; my $default_setenv_directive = "SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_snmp_descr_save\""; @@ -755,6 +777,11 @@ </tr>" if defined $if_port_name; $default_pagetop_directive .= " <tr> + <td>Port Name:</td> + <td>$if_pp_port_name</td> + </tr>" if defined $if_pp_port_name; + $default_pagetop_directive .= " + <tr> <td>Max Speed:</td> <td>$if_speed_str</td> </tr>"; @@ -868,9 +895,10 @@ my $router_ref = shift; my $v3opt = shift; my $router = $$router_ref{routerkey}; - my $old_state = $SNMP_Session::suppress_warnings; + my $fallback = 0; $$router_ref{snmpopt_current} = $$router_ref{'snmp-options'}; - $SNMP_Session::suppress_warnings = 3; + local $SNMP_Session::suppress_warnings = 3; + local $Net_SNMP_util::suppress_warnings = 3; my $ipv4only = $$router_ref{ipv4only}; my $snmphost = v4onlyifnecessary($router, $ipv4only); @@ -880,31 +908,35 @@ my $speed = (snmpget($snmphost, $v3opt, 'ifHighSpeed.'.$if))[0]; debug('base',"snmpget $snmphost for ifHighSpeed.$if -> $speed Mb/s"); $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; my $counter = (snmpget($snmphost,$v3opt, 'ifHCInOctets.'.$if))[0]; debug('base',"snmpget $snmphost for ifHCInOctets.$if -> $counter"); - if(not $speed or $counter eq "" or $SNMP_Session::errmsg){ + if(not $speed or $counter eq "" or $counter =~ /\D/ or $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ $SNMP_Session::errmsg = undef; - $$router_ref{snmpopt_current} =~ s/:+[23]$//; + $Net_SNMP_util::ErrorMessage = undef; + $fallback = 1; debug('base',"check for HighspeedCounters failed ... Dropping back to V1"); } else { - $SNMP_Session::suppress_warnings = $old_state; return 0; } } - $router = "$$router_ref{community}\@$$router_ref{routername}$$router_ref{'snmp-options'}"; - $snmphost = v4onlyifnecessary($router, $ipv4only); - if ( $$router_ref{snmpopt_current} !~ /:[23]/) { - snmpget($snmphost, 'ifInOctets.'.$if); + if ( $fallback == 1 or $$router_ref{snmpopt_current} !~ /:\d*:\d*:\d*:\d*:[23]$/) { + my $counter = (snmpget($snmphost, 'ifInOctets.'.$if))[0]; if (defined $SNMP_Session::errmsg) { my $error = $SNMP_Session::errmsg; $SNMP_Session::errmsg = undef; $error =~ s/\n/\n### /g; - $SNMP_Session::suppress_warnings = $old_state; return $error; + } elsif (defined $Net_SNMP_util::ErrorMessage and $Net_SNMP_util::ErrorMessage =~ /\w/) { + my $error = $Net_SNMP_util::ErrorMessage; + $Net_SNMP_util::ErrorMessage = undef; + $error =~ s/\n/\n### /g; + return $error; + } elsif (not defined $counter or $counter eq '' or $counter =~ /\D/) { + return "No counter exists for $if"; } } - $SNMP_Session::suppress_warnings = $old_state; - return 0; + return $fallback; } # end IsCounterBroken # DeviceInfo does fallback between IPv6 and IPv4: if an IPv6 snmpwalk returns @@ -1208,12 +1240,12 @@ 'output=s', 'global=s@', 'enable-ipv6', - 'enable-snmpv3', + 'enablesnmpv3', 'use-16bit', 'zero-speed=s', '<>', $addrouter_ornf) or pod2usage(2); - die("cfgmaker for mrtg-2.14.7\n") if $$opt{version}; + die("cfgmaker for mrtg-2.16.1\n") if $$opt{version}; pod2usage(-exitval => 0, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not keys %$routers; } # end options @@ -1444,6 +1476,24 @@ return $s; } # end html_escape +sub oid_pick ($$$;@){ + my $router = shift; + my $v3opt = shift; + my @oids = @_; + local $SNMP_Session::suppress_warnings = 3; + foreach my $oid (@oids){ + local $SNMP_Session::errmsg = undef; + my $counter = snmpget($router,$v3opt,$oid); + if (not defined $SNMP_Session::errmsg and defined $counter and $counter ne '' ) { + debug('base',"oid_pick - found $oid to work for $router"); + return $oid; + } + } + debug('base',"oid_pick - none of ".(join ",",@oids)." seem to work for $router"); + return undef; +} + + sub parsev3 ($) { my $opt = shift; my %v3opt; @@ -1489,6 +1539,8 @@ snmpmapOID('sysObjectID' => '1.3.6.1.2.1.1.2.0', 'CiscolocIfDescr' => '1.3.6.1.4.1.9.2.2.1.1.28', 'CiscoCatalystPortName' => '1.3.6.1.4.1.9.5.1.4.1.1.4', + 'ppPortName' => '1.3.6.1.4.1.2272.1.4.10.1.1.35', + 'vlanTrunkPortDynamicStatus'=> '1.3.6.1.4.1.9.9.46.1.6.1.1.14', 'vmVlan' => '1.3.6.1.4.1.9.9.68.1.2.2.1.2', 'ifAlias' => '1.3.6.1.2.1.31.1.1.1.18'); } # end init @@ -1499,7 +1551,7 @@ =head1 NAME -cfgmaker - Creates mrtg.cfg files (for mrtg-2.14.7) +cfgmaker - Creates mrtg.cfg files (for mrtg-2.16.1) =head1 SYNOPSIS @@ -1520,6 +1572,7 @@ --ifdesc=descr ... uses Interface Description --ifdesc=name ... uses Interface Name --ifdesc=catname ... uses CatOS Interface Name + --ifdesc=ppname ... uses Passport Port Name --ifdesc=alias ... uses Interface Alias --ifdesc=type ... uses Interface Type @@ -1870,8 +1923,18 @@ =head2 SNMP V3 Options -B<Cfgmaker> supports SNMP V3. There are optional parameters affecting SNMP operation. +B<Cfgmaker> supports SNMP V3 using the B<Net:SNMP> perl module. There are optional +parameters affecting SNMP operation. + +=over + +=item --enablesnmpv3 {yes|no} + +The B<--enablesnmpv3> option is an optional flag to check for the presence of +the B<Net::SNMP> libraries. B<Cfgmaker> will try to determine whether this flag is +required and will set the values automatically. +=back =head3 SNMPv3 Arguments @@ -2139,7 +2202,13 @@ Returns the vlan id associated with a specific port on Cisco Catalyst switches under both Catalyst OS -and IOS. If it is not a vlan interface, will return undef. +and IOS, and 3Com switches. If it is not a vlan interface, will return undef. + +=item B<$if_cisco_trunk> + +Returns the trunking state of a specific port +on Cisco Catalyst switches under both Catalyst OS +and IOS. Returns "1" if the interface is a trunk, undef otherwise. =item B<$if_MTU> @@ -2485,6 +2554,11 @@ If the host is a Cisco Catalyst LAN switch, this variable is the name of that port. (No HTML escaped variant available) +=item B<$if_pp_port_name> + +If the host is a Nortel Passport LAN switch, this variable is the name of +that port. (No HTML escaped variant available) + =item B<$desc_prefix> This variable is a prefix of the description of what the target is to use in @@ -2519,6 +2593,12 @@ in the string are prepended with "<BR>" and appended with a space character (newlines at the end of the string are not touched). +=item B<oid_pick($router_connect,$v3opt,"oid1","oid2"...)> + +This function will try to poll each of the oids specified until +it is successful or has run out of oids. It will return the name of the +first oid that worked or undef if it is not successful + =back =head3 Example Template Files @@ -2577,6 +2657,13 @@ </tr> ECHO + $target_lines .= <<ECHO if defined $if_pp_port_name; + <tr> + <td>Port Name:</td> + <td>$if_pp_port_name</td> + </tr> + ECHO + $target_lines .= <<ECHO; <tr> <td>Max Speed:</td> diff -Nru mrtg-2.14.7/doc/cfgmaker.txt mrtg-2.16.1/doc/cfgmaker.txt --- mrtg-2.14.7/doc/cfgmaker.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/cfgmaker.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,13 +1,13 @@ -CFGMAKER(1) mrtg CFGMAKER(1) +CFGMAKER(1) mrtg CFGMAKER(1) NNAAMMEE - cfgmaker - Creates mrtg.cfg files (for mrtg-2.14.7) + cfgmaker - Creates mrtg.cfg files (for mrtg-2.16.1) SSYYNNOOPPSSIISS - cfgmaker [options] [community@]router [[options] [commu- - nity@]router ...] + cfgmaker [options] [community@]router [[options] [community@]router + ...] OOPPTTIIOONNSS --ifref=nr interface references by Interface Number (default) @@ -23,6 +23,7 @@ --ifdesc=descr ... uses Interface Description --ifdesc=name ... uses Interface Name --ifdesc=catname ... uses CatOS Interface Name + --ifdesc=ppname ... uses Passport Port Name --ifdesc=alias ... uses Interface Alias --ifdesc=type ... uses Interface Type @@ -61,9 +62,6 @@ speed for all interfaces that return a speed of 0 via ifSpeed/ifHighSpeed. 100Mbps = 100000000 - - - --subdirs=format give each router its own subdirectory, naming each per "format", in which HOSTNAME and SNMPNAME will be replaced by the values of those items -- for instance, @@ -106,59 +104,52 @@ --output=file output filename default is STDOUT DDEESSCCRRIIPPTTIIOONN - CCffggmmaakkeerr creates MRTG configuration files based on infor- - mation pulled from a router or another SNMP manageable - device. + CCffggmmaakkeerr creates MRTG configuration files based on information pulled + from a router or another SNMP manageable device. [_c_o_m_m_u_n_i_t_y@@]_r_o_u_t_e_r - _C_o_m_m_u_n_i_t_y is the community name of the device you want to - create a configuration for. If not specified, it defaults - to 'ppuubblliicc'; you might want to try this first if you do - not know the community name of a device. If you are using - the wrong community name you will get no response from the - device. - - _R_o_u_t_e_r is the DNS name or the IP number of an SNMP-man- - agable device. Following the name you can specify 6 fur- - ther options separated by colons. The full syntax looks - like this: + _C_o_m_m_u_n_i_t_y is the community name of the device you want to create a con- + figuration for. If not specified, it defaults to 'ppuubblliicc'; you might + want to try this first if you do not know the community name of a + device. If you are using the wrong community name you will get no + response from the device. + + _R_o_u_t_e_r is the DNS name or the IP number of an SNMP-managable device. + Following the name you can specify 6 further options separated by + colons. The full syntax looks like this: rroouutteerr[:[pprrtt][:[ttmmoouutt][:[rreettrr][:[bbaacckkooffff][:vveerrss]]]]] - Of special interest may be the last parameter, vveerrss. If - you set this to '2' then your device will be queried with - SNMP version 2 requests. This allows to poll the 64 bit - traffic counters in the device and will thus work much - better with fast interfaces (no more counter overrun). - Note that the order in which the routers are specified on - the command line do matter as the same order is used when - the configuration file is generated. The first specified - router has it's configuration lines genrated first, fol- - lowed by the lines belonging to the next router and so on. - - Note that the first line of the generated cfg file will - contain all the commandline options you used for generat- - ing it. This is to allow for the easy 'regeneration' in - case you want to add newhosts or make some other global - change. + Of special interest may be the last parameter, vveerrss. If you set this + to '2' then your device will be queried with SNMP version 2 requests. + This allows to poll the 64 bit traffic counters in the device and will + thus work much better with fast interfaces (no more counter overrun). + Note that the order in which the routers are specified on the command + line do matter as the same order is used when the configuration file is + generated. The first specified router has it's configuration lines + genrated first, followed by the lines belonging to the next router and + so on. + + Note that the first line of the generated cfg file will contain all the + commandline options you used for generating it. This is to allow for + the easy 'regeneration' in case you want to add newhosts or make some + other global change. CCoonnffiigguurraattiioonn - Except for the ----oouuttppuutt and ----gglloobbaall options, all options - affect only the routers following them on the command - line. If an option specified earlier on the command line - reappears later on the command line with another value, - the new value overrides the old value as far as remaining - routers are concerned. This way options might be tailored - for groups of routers or for individual routers. - - See ----oouuttppuutt and ----gglloobbaall for how their behaviour is - affected by where or how many times they appear on the - command line. + Except for the ----oouuttppuutt and ----gglloobbaall options, all options affect only + the routers following them on the command line. If an option specified + earlier on the command line reappears later on the command line with + another value, the new value overrides the old value as far as remain- + ing routers are concerned. This way options might be tailored for + groups of routers or for individual routers. - See the EExxaammpplleess below on how to set an option differently - for multiple routers. + See ----oouuttppuutt and ----gglloobbaall for how their behaviour is affected by where + or how many times they appear on the command line. + + See the EExxaammpplleess below on how to set an option differently for multiple + routers. ----hheellpp Print a brief help message and exit. @@ -167,157 +158,130 @@ Prints the manual page and exits. ----vveerrssiioonn - Print the version of cfgmaker. This should match the - version of MRTG for which config files are being cre- - ated. + Print the version of cfgmaker. This should match the version of + MRTG for which config files are being created. ----iiffrreeff nnrr|iipp|eetthh|ddeessccrr|nnaammee - Select the interface identification method. Default - is nnrr which identifies the router interfaces by their - number. Unfortunately the interface numbering scheme - in an SNMP tree can change. Some routers change their - numbering when new interfaces are added, others change - thier numbering every full moon just for fun. - - To work around this sad problem MRTG can identify - interfaces by 4 other properties. None of these works - for all interfaces, but you should be able to find one - which does fine for you. Note that especially ethernet - addrsses can be problematic as some routers have the - same ethernet address on most of their interface - cards. - - Select iipp to identify the interface by its IP number. - Use eetthh to use the ethernet address for identifica- - tion. Use ddeessccrr to use the Interface description. Or - use nnaammee to use the Interface name. - - If your chosen method does not allow unique interface - identification on the device you are querying, ccffgg-- - mmaakkeerr will tell you about it. + Select the interface identification method. Default is nnrr which + identifies the router interfaces by their number. Unfortunately + the interface numbering scheme in an SNMP tree can change. Some + routers change their numbering when new interfaces are added, oth- + ers change thier numbering every full moon just for fun. + + To work around this sad problem MRTG can identify interfaces by 4 + other properties. None of these works for all interfaces, but you + should be able to find one which does fine for you. Note that espe- + cially ethernet addrsses can be problematic as some routers have + the same ethernet address on most of their interface cards. + + Select iipp to identify the interface by its IP number. Use eetthh to + use the ethernet address for identification. Use ddeessccrr to use the + Interface description. Or use nnaammee to use the Interface name. + + If your chosen method does not allow unique interface identifica- + tion on the device you are querying, ccffggmmaakkeerr will tell you about + it. ----iiffddeesscc nnrr|iipp|eetthh|ddeessccrr|nnaammee|ttyyppee|aalliiaass - Select what to use as the description of the inter- - face. The description appears in the "Title[]" prop- - erty for the target as well as the text header in the - HTML code defined in the target's "PageTop[]". - Default is to use nnrr which is just the interface num- - ber which isn't always useful to the viewer of the - graphs. - - There are 6 other properties which could be used. Use - iipp if you want to use the interface's IP-address. Use - eetthh if you want to use the interface's ethernet - address. If you want a better description, you can - use either ddeessccrr, nnaammee or aalliiaass. Exactly what each of - these do varies between different equipment so you - might need to experiment. For instance, for a serial - interface on a Cisco router running IOS using nnaammee - might result in "S0" being the interface description , - ddeessccrr might result in "Serial0" and aalliiaass might result - in "Link to HQ" (provided that is what is used as the - interface's "description" in the router's configura- - tion). - - Finally, if you want to describe the interface by it's - Btype (i.e "ethernetCSMA", "propPointtoPoint" etc) you - can use ttyyppee. + Select what to use as the description of the interface. The + description appears in the "Title[]" property for the target as + well as the text header in the HTML code defined in the target's + "PageTop[]". Default is to use nnrr which is just the interface num- + ber which isn't always useful to the viewer of the graphs. + + There are 6 other properties which could be used. Use iipp if you + want to use the interface's IP-address. Use eetthh if you want to use + the interface's ethernet address. If you want a better descrip- + tion, you can use either ddeessccrr, nnaammee or aalliiaass. Exactly what each + of these do varies between different equipment so you might need to + experiment. For instance, for a serial interface on a Cisco router + running IOS using nnaammee might result in "S0" being the interface + description , ddeessccrr might result in "Serial0" and aalliiaass might + result in "Link to HQ" (provided that is what is used as the inter- + face's "description" in the router's configuration). + + Finally, if you want to describe the interface by it's Btype (i.e + "ethernetCSMA", "propPointtoPoint" etc) you can use ttyyppee. ----iiff--ffiilltteerr 'ffiilltteerr--eexxpprreessssiioonn' - First of all, this is under some developement and is - experimental. + First of all, this is under some developement and is experimental. - Use this if you want to have better control over what - interfaces gets included into the configuration. The - ffiilltteerr--eexxpprreessssiioonn is evaluated as a piece of Perl code - and is expected to return a truth value. If true, - include the interface and if false, exclude the inter- - face. + Use this if you want to have better control over what interfaces + gets included into the configuration. The ffiilltteerr--eexxpprreessssiioonn is + evaluated as a piece of Perl code and is expected to return a truth + value. If true, include the interface and if false, exclude the + interface. - For a further discussion on how these filters work, - see the section "Details on Filters" below. + For a further discussion on how these filters work, see the section + "Details on Filters" below. ----iiff--tteemmppllaattee tteemmppllaattee--ffiillee - First of all, this is under some development and is - experimental. + First of all, this is under some development and is experimental. - Use this if you want to control what the line for each - target should look like in the configuration file. - The contents of the file tteemmppllaattee--ffiillee will be evalu- - ated as a Perl program which generates the lines using - certain variables for input and output. + Use this if you want to control what the line for each target + should look like in the configuration file. The contents of the + file tteemmppllaattee--ffiillee will be evaluated as a Perl program which gener- + ates the lines using certain variables for input and output. - For a further discussion on how these templates work, - see the section "Details on Temaplates" below. + For a further discussion on how these templates work, see the sec- + tion "Details on Temaplates" below. ----hhoosstt--tteemmppllaattee tteemmppllaattee--ffiillee - First of all, this is under some development and is - experimental. + First of all, this is under some development and is experimental. - Use this if you want to have some extra targets - related to the host itself such as CPU utilization, - ping response time to the host, number of busy modems - etc. The contents of the file tteemmppllaattee--ffiillee will be - evaluated once per host as a Perl program which gener- - ates the lines using certain variables for input and - output. + Use this if you want to have some extra targets related to the host + itself such as CPU utilization, ping response time to the host, + number of busy modems etc. The contents of the file tteemmppllaattee--ffiillee + will be evaluated once per host as a Perl program which generates + the lines using certain variables for input and output. - For a further discussion on how these templates work, - see the section "Details on Templates" below. + For a further discussion on how these templates work, see the sec- + tion "Details on Templates" below. ----ccoommmmuunniittyy ccoommmmuunniittyy--ssttrriinngg - Use this to set the community for the routers follow- - ing on the command line to ccoommmmuunniittyy--ssttrriinngg. Individ- - ual routers might overrride this community string by - using the syntax ccoommmmuunniittyy@@rroouutteerr. + Use this to set the community for the routers following on the com- + mand line to ccoommmmuunniittyy--ssttrriinngg. Individual routers might overrride + this community string by using the syntax ccoommmmuunniittyy@@rroouutteerr. ----eennaabbllee--iippvv66 - This option enables IPv6 support. It requires the - appropriate perl modules; if they are not found then - IPv6 is disabled (see the ipv6 documentation). - - cfgmaker will use IPv6 or IPv4 depending on the tar- - get. If the target is a numeric address, the protocol - depends on the type of address. If the target is a - hostname, cfgmaker will try to resolve the name first - to an IPv6 address then to an IPv4 address. + This option enables IPv6 support. It requires the appropriate perl + modules; if they are not found then IPv6 is disabled (see the ipv6 + documentation). + + cfgmaker will use IPv6 or IPv4 depending on the target. If the tar- + get is a numeric address, the protocol depends on the type of + address. If the target is a hostname, cfgmaker will try to resolve + the name first to an IPv6 address then to an IPv4 address. - IPv6 numeric addresses must be specified between - square braces. + IPv6 numeric addresses must be specified between square braces. For example: cfgmaker --enable-ipv6 [2001:760:4::1]:165:::2 - If the target has both an IPv6 address and an IPv4 - address with the same hostname, cfgmaker first queries - the target using IPv6 and falls back to IPv4 if it - fails. This is useful for targets which don't support - SNMP over IPv6. + If the target has both an IPv6 address and an IPv4 address with the + same hostname, cfgmaker first queries the target using IPv6 and + falls back to IPv4 if it fails. This is useful for targets which + don't support SNMP over IPv6. ----uussee--1166bbiitt - This option forces the use of 16bit SNMP request IDs. - Some broken SNMP agents do not accept 32bit request - IDs. Try to avoid this option as much as possible, - complain to your agent vendor instead. - - ----ssnnmmpp--ooppttiioonnss :[ppoorrtt][:[ttiimmeeoouutt][:[rreettrriieess][:[bbaacckk-- - ooffff][:vveerrssiioonn]]]] - Use this to set the default SNMP options for all - routers following on the command line. Individual - values might be omitted as well as trailing colons. - Note that routers might override individual (or all) - values specified by ----ssnnmmpp--ooppttiioonnss by using the syntax + This option forces the use of 16bit SNMP request IDs. Some broken + SNMP agents do not accept 32bit request IDs. Try to avoid this + option as much as possible, complain to your agent vendor instead. + + ----ssnnmmpp--ooppttiioonnss :[ppoorrtt][:[ttiimmeeoouutt][:[rreettrriieess][:[bbaacckkooffff][:vveerrssiioonn]]]] + Use this to set the default SNMP options for all routers following + on the command line. Individual values might be omitted as well as + trailing colons. Note that routers might override individual (or + all) values specified by ----ssnnmmpp--ooppttiioonnss by using the syntax - rroouutteerr[:[ppoorrtt][:[ttiimmeeoouutt][:[rreettrriieess][:[bbaacckkooffff][:vveerr-- - ssiioonn]]]]] + rroouutteerr[:[ppoorrtt][:[ttiimmeeoouutt][:[rreettrriieess][:[bbaacckkooffff][:vveerrssiioonn]]]]] ----gglloobbaall ""_b_l_a_: _a_b_c"" - Use this to add global options to the generated config - file. You can call ----gglloobbaall several times to add mul- - tiple options. The line will appear in the configura- - tion just before the config for the next router - appearing on the command line. + Use this to add global options to the generated config file. You + can call ----gglloobbaall several times to add multiple options. The line + will appear in the configuration just before the config for the + next router appearing on the command line. --global "workdir: /home/mrtg" @@ -325,272 +289,223 @@ --global "options[_]: growright,bits" - Specifying ----gglloobbaall after the last router on the com- - mand line will create a line in the configuration file - which will appear after all the routers. + Specifying ----gglloobbaall after the last router on the command line will + create a line in the configuration file which will appear after all + the routers. ----nnoorreevveerrsseeddnnss - Do not try to reverse lookup IP numbers ... a must for - DNS free environments. + Do not try to reverse lookup IP numbers ... a must for DNS free + environments. ----nnoo--ddoowwnn - Normally cfgmaker will not include interfaces which - are marked anything but administratively and opera- - tionally UP. With this switch you get them all. + Normally cfgmaker will not include interfaces which are marked any- + thing but administratively and operationally UP. With this switch + you get them all. ----sshhooww--oopp--ddoowwnn Include interfaces which are operatively down. ----zzeerroo--ssppeeeedd _s_p_e_e_d - Assign this speed in bits-per-second to all interfaces - which return 0 for ifSpeed and ifHighSpeed. Some - switches, notably Foundry equipment, return a speed of - zero for some interfaces. For example, to have all - interfaces reporting zero set to 100Mbps, use + Assign this speed in bits-per-second to all interfaces which return + 0 for ifSpeed and ifHighSpeed. Some switches, notably Foundry + equipment, return a speed of zero for some interfaces. For exam- + ple, to have all interfaces reporting zero set to 100Mbps, use --zero-speed=100000000. ----ssuubbddiirrss _f_o_r_m_a_t - Give each router its own subdirectory for the HTML and - graphics (or .rrd) files. The directory name is the - given _f_o_r_m_a_t string with a couple of pattern replace- - ments. The string "HOSTNAME" will be replaced by the - hostname of the router (however you specified it on - the ccffggmmaakkeerr commandline -- it may be an actual host- - name or just an IP address), and "SNMPNAME" will be - replaced with the device's idea of its own name (the - same name that appears on the right side of the - "Title" lines). For instance, a call like: + Give each router its own subdirectory for the HTML and graphics (or + .rrd) files. The directory name is the given _f_o_r_m_a_t string with a + couple of pattern replacements. The string "HOSTNAME" will be + replaced by the hostname of the router (however you specified it on + the ccffggmmaakkeerr commandline -- it may be an actual hostname or just an + IP address), and "SNMPNAME" will be replaced with the device's idea + of its own name (the same name that appears on the right side of + the "Title" lines). For instance, a call like: cfgmaker --subdirs=HOSTNAME__SNMPNAME public@10.10.0.18 - would result in the generation of lines looking some- - thing like: + would result in the generation of lines looking something like: Directory[10.10.0.18_1]: 10.10.0.18__fp2200-bothrip-1.3 ----oouuttppuutt _f_i_l_e - Write the output from ccffggmmaakkeerr into the file _f_i_l_e. The - default is to use "STDOUT". ----oouuttppuutt is expected to - appear only once on the command line. If used multiple - times, the file specified by the last ----oouuttppuutt will be - used. + Write the output from ccffggmmaakkeerr into the file _f_i_l_e. The default is + to use "STDOUT". ----oouuttppuutt is expected to appear only once on the + command line. If used multiple times, the file specified by the + last ----oouuttppuutt will be used. ----nnooiinntteerrffaacceess Don't generate configuration lines for interfaces. - This makes cfgmaker skip all steps related to inter- - faces which means it will not do any polling of the - router to retrieve interface information which speeds - up the execution of cfgmaker and it will neither run - any interface templates. + This makes cfgmaker skip all steps related to interfaces which + means it will not do any polling of the router to retrieve inter- + face information which speeds up the execution of cfgmaker and it + will neither run any interface templates. ----iinntteerrffaacceess - This makes cfgmaker generate configuration lines for - interfaces (the default behaviour). - - The main usage of this option is to negate an --noint- - erfaces appearing earlier on the command line. - - - + This makes cfgmaker generate configuration lines for interfaces + (the default behaviour). + The main usage of this option is to negate an --nointerfaces + appearing earlier on the command line. SSNNMMPP VV33 OOppttiioonnss - CCffggmmaakkeerr supports SNMP V3. There are optional parameters - affecting SNMP operation. + CCffggmmaakkeerr supports SNMP V3 using the NNeett::SSNNMMPP perl module. There are + optional parameters affecting SNMP operation. + + --enablesnmpv3 {yes|no} + The ----eennaabblleessnnmmppvv33 option is an optional flag to check for the + presence of the NNeett::::SSNNMMPP libraries. CCffggmmaakkeerr will try to deter- + mine whether this flag is required and will set the values automat- + ically. _S_N_M_P_v_3 _A_r_g_u_m_e_n_t_s - A SNMP context is a collection of management information - accessible by a SNMP entity. An item of management infor- - mation may exist in more than one context and a SNMP - entity potentially has access to many contexts. The com- - bination of a contextEngineID and a contextName unambigu- - ously identifies a context within an administrative - domain. In a SNMPv3 message, the contextEngineID and con- - textName are included as part of the scopedPDU. All meth- - ods that generate a SNMP message optionally take a ----ccoonn-- - tteexxtteennggiinneeiidd and ----ccoonntteexxttnnaammee argument to configure these - fields. + A SNMP context is a collection of management information accessible by + a SNMP entity. An item of management information may exist in more + than one context and a SNMP entity potentially has access to many con- + texts. The combination of a contextEngineID and a contextName unam- + biguously identifies a context within an administrative domain. In a + SNMPv3 message, the contextEngineID and contextName are included as + part of the scopedPDU. All methods that generate a SNMP message + optionally take a ----ccoonntteexxtteennggiinneeiidd and ----ccoonntteexxttnnaammee argument to con- + figure these fields. Context Engine ID - The ----ccoonntteexxtteennggiinneeiidd argument expects a hexadecimal - string representing the desired contextEngineID. The - string must be 10 to 64 characters (5 to 32 octets) - long and can be prefixed with an optional "0x". Once - the ----ccoonntteexxtteennggiinneeiidd is specified it stays with the - object until it is changed again or reset to default - by passing in the undefined value. By default, the - contextEngineID is set to match the authorita- - tiveEngineID of the authoritative SNMP engine. + The ----ccoonntteexxtteennggiinneeiidd argument expects a hexadecimal string repre- + senting the desired contextEngineID. The string must be 10 to 64 + characters (5 to 32 octets) long and can be prefixed with an + optional "0x". Once the ----ccoonntteexxtteennggiinneeiidd is specified it stays + with the object until it is changed again or reset to default by + passing in the undefined value. By default, the contextEngineID is + set to match the authoritativeEngineID of the authoritative SNMP + engine. Context Name - The contextName is passed as a string which must be 0 - to 32 octets in length using the ----ccoonntteexxttnnaammee argu- - ment. The contextName stays with the object until it - is changed. The contextName defaults to an empty - string which represents the "default" context. + The contextName is passed as a string which must be 0 to 32 octets + in length using the ----ccoonntteexxttnnaammee argument. The contextName stays + with the object until it is changed. The contextName defaults to + an empty string which represents the "default" context. _U_s_e_r_-_b_a_s_e_d _S_e_c_u_r_i_t_y _M_o_d_e_l _A_r_g_u_m_e_n_t_s - The User-based Security Model (USM) used by SNMPv3 - requires that a securityName be specified using the - ----uusseerrnnaammee argument. The creation of a Net::SNMP object - with the version set to SNMPv3 will fail if the ----uusseerrnnaammee - argument is not present. The ----uusseerrnnaammee argument expects - a string 1 to 32 octets in length. - - Different levels of security are allowed by the User-based - Security Model which address authentication and privacy - concerns. A SNMPv3 target will derive the security level - (securityLevel) based on which of the following arguments - are specified. - - By default a securityLevel of 'noAuthNoPriv' is assumed. - If the ----aauutthhkkeeyy or ----aauutthhppaasssswwoorrdd arguments are speci- - fied, the securityLevel becomes 'authNoPriv'. The ----aauutthh-- - ppaasssswwoorrdd argument expects a string which is at least 1 - octet in length. Optionally, the ----aauutthhkkeeyy argument can - be used so that a plain text password does not have to be - specified in a script. The ----aauutthhkkeeyy argument expects a - hexadecimal string produced by localizing the password - with the authoritativeEngineID for the specific destina- - tion device. The "snmpkey" utility included with the - Net::SNMP distribution can be used to create the hexadec- - imal string (see snmpkey). - - Two different hash algorithms are defined by SNMPv3 which - can be used by the Security Model for authentication. - These algorithms are HMAC-MD5-96 "MD5" (RFC 1321) and - HMAC-SHA-96 "SHA-1" (NIST FIPS PUB 180-1). The default - algorithm used by the module is HMAC-MD5-96. This behav- - ior can be changed by using the ----aauutthhpprroottooccooll argument. - This argument expects either the string 'md5' or 'sha' to - be passed to modify the hash algorithm. - - By specifying the arguments ----pprriivvkkeeyy or ----pprriivvppaasssswwoorrdd - the securityLevel associated with the object becomes - 'authPriv'. According to SNMPv3, privacy requires the use - of authentication. Therefore, if either of these two - arguments are present and the ----aauutthhkkeeyy or ----aauutthhppaasssswwoorrdd - arguments are missing, the creation of the object fails. - The ----pprriivvkkeeyy and ----pprriivvppaasssswwoorrdd arguments expect the same - input as the ----aauutthhkkeeyy and ----aauutthhppaasssswwoorrdd arguments - respectively. - - The User-based Security Model described in RFC 3414 - defines a single encryption protocol to be used for pri- - vacy. This protocol, CBC-DES "DES" (NIST FIPS PUB 46-1), - is used by default or if the string 'des' is passed to the - ----pprriivvpprroottooccooll argument. By working with the Extended - Security Options Consortium http://www.snmp.com/eso/, the - module also supports additional protocols which have been - defined in draft specifications. The draft - http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt - defines the support of CBC-3DES-EDE "Triple-DES" (NIST - FIPS 46-3) in the User-based Security Model. This proto- - col can be selected using the ----pprriivvpprroottooccooll argument with - the string '3desede'. The draft - http://www.snmp.com/eso/draft-blumenthal-aes-usm-04.txt - describes the use of CFB128-AES-128/192/256 "AES" (NIST - FIPS PUB 197) in the USM. The three AES encryption proto- - cols, differentiated by their key sizes, can be selected - by passing 'aescfb128', 'aescfb192', or 'aescfb256' to the + The User-based Security Model (USM) used by SNMPv3 requires that a + securityName be specified using the ----uusseerrnnaammee argument. The creation + of a Net::SNMP object with the version set to SNMPv3 will fail if the + ----uusseerrnnaammee argument is not present. The ----uusseerrnnaammee argument expects a + string 1 to 32 octets in length. + + Different levels of security are allowed by the User-based Security + Model which address authentication and privacy concerns. A SNMPv3 tar- + get will derive the security level (securityLevel) based on which of + the following arguments are specified. + + By default a securityLevel of 'noAuthNoPriv' is assumed. If the + ----aauutthhkkeeyy or ----aauutthhppaasssswwoorrdd arguments are specified, the securityLevel + becomes 'authNoPriv'. The ----aauutthhppaasssswwoorrdd argument expects a string + which is at least 1 octet in length. Optionally, the ----aauutthhkkeeyy argu- + ment can be used so that a plain text password does not have to be + specified in a script. The ----aauutthhkkeeyy argument expects a hexadecimal + string produced by localizing the password with the authorita- + tiveEngineID for the specific destination device. The "snmpkey" util- + ity included with the Net::SNMP distribution can be used to create the + hexadecimal string (see snmpkey). + + Two different hash algorithms are defined by SNMPv3 which can be used + by the Security Model for authentication. These algorithms are + HMAC-MD5-96 "MD5" (RFC 1321) and HMAC-SHA-96 "SHA-1" (NIST FIPS PUB + 180-1). The default algorithm used by the module is HMAC-MD5-96. + This behavior can be changed by using the ----aauutthhpprroottooccooll argument. + This argument expects either the string 'md5' or 'sha' to be passed to + modify the hash algorithm. + + By specifying the arguments ----pprriivvkkeeyy or ----pprriivvppaasssswwoorrdd the secu- + rityLevel associated with the object becomes 'authPriv'. According to + SNMPv3, privacy requires the use of authentication. Therefore, if + either of these two arguments are present and the ----aauutthhkkeeyy or ----aauutthh-- + ppaasssswwoorrdd arguments are missing, the creation of the object fails. The + ----pprriivvkkeeyy and ----pprriivvppaasssswwoorrdd arguments expect the same input as the + ----aauutthhkkeeyy and ----aauutthhppaasssswwoorrdd arguments respectively. + + The User-based Security Model described in RFC 3414 defines a single + encryption protocol to be used for privacy. This protocol, CBC-DES + "DES" (NIST FIPS PUB 46-1), is used by default or if the string 'des' + is passed to the ----pprriivvpprroottooccooll argument. By working with the Extended + Security Options Consortium http://www.snmp.com/eso/, the module also + supports additional protocols which have been defined in draft specifi- + cations. The draft + http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt defines + the support of CBC-3DES-EDE "Triple-DES" (NIST FIPS 46-3) in the User- + based Security Model. This protocol can be selected using the + ----pprriivvpprroottooccooll argument with the string '3desede'. The draft + http://www.snmp.com/eso/draft-blumenthal-aes-usm-04.txt describes the + use of CFB128-AES-128/192/256 "AES" (NIST FIPS PUB 197) in the USM. The + three AES encryption protocols, differentiated by their key sizes, can + be selected by passing 'aescfb128', 'aescfb192', or 'aescfb256' to the --pprriivvpprroottooccooll argument. DDeettaaiillss oonn FFiilltteerrss - The purpose of the filters is to decide which interfaces - to accept and which interfaces to reject. This decision - is done for each interface by evaluating the filter - expression as a piece of Perl code and investigating the - result of the evaluation. If true, accept the interface + The purpose of the filters is to decide which interfaces to accept and + which interfaces to reject. This decision is done for each interface + by evaluating the filter expression as a piece of Perl code and inves- + tigating the result of the evaluation. If true, accept the interface otherwise reject it. - When working with filters, remember that Perl has it's own - idea of what truth and false is. The empty string "" and - the string "0" are false, all other strings are true. - This further imples that any integer value of 0 is false - as well as any undef value. It also implies that all ref- - erences are considered true. - - As the filter is evaluated as a Perl expression, several - useful constructs in Perl are worth mentioning: - - Expressions might be grouped by using parentheses "()". - Expressions might be combined using boolean operators such - as the following: + When working with filters, remember that Perl has it's own idea of what + truth and false is. The empty string "" and the string "0" are false, + all other strings are true. This further imples that any integer value + of 0 is false as well as any undef value. It also implies that all + references are considered true. + + As the filter is evaluated as a Perl expression, several useful + constructs in Perl are worth mentioning: + + Expressions might be grouped by using parentheses "()". Expressions + might be combined using boolean operators such as the following: "aanndd" (equivalent with "&&&&") - Boolean "and" of the two expressions, is only true if - both expressions are true. Example: _e_x_p_r_e_s_s_i_o_n_1 aanndd - _e_x_p_r_e_s_s_i_o_n_2 + Boolean "and" of the two expressions, is only true if both expres- + sions are true. Example: _e_x_p_r_e_s_s_i_o_n_1 aanndd _e_x_p_r_e_s_s_i_o_n_2 "oorr" (equivalent with "||||") - Boolean "or" of the two expressions, is true if either - or both expressions are true. Example: _e_x_p_r_e_s_s_i_o_n_1 oorr - _e_x_p_r_e_s_s_i_o_n_2 + Boolean "or" of the two expressions, is true if either or both + expressions are true. Example: _e_x_p_r_e_s_s_i_o_n_1 oorr _e_x_p_r_e_s_s_i_o_n_2 "nnoott" (equivalent with "!!") - Boolean negation of a single expression. Example: - nnoott _e_x_p_r_e_s_s_i_o_n . Yet another example: !!_e_x_p_r_e_s_s_i_o_n + Boolean negation of a single expression. Example: nnoott _e_x_p_r_e_s_s_i_o_n + . Yet another example: !!_e_x_p_r_e_s_s_i_o_n (For more details on this I recommend a book on Perl) _P_r_e_d_e_f_i_n_e_d _F_i_l_t_e_r _V_a_r_i_a_b_l_e_s - To facilitate, there are a number of predefined values - available to use in the filter. Note that these variables - are also available when templates interfaces are evaluated - (but not host templates). - - Caveat: All these variables' names begin with a dollar - sign ($), which is a syntactic requirement for scalar - variables in Perl. The danger here is that the dollar - sign in many shells is an active character (often used for - shell variables exactly as in Perl variables) so it is - important to ensure that the Perl expression isn't evalu- - ated by the command line shell as shell code before being - passed to cfgmaker as command line arguments. In shells - like Bourne shell, ksh shell or bash shell, placing the - entire expression within single qoutes will avoid such - accidental evaluation: + To facilitate, there are a number of predefined values available to use + in the filter. Note that these variables are also available when tem- + plates interfaces are evaluated (but not host templates). + + Caveat: All these variables' names begin with a dollar sign ($), + which is a syntactic requirement for scalar variables in Perl. The + danger here is that the dollar sign in many shells is an active charac- + ter (often used for shell variables exactly as in Perl variables) so it + is important to ensure that the Perl expression isn't evaluated by the + command line shell as shell code before being passed to cfgmaker as + command line arguments. In shells like Bourne shell, ksh shell or bash + shell, placing the entire expression within single qoutes will avoid + such accidental evaluation: '--if-filter=($default_iftype && $if_admin)' $$iiff__ttyyppee - This is an integer specifying the interface type as - per the SNMP standards and as reported by the polled - device. A complete list of interface types would be - impractical for this document , but there are a number - predefined varables below. Normally, cfgmaker puts in - the target's PageTop this iftype value within paran- - thesis after the name of the interface type. (e.g - "propPointToPointSerial (22)"). - - Here's a list of some of the most common interface - types by number: - - - - - - - - - - - - - - - - - - - + This is an integer specifying the interface type as per the SNMP + standards and as reported by the polled device. A complete list of + interface types would be impractical for this document , but there + are a number predefined varables below. Normally, cfgmaker puts in + the target's PageTop this iftype value within paranthesis after the + name of the interface type. (e.g "propPointToPointSerial (22)"). + Here's a list of some of the most common interface types by number: 6 ethernetCsmacd 7 iso88023Csmacd @@ -619,62 +534,54 @@ 134 ATM Sub Interface $$ddeeffaauulltt - True if and only if cfgmaker normally should accepted - the interface based on the interfaces administrative - and operational state (taking the flags ----nnoo--ddoowwnn and - ----sshhooww--oopp--ddoowwnn into account) and it's type (and a few - other things). + True if and only if cfgmaker normally should accepted the interface + based on the interfaces administrative and operational state (tak- + ing the flags ----nnoo--ddoowwnn and ----sshhooww--oopp--ddoowwnn into account) and it's + type (and a few other things). $$ddeeffaauulltt__iiffssttaattee - True if and only if cfgmaker would have accepted the - interface based on it's operational and administrative - states (also taking into account the presence of the - flags ----nnoo--ddoowwnn and ----sshhooww--oopp--ddoowwnn). + True if and only if cfgmaker would have accepted the interface + based on it's operational and administrative states (also taking + into account the presence of the flags ----nnoo--ddoowwnn and + ----sshhooww--oopp--ddoowwnn). $$ddeeffaauulltt__iiffttyyppee - True if and only if cfgmaker would have accepted the - interface based on it's type (and a few type specific - details in addition). + True if and only if cfgmaker would have accepted the interface + based on it's type (and a few type specific details in addition). $$iiff__aaddmmiinn - True if and only if the interface is in an adminstra- - tive up state. + True if and only if the interface is in an adminstrative up state. $$iiff__ooppeerr - True if and only if the interface is in an operational - up state. + True if and only if the interface is in an operational up state. - A number of variables are also predefined to easily decide - if an interface belong to a certain cathegory or not. - Below is all those variables listed together with which - if_type numbers each variable will be true for. Note that - some variables refer to other variables as well. + A number of variables are also predefined to easily decide if an inter- + face belong to a certain cathegory or not. Below is all those vari- + ables listed together with which if_type numbers each variable will be + true for. Note that some variables refer to other variables as well. $$iiff__iiss__eetthheerrnneett - True for ethernet interfaces (nr 6, 7, 26, 62, 69 and - 117). + True for ethernet interfaces (nr 6, 7, 26, 62, 69 and 117). $$iiff__iiss__iissddnn - True for various ISDN interface types (nr 20, 21, 63, - 75, 76 and 77) + True for various ISDN interface types (nr 20, 21, 63, 75, 76 and + 77) $$iiff__iiss__ddiiaalluupp - True for dial-up interfaces such as PPP as well as - ISDN. (nr 23, 81, 82 and 108 in addition to the num- - bers of $$iiff__iiss__iissddnn). + True for dial-up interfaces such as PPP as well as ISDN. (nr 23, + 81, 82 and 108 in addition to the numbers of $$iiff__iiss__iissddnn). $$iiff__iiss__aattmm - True for miscellaneous ATM related interface types (nr - 37, 49, 107, 105, 106, 114 and 134). + True for miscellaneous ATM related interface types (nr 37, 49, 107, + 105, 106, 114 and 134). $$iiff__iiss__wwaann - True for WAN interfaces point to point, Frame Relay - and High Speed Serial ( 22,32,44,46) + True for WAN interfaces point to point, Frame Relay and High Speed + Serial ( 22,32,44,46) $$iiff__iiss__llaann - True for LAN interfaces (8, 9, 11, 15, 26, 55, 59, 60 - and 115 in addition to the numbers of $$iiff__iiss__eetthheerr-- - nneett). + True for LAN interfaces (8, 9, 11, 15, 26, 55, 59, 60 and 115 in + addition to the numbers of $$iiff__iiss__eetthheerrnneett). $$iiff__iiss__ddssll True for ADSL, RDSL, HDSL and SDSL (nr 94, 95, 96, 97) @@ -683,391 +590,365 @@ True for software loopback interfaces (nr 24) $$iiff__iiss__cciissccoovvllaann - True for Cisco VLAN interfaces (interfaces with the - word Vlan or VLAN in their ifdescs) + True for Cisco VLAN interfaces (interfaces with the word Vlan or + VLAN in their ifdescs) $$iiff__vvllaann__iidd - Returns the vlan id associated with a specific port on - Cisco Catalyst switches under both Catalyst OS and - IOS. If it is not a vlan interface, will return - undef. + Returns the vlan id associated with a specific port on Cisco Cata- + lyst switches under both Catalyst OS and IOS, and 3Com switches. + If it is not a vlan interface, will return undef. + + $$iiff__cciissccoo__ttrruunnkk + Returns the trunking state of a specific port on Cisco Catalyst + switches under both Catalyst OS and IOS. Returns "1" if the inter- + face is a trunk, undef otherwise. $$iiff__MMTTUU - Returns the Maximum Transfer Unit associated with a - specific port. + Returns the Maximum Transfer Unit associated with a specific port. - Besides that, you can also use the variables defined for - templates below. Further, all the variables available in - cfgmaker is at the scripts disposal even if the use of - such features is discouraged. More "shortcuts" in the - form of variables and functions will be made avaiable in - the future instead. + Besides that, you can also use the variables defined for templates + below. Further, all the variables available in cfgmaker is at the + scripts disposal even if the use of such features is discouraged. More + "shortcuts" in the form of variables and functions will be made ava- + iable in the future instead. _E_x_a_m_p_l_e_s _o_n _F_i_l_t_e_r_s - The following filter will not affect which interfaces - get's included or excluded, it will make cfgmaker behave - as normally. + The following filter will not affect which interfaces get's included or + excluded, it will make cfgmaker behave as normally. '--if-filter=$default' - The following filter will make cfgmaker exclude PPP (23) - interfaces: + The following filter will make cfgmaker exclude PPP (23) interfaces: '--if-filter=$default && $if_type!=23' - The following filter will make cfgmaker behave as usual - except that it will consider the operational state of an - interface irrelevant but still reject all interfaces which - are administratively down. + The following filter will make cfgmaker behave as usual except that it + will consider the operational state of an interface irrelevant but + still reject all interfaces which are administratively down. '--if-filter=$if_admin && $default_iftype' - - DDeettaaiillss oonn TTeemmppllaatteess - The contents of the template files are evaluated as a Perl - program. A number or Perl variables are available for the - program to read and others are used to be written to. - - As quite a few of the predefined variables has values - which are are supposed to be used in HTML code some of - them have an "HTML-escaped" variant, e.g $html_syslocation - is the HTML escaped variant of $syslocation. The HTML - escaping means that the chars "<", ">" and "&" are - replaced by "<", ">" and "&" and that newlines - embedded in the string are prepended with "<BR>" and - appended with a space character (if a newline is last in - the string it is not touched). + The contents of the template files are evaluated as a Perl program. A + number or Perl variables are available for the program to read and oth- + ers are used to be written to. + + As quite a few of the predefined variables has values which are are + supposed to be used in HTML code some of them have an "HTML-escaped" + variant, e.g $html_syslocation is the HTML escaped variant of $sysloca- + tion. The HTML escaping means that the chars "<", ">" and "&" are + replaced by "<", ">" and "&" and that newlines embedded in + the string are prepended with "<BR>" and appended with a space charac- + ter (if a newline is last in the string it is not touched). _W_r_i_t_a_b_l_e _T_e_m_p_l_a_t_e _V_a_r_i_a_b_l_e_s - These are the variables available to store the configura- - tion lines in. Some of them are initialized prior to the - evaluation of the template but such content normally is - comments for inclusion in the final configuration file so - those variables might be reset to the empty string in the - template code to eliminate the comments. The other way - around is also possible, the contents of these variables - might be extended with further information for various - reasons such as debugging etc. - - Once the template has been evaluated, the following hap- - pens: if the template is a interface template and the - actual interface for some reason is rejected and thus - needs to be commented out, all the lines in the variable - $$ttaarrggeett__lliinneess are turned into comments by adding a hash - mark ("#") at their beginning. Then all the variables - $$hheeaadd__lliinneess, $$pprroobblleemm__lliinneess , $$ttaarrggeett__lliinneess and $$sseeppaarraa-- - ttoorr__lliinneess are concatenated together to form the lines to - add to the configuration file. + These are the variables available to store the configuration lines in. + Some of them are initialized prior to the evaluation of the template + but such content normally is comments for inclusion in the final con- + figuration file so those variables might be reset to the empty string + in the template code to eliminate the comments. The other way around + is also possible, the contents of these variables might be extended + with further information for various reasons such as debugging etc. + + Once the template has been evaluated, the following happens: if the + template is a interface template and the actual interface for some rea- + son is rejected and thus needs to be commented out, all the lines in + the variable $$ttaarrggeett__lliinneess are turned into comments by adding a hash + mark ("#") at their beginning. Then all the variables $$hheeaadd__lliinneess, + $$pprroobblleemm__lliinneess , $$ttaarrggeett__lliinneess and $$sseeppaarraattoorr__lliinneess are concatenated + together to form the lines to add to the configuration file. $$ttaarrggeett__lliinneess - This variable is the placeholder for the configuration - lines created by the template. $$ttaarrggeett__lliinneess is pre- - defined to be empty when the template code is evalu- - ated. + This variable is the placeholder for the configuration lines cre- + ated by the template. $$ttaarrggeett__lliinneess is predefined to be empty when + the template code is evaluated. $$hheeaadd__lliinneess - This variable is intended to be the placeholder for - the comment line appearing just before the target in - the configuration file. It is initialized with that - comment line before the evaluation of the template - code and if the template doesn't modify $$hheeaadd__lliinneess - during evaluation, the comment will look like usual in - the config file. + This variable is intended to be the placeholder for the comment + line appearing just before the target in the configuration file. + It is initialized with that comment line before the evaluation of + the template code and if the template doesn't modify $$hheeaadd__lliinneess + during evaluation, the comment will look like usual in the config + file. $$pprroobblleemm__lliinneess - This variable is intended to be the placholder for the - comment lines describing any problems which might have - been encountered when trying to add the target into - the configuration. For host templates it's normally - not used and for those it's predefined as the empty - string. For interface templates $$pprroobblleemm__lliinneess is - predefined with the error description comments which - cfgmaker normally would use for rejected interfaces or - as the empty string for accepted interfaces. - - It is possible to test against $$pprroobblleemm__lliinneess to find - out if an interface will be included or rejected but - this is not recommended. Test against $$iiff__ookk instead. + This variable is intended to be the placholder for the comment + lines describing any problems which might have been encountered + when trying to add the target into the configuration. For host + templates it's normally not used and for those it's predefined as + the empty string. For interface templates $$pprroobblleemm__lliinneess is prede- + fined with the error description comments which cfgmaker normally + would use for rejected interfaces or as the empty string for + accepted interfaces. + + It is possible to test against $$pprroobblleemm__lliinneess to find out if an + interface will be included or rejected but this is not recommended. + Test against $$iiff__ookk instead. $$sseeppaarraattoorr__lliinneess - This variable is the placeholder for the string to use - as the separator between the code for individual tar- - gets. The contents of this variable is put after each - target (so the lines will appear after the end of the - last target in the config as well). + This variable is the placeholder for the string to use as the sepa- + rator between the code for individual targets. The contents of + this variable is put after each target (so the lines will appear + after the end of the last target in the config as well). _P_r_e_d_e_f_i_n_e_d _T_e_m_p_l_a_t_e _V_a_r_i_a_b_l_e_s - All the variables below are available for interface tem- - plates to use. For host templates, only those listed - under "Host and System Variables" are available. + All the variables below are available for interface templates to use. + For host templates, only those listed under "Host and System Variables" + are available. - For interface templates the variables listed under "Prede- - fined Filter Variables" are also available. + For interface templates the variables listed under "Predefined Filter + Variables" are also available. _H_o_s_t _a_n_d _S_y_s_t_e_m _V_a_r_i_a_b_l_e_s $$rroouutteerr__nnaammee - This is the fully qualified name for the router. It - is affected by the following items on the command - line: the router name itself and ----ddnnss--ddoommaaiinn. + This is the fully qualified name for the router. It is affected by + the following items on the command line: the router name itself + and ----ddnnss--ddoommaaiinn. $$rroouutteerr__ccoonnnneecctt - This is the reference string for the router being - polled. It is on the form community@router possibly - followed by some snmp options. It is affected by the - following items on the command line: the router name - itself, ----ccoommmmuunniittyy, ----ssnnmmpp--ooppttiioonnss and ----ddnnss--ddoommaaiinn. + This is the reference string for the router being polled. It is on + the form community@router possibly followed by some snmp options. + It is affected by the following items on the command line: the + router name itself, ----ccoommmmuunniittyy, ----ssnnmmpp--ooppttiioonnss and ----ddnnss--ddoommaaiinn. (There's no HTML escaped variant available) $$ddiirreeccttoorryy__nnaammee - This variable should contain the directory name as - cfgmaker normally would use as the value for the - "Directory[]" directive. The value is determined by - the ----ssuubbddiirrss command line option. If ----ssuubbddiirrss isn't - specified $$ddiirreeccttoorryy__nnaammee will be the empty string. + This variable should contain the directory name as cfgmaker nor- + mally would use as the value for the "Directory[]" directive. The + value is determined by the ----ssuubbddiirrss command line option. If + ----ssuubbddiirrss isn't specified $$ddiirreeccttoorryy__nnaammee will be the empty string. (There's no HTML escaped variant available) $$ssyyssccoonnttaacctt - This variable is the router's SNMP sysContact value. - (HTML escaped variant: $$hhttmmll__ssyyssccoonnttaacctt) + This variable is the router's SNMP sysContact value. (HTML escaped + variant: $$hhttmmll__ssyyssccoonnttaacctt) $$ssyyssnnaammee - This variable is the router's SNMP sysName value. (No - HTML escaped variant available) + This variable is the router's SNMP sysName value. (No HTML escaped + variant available) $$ssyyssllooccaattiioonn - This variable is the router's SNMP sysLocation value. - (HTML escaped variant: $$hhttmmll__ssyyssllooccaattiioonn) + This variable is the router's SNMP sysLocation value. (HTML + escaped variant: $$hhttmmll__ssyyssllooccaattiioonn) $$ssyyssddeessccrr - This variable is the router's SNMP sysDescr value. It - is normally not used by cfgmaker but might be useful - in a template. (HTML escaped variant: $$hhttmmll__ssyyssddeessccrr) + This variable is the router's SNMP sysDescr value. It is normally + not used by cfgmaker but might be useful in a template. (HTML + escaped variant: $$hhttmmll__ssyyssddeessccrr) _I_n_t_e_r_f_a_c_e _T_a_r_g_e_t _R_e_l_a_t_e_d _V_a_r_i_a_b_l_e_s $$ttaarrggeett__nnaammee - This is what cfgmaker normally would use as the the - name of the target. The target name is what is found - within the square brackets, "[]", for target direc- - tives. (There's no HTML escaped variant available) + This is what cfgmaker normally would use as the the name of the + target. The target name is what is found within the square brack- + ets, "[]", for target directives. (There's no HTML escaped variant + available) $$iiff__rreeff - This the reference string for the interface. It is - expected to be used in the "Target[xyz]" directive to - distinguish what interface to use. The value of this - variable is affected by the ----iiffrreeff command line - option. It is normally used together with - $$rroouutteerr__ccoonnnneecctt. (There's no HTML escaped variant - available) + This the reference string for the interface. It is expected to be + used in the "Target[xyz]" directive to distinguish what interface + to use. The value of this variable is affected by the ----iiffrreeff com- + mand line option. It is normally used together with $$rroouutteerr__ccoonn-- + nneecctt. (There's no HTML escaped variant available) $$iiff__ookk - This variable is true if the interface is going to be - included into the configuration file, otherwise false. - Don't test against other variables such as $$pprroobb-- - lleemm__lliinneess to find out if an interface will be rejected - or not, use this $$iiff__ookk instead. + This variable is true if the interface is going to be included into + the configuration file, otherwise false. Don't test against other + variables such as $$pprroobblleemm__lliinneess to find out if an interface will + be rejected or not, use this $$iiff__ookk instead. $$ddeeffaauulltt__ttaarrggeett__lliinneess - This variable contains all the target lines which cfg- - maker by default outputs for this interface. It's - useful if you want to have the "standard target" but - want to add some extra lines to it by using a tem- - plate. - - By default cfgmaker uses the following directives for each - target it generates: Target[], SetEnv[], MaxBytes[], - Title[], PageTop[] and if there is any directory specified - also the Directory[] directive. - - To facilitate the creation of templates which generates - target configs which are similar to the default one, each - of the above mentioned directive lines have a correspond- - ing variable containing the line as cfgmaker would have - output it by default. - - Note that none of these have a HTML escaped variant, text - in them is HTML escaped where needed. Also note that they - do not have any newline at the end. + This variable contains all the target lines which cfgmaker by + default outputs for this interface. It's useful if you want to + have the "standard target" but want to add some extra lines to it + by using a template. + + By default cfgmaker uses the following directives for each target it + generates: Target[], SetEnv[], MaxBytes[], Title[], PageTop[] and if + there is any directory specified also the Directory[] directive. + + To facilitate the creation of templates which generates target configs + which are similar to the default one, each of the above mentioned + directive lines have a corresponding variable containing the line as + cfgmaker would have output it by default. + + Note that none of these have a HTML escaped variant, text in them is + HTML escaped where needed. Also note that they do not have any newline + at the end. $$ddeeffaauulltt__ttaarrggeett__ddiirreeccttiivvee - This variable contains the default string for the Tar- - get[] directive line. + This variable contains the default string for the Target[] direc- + tive line. $$ddeeffaauulltt__sseetteennvv__ddiirreeccttiivvee - This variable contains the default string for the - SetEnv[] directive line. + This variable contains the default string for the SetEnv[] direc- + tive line. $$ddeeffaauulltt__ddiirreeccttoorryy__ddiirreeccttiivvee - This variable contains the default string for the - Directory[] directive line which means it is an empty - string (with no newline) if there's no directory. + This variable contains the default string for the Directory[] + directive line which means it is an empty string (with no newline) + if there's no directory. $$ddeeffaauulltt__mmaaxxbbyytteess__ddiirreeccttiivvee - This variable contains the default string for the - MaxBytes[] directive line. + This variable contains the default string for the MaxBytes[] direc- + tive line. $$ddeeffaauulltt__ttiittllee__ddiirreeccttiivvee - This variable contains the default string for the - Title[] directive line. + This variable contains the default string for the Title[] directive + line. $$ddeeffaauulltt__ppaaggeettoopp__ddiirreeccttiivvee - This variable contains the default string for the - PageTop[] directive lines. + This variable contains the default string for the PageTop[] direc- + tive lines. _I_n_t_e_r_f_a_c_e _N_e_t_w_o_r_k _C_o_n_f_i_g_u_r_a_t_i_o_n _V_a_r_i_a_b_l_e_s $$iiff__iipp - This variable should contain the IP-address of the - interface, if any has been assigned to it. (There's - no HTML escaped variant available) + This variable should contain the IP-address of the interface, if + any has been assigned to it. (There's no HTML escaped variant + available) $$iiffiinnddeexx - This variable is the SNMP ifIndex for the interface - which per definition always is an integer. (There's - no HTML escaped variant available) + This variable is the SNMP ifIndex for the interface which per defi- + nition always is an integer. (There's no HTML escaped variant + available) $$iiff__iinnddeexx Equivalent with $$iiffiinnddeexx. $$iiff__eetthh - Contains the ethernet address of the interface, if - any. (There's no HTML escaped variant available) + Contains the ethernet address of the interface, if any. (There's + no HTML escaped variant available) $$iiff__ssppeeeedd - This variable is the speed in bytes/second (with pre- - fixes). (There's no HTML escaped variant available) + This variable is the speed in bytes/second (with prefixes). + (There's no HTML escaped variant available) $$iiff__ssppeeeedd__ssttrr - This variable is a cooked speed description which is - either in bits or bytes depending on wether or not the - bits option is active and also with the proper prefix - for the speed (k, M, G etc). (No HTML escaped variant - available) + This variable is a cooked speed description which is either in bits + or bytes depending on wether or not the bits option is active and + also with the proper prefix for the speed (k, M, G etc). (No HTML + escaped variant available) $$iiff__ttyyppee__ddeesscc - This variable is a textual description of the inter- - face type. (HTML escaped variant: $$hhttmmll__iiff__ttyyppee__ddeesscc) + This variable is a textual description of the interface type. + (HTML escaped variant: $$hhttmmll__iiff__ttyyppee__ddeesscc) $$iiff__ttyyppee__nnuumm - This variable the integer value corresponding to the - interface type (for a listing for the value for the - more common interface types, see the section DETAILS - ON FILTERS above). (No HTML escaped variant avail- - able) + This variable the integer value corresponding to the interface type + (for a listing for the value for the more common interface types, + see the section DETAILS ON FILTERS above). (No HTML escaped vari- + ant available) $$iiff__ddnnss__nnaammee - This is the DNS name for the interface. (No HTML - escaped variant available) + This is the DNS name for the interface. (No HTML escaped variant + available) _I_n_t_e_r_f_a_c_e _N_a_m_e_, _D_e_s_c_r_i_p_t_i_o_n _a_n_d _A_l_i_a_s _V_a_r_i_a_b_l_e_s - It might seem confusing with both _N_a_m_e, _D_e_s_c_r_i_p_t_i_o_n and - _A_l_i_a_s in this context and to some extent it is. _N_a_m_e and - _D_e_s_c_r_i_p_t_i_o_n are usually supported on most equipment but - how they are used varies, both between manufacturers as - well as between different cathegories of equipment from - the same manufacturer. The _A_l_i_a_s is at least supported by - Cisco IOS, and that variable contains whatever is used in - the IOS statement called "description" for the interface - (not to be confused with the SNMP variables for _D_e_s_c_r_i_p_- - _t_i_o_n). - - For better control from the command line consider - $$iiff__ttiittllee__ddeesscc which contents are controlled by the - ----iiff--ddeessccrr command line option. + It might seem confusing with both _N_a_m_e, _D_e_s_c_r_i_p_t_i_o_n and _A_l_i_a_s in this + context and to some extent it is. _N_a_m_e and _D_e_s_c_r_i_p_t_i_o_n are usually + supported on most equipment but how they are used varies, both between + manufacturers as well as between different cathegories of equipment + from the same manufacturer. The _A_l_i_a_s is at least supported by Cisco + IOS, and that variable contains whatever is used in the IOS statement + called "description" for the interface (not to be confused with the + SNMP variables for _D_e_s_c_r_i_p_t_i_o_n). + + For better control from the command line consider $$iiff__ttiittllee__ddeesscc which + contents are controlled by the ----iiff--ddeessccrr command line option. $$iiff__ssnnmmpp__ddeessccrr - This variable should contain the "raw" description of - the interface as determined by the SNMP polling of the - router. (HTML escaped variant: $$hhttmmll__iiff__ssnnmmpp__ddeessccrr) + This variable should contain the "raw" description of the interface + as determined by the SNMP polling of the router. (HTML escaped + variant: $$hhttmmll__iiff__ssnnmmpp__ddeessccrr) $$iiff__ssnnmmpp__nnaammee - The "raw" name for the interface as provided by SNMP - polling. (HTML escaped variant: $$hhttmmll__iiff__ssnnmmpp__nnaammee) + The "raw" name for the interface as provided by SNMP polling. + (HTML escaped variant: $$hhttmmll__iiff__ssnnmmpp__nnaammee) $$iiff__ssnnmmpp__aalliiaass - The "raw" ifAlias for the interface as provided by - SNMP polling. (HTML escaped variant: - $$hhttmmll__iiff__ssnnmmpp__aalliiaass) + The "raw" ifAlias for the interface as provided by SNMP polling. + (HTML escaped variant: $$hhttmmll__iiff__ssnnmmpp__aalliiaass) $$iiff__cciissccoo__ddeessccrr - The "raw" CiscolocIfDescr for the interface as pro- - vided by SNMP polling. (HTML escaped variant: - $$hhttmmll__iiff__cciissccoo__ddeessccrr) + The "raw" CiscolocIfDescr for the interface as provided by SNMP + polling. (HTML escaped variant: $$hhttmmll__iiff__cciissccoo__ddeessccrr) $$iiff__ddeessccrriippttiioonn - This is the "cooked" description string for the inter- - face, taking into account the SNMP values found for - the interface's RDescr, ifAlias and CiscolocIfDescr. - (HTML escaped variant: $$hhttmmll__iiff__ddeessccrriippttiioonn) + This is the "cooked" description string for the interface, taking + into account the SNMP values found for the interface's RDescr, + ifAlias and CiscolocIfDescr. (HTML escaped variant: + $$hhttmmll__iiff__ddeessccrriippttiioonn) $$iiff__ttiittllee - The full string cfgmaker by default would have used - for the Title[] directive in the configuration as well - as the content of the topmost H1 tag in the PageTop[]. - Is composed by the contents of $$ddeesscc__pprreeffiixx, - $$iiff__ttiittllee__ddeesscc and $$ssyyssnnaammee. - - As $$iiff__ttiittllee depends on $$iiff__ttiittllee__ddeesscc, it is possible - to indirectly control $$iiff__ttiittllee by using the command - line option ----iiff--ddeessccrr. + The full string cfgmaker by default would have used for the Title[] + directive in the configuration as well as the content of the top- + most H1 tag in the PageTop[]. Is composed by the contents of + $$ddeesscc__pprreeffiixx, $$iiff__ttiittllee__ddeesscc and $$ssyyssnnaammee. + + As $$iiff__ttiittllee depends on $$iiff__ttiittllee__ddeesscc, it is possible to indi- + rectly control $$iiff__ttiittllee by using the command line option + ----iiff--ddeessccrr. (HTML escaped variant: $$hhttmmll__iiff__ttiittllee) $$iiff__ppoorrtt__nnaammee - If the host is a Cisco Catalyst LAN switch, this vari- - able is the name of that port. (No HTML escaped vari- - ant available) + If the host is a Cisco Catalyst LAN switch, this variable is the + name of that port. (No HTML escaped variant available) + + $$iiff__pppp__ppoorrtt__nnaammee + If the host is a Nortel Passport LAN switch, this variable is the + name of that port. (No HTML escaped variant available) $$ddeesscc__pprreeffiixx - This variable is a prefix of the description of what - the target is to use in the "Title[]" directive and in - the H1 section of the "PageTop[]". Default is "Traf- - fic analysis for ". (HTML escaped variant: - $$hhttmmll__ddeesscc__pprreeffiixx) + This variable is a prefix of the description of what the target is + to use in the "Title[]" directive and in the H1 section of the + "PageTop[]". Default is "Traffic analysis for ". (HTML escaped + variant: $$hhttmmll__ddeesscc__pprreeffiixx) $$iiff__ttiittllee__ddeesscc - This is the description of the interface normally used - by cfgmaker as part of the variable $$iiff__ttiittllee. The - latter is used as the full string in the "Title[]" - directove and the H1 section in the PageTop[]. - - $$iiff__ttiittllee__ddeesscc is controlled by the command line - option ----iiff--ddeessccrr which indirectly controls the con- - tents of $$iiff__ttiittllee + This is the description of the interface normally used by cfgmaker + as part of the variable $$iiff__ttiittllee. The latter is used as the full + string in the "Title[]" directove and the H1 section in the Page- + Top[]. + + $$iiff__ttiittllee__ddeesscc is controlled by the command line option ----iiff--ddeessccrr + which indirectly controls the contents of $$iiff__ttiittllee (HTML escaped variant: $$hhttmmll__iiff__ttiittllee__ddeesscc) _H_e_l_p _F_u_n_c_t_i_o_n_s _f_o_r _T_e_m_p_l_a_t_e_s - The following functions exists to facilitate the writing - of host and interface templates. + The following functions exists to facilitate the writing of host and + interface templates. hhttmmll__eessccaappee((_ss_tt_rr_ii_nn_gg)) - _hh_tt_mm_ll____ee_ss_cc_aa_pp_ee_((_)) takes a string as an argument and - returns a new string where the following substitutions - has been done: the chars "<", ">" and "&" are - replaced by "<", ">" and "&" and that - newlines embedded in the string are prepended with - "<BR>" and appended with a space character (newlines - at the end of the string are not touched). + _hh_tt_mm_ll____ee_ss_cc_aa_pp_ee_((_)) takes a string as an argument and returns a new + string where the following substitutions has been done: the chars + "<", ">" and "&" are replaced by "<", ">" and "&" and + that newlines embedded in the string are prepended with "<BR>" and + appended with a space character (newlines at the end of the string + are not touched). + + ooiidd__ppiicckk(($$rroouutteerr__ccoonnnneecctt,,$$vv33oopptt,,""ooiidd11"",,""ooiidd22""......)) + This function will try to poll each of the oids specified until it + is successful or has run out of oids. It will return the name of + the first oid that worked or undef if it is not successful _E_x_a_m_p_l_e _T_e_m_p_l_a_t_e _F_i_l_e_s - Template Example 1: Eliminating Rejected Targets From - Appearing + Template Example 1: Eliminating Rejected Targets From Appearing - This template file generates exactly the same configura- - tion code per interface as cfgmaker does by default, with - the exception that it eliminates all lines (comments as - well as config code) for an interface if the interface - happens to be rejected. + This template file generates exactly the same configuration code per + interface as cfgmaker does by default, with the exception that it elim- + inates all lines (comments as well as config code) for an interface if + the interface happens to be rejected. if(not $problem_lines) { @@ -1116,9 +997,12 @@ </tr> ECHO - - - + $target_lines .= <<ECHO if defined $if_pp_port_name; + <tr> + <td>Port Name:</td> + <td>$if_pp_port_name</td> + </tr> + ECHO $target_lines .= <<ECHO; <tr> @@ -1147,15 +1031,14 @@ _T_e_m_p_l_a_t_e _E_x_a_m_p_l_e _2_: _S_i_m_p_l_i_e_r _V_e_r_s_i_o_n _o_f _E_x_a_m_p_l_e _1 - Example 1 was partly intended to demonstrate how to cus- - tomize the generation of interface targets but also to - provide a hint of how the variables are used in the - "default" template which one could consider that cfgmaker - normally uses. - - If you're only intrested in the easiest way of entirely - eliminating those reject interfaces, the template below - would do the job as well by using $$ddeeffaauulltt__ttaarrggeett__lliinneess. + Example 1 was partly intended to demonstrate how to customize the gen- + eration of interface targets but also to provide a hint of how the + variables are used in the "default" template which one could consider + that cfgmaker normally uses. + + If you're only intrested in the easiest way of entirely eliminating + those reject interfaces, the template below would do the job as well by + using $$ddeeffaauulltt__ttaarrggeett__lliinneess. if($if_ok) { $target_lines = $default_target_lines; @@ -1178,14 +1061,6 @@ $target_lines .= <<ECHO; - - - - - - - - YLegend[$target_name]: Percentage CPU load ShortLegend[$target_name]: % Legend1[$target_name]: CPU load in % @@ -1223,37 +1098,33 @@ ECHO EEXXAAMMPPLLEESS - The first example creates a config file for - _r_o_u_t_e_r_._p_l_a_c_e_._x_y_z: the router has the community name _p_u_b_- - _l_i_c. Interfaces get identified by their IP number. Two - global options get added to the config file. The config - file gets redirected to _m_r_t_g_._c_o_n_f. The '\' signs at the - end of the line mean that this command should be written - on a single line. + The first example creates a config file for _r_o_u_t_e_r_._p_l_a_c_e_._x_y_z: the + router has the community name _p_u_b_l_i_c. Interfaces get identified by + their IP number. Two global options get added to the config file. The + config file gets redirected to _m_r_t_g_._c_o_n_f. The '\' signs at the end of + the line mean that this command should be written on a single line. cfgmaker --global "WorkDir: /home/tobi" \ --global "Options[_]: growright,bits" \ --ifref=ip \ public@router.place.xyz > mrtg.cfg - Note: if cfgmaker is not in your path, but you are in the - directory where cfgmaker is stored, you can start it with - ./cfgmaker + Note: if cfgmaker is not in your path, but you are in the directory + where cfgmaker is stored, you can start it with ./cfgmaker The next example creates a config file for four devices: - _r_o_u_t_e_r_1_._p_l_a_c_e_._x_y_z, _r_o_u_t_e_r_2_._p_l_a_c_e_._x_y_z, _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z - and _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z all with the community _p_u_b_l_i_c. + _r_o_u_t_e_r_1_._p_l_a_c_e_._x_y_z, _r_o_u_t_e_r_2_._p_l_a_c_e_._x_y_z, _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z and + _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z all with the community _p_u_b_l_i_c. - The two routers will have ----iiffrreeff set to ddeessccrr whilst the - two switches will use ----iiffrreeff set to nnaammee. Further the - routers will use ----iiffddeesscc set to aalliiaass and - _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z will use ----iiffddeesscc set to ddeessccrr whilst - _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z use nnaammee instead. - - Finally, there will be two Options lines inserted in the - configuration: One will be in the beginning, whilst the - other will be inserted after the lines related to the two - routers but before those lines related to the switches. + The two routers will have ----iiffrreeff set to ddeessccrr whilst the two switches + will use ----iiffrreeff set to nnaammee. Further the routers will use ----iiffddeesscc + set to aalliiaass and _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z will use ----iiffddeesscc set to ddeessccrr + whilst _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z use nnaammee instead. + + Finally, there will be two Options lines inserted in the configuration: + One will be in the beginning, whilst the other will be inserted after + the lines related to the two routers but before those lines related to + the switches. cfgmaker --global "WorkDir: /home/tobi" \ --global "Options[_]: growright,bits" \ @@ -1269,18 +1140,15 @@ public@switch2.place.xyz > mrtg.cfg The next example demonstrates how to use the ----ccoommmmuunniittyy, - ----ssnnmmpp--ooppttiioonnss and ----ddnnss--ddoommaaiinn to make the command line - simpler. All the equipment will use the community _h_i_d_d_e_n, - except for the ppp-server which use community _a_c_c_e_s_s. All - equipment uses these SNMP options: 11ss ttiimmeeoouutt, 11 rreettrryy and - SSNNMMPP vveerrssiioonn 22 (bbaacckkooffff and ppoorrtt is unspecified which - means they use the default values). The exception again - is the ppp-server which uses SSNNMMPP vveerrssiioonn 11. Finally, all - the equipment is part of the domain _p_l_a_c_e_._x_y_z, except for - the ppp-server which is part of the domain - _r_e_m_o_t_e_._p_l_a_c_e_._x_y_z. Note that the latter is achieved simply - by specifying the name of the ppp-server to be - _p_p_p_-_s_e_r_v_e_r_._rr_ee_mm_oo_tt_ee . + ----ssnnmmpp--ooppttiioonnss and ----ddnnss--ddoommaaiinn to make the command line simpler. All + the equipment will use the community _h_i_d_d_e_n, except for the ppp-server + which use community _a_c_c_e_s_s. All equipment uses these SNMP options: 11ss + ttiimmeeoouutt, 11 rreettrryy and SSNNMMPP vveerrssiioonn 22 (bbaacckkooffff and ppoorrtt is unspecified + which means they use the default values). The exception again is the + ppp-server which uses SSNNMMPP vveerrssiioonn 11. Finally, all the equipment is + part of the domain _p_l_a_c_e_._x_y_z, except for the ppp-server which is part + of the domain _r_e_m_o_t_e_._p_l_a_c_e_._x_y_z. Note that the latter is achieved sim- + ply by specifying the name of the ppp-server to be _p_p_p_-_s_e_r_v_e_r_._rr_ee_mm_oo_tt_ee . cfgmaker --global "WorkDir: /home/tobi" \ --global "Options[_]: growright,bits" \ @@ -1305,16 +1173,15 @@ mrtg-reference AAUUTTHHOORR - Tobias Oetiker <tobi@oetiker.ch> and Jakob Ilves - <jakob.ilves@oracle.com> + Tobias Oetiker <tobi@oetiker.ch> and Jakob Ilves <jakob.ilves@ora- + cle.com> LLIICCEENNSSEE GNU General Public License CCOOPPYYRRIIGGHHTT - Cfgmaker is Copyright 2000 by Tobias Oetiker - <tobi@oetiker.ch> + Cfgmaker is Copyright 2000 by Tobias Oetiker <tobi@oetiker.ch> -2.14.7 2006-09-06 CFGMAKER(1) +2.16.1 2008-02-17 CFGMAKER(1) diff -Nru mrtg-2.14.7/doc/indexmaker.1 mrtg-2.16.1/doc/indexmaker.1 --- mrtg-2.14.7/doc/indexmaker.1 2006-09-06 14:42:55.000000000 +0100 +++ mrtg-2.16.1/doc/indexmaker.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,90 +129,90 @@ .\" ======================================================================== .\" .IX Title "INDEXMAKER 1" -.TH INDEXMAKER 1 "2006-09-06" "2.14.7" "mrtg" +.TH INDEXMAKER 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" -indexmaker \- Creates index files for mrtg web sites (mrtg\-2.14.7) +indexmaker \- Creates index files for mrtg web sites (mrtg\-2.16.1) .SH "SYNOPSIS" .IX Header "SYNOPSIS" indexmaker [options] mrtg.cfg [other.cfg ...] .SH "OPTIONS" .IX Header "OPTIONS" .Vb 1 -\& --output=filename set output filename (default: stdout) +\& \-\-output=filename set output filename (default: stdout) .Ve .PP .Vb 3 -\& --filter title=~regexp select targets by matching regexp against titles -\& --filter pagetop=~regexp select targets by matching regexp against pagetop -\& --filter name=~regexp select targets by matchin regexp against name +\& \-\-filter title=~regexp select targets by matching regexp against titles +\& \-\-filter pagetop=~regexp select targets by matching regexp against pagetop +\& \-\-filter name=~regexp select targets by matchin regexp against name .Ve .PP .Vb 9 -\& --addhead=text insert this text between and -\& --title=text set title of generated index file -\& --subtitle=text add a subtitle to the generated index file -\& --bodyopt=text set body tag options -\& --headlevel=number use at top of page (default: 1) -\& --pagetop=text insert this text between and

...

-\& --pageend=text insert this text after the main body -\& --pagetopend=text use this text for pagetop or pageend if undefined -\& --nolegend do not add the Mrtg legend at the end of the page +\& \-\-addhead=text insert this text between and +\& \-\-title=text set title of generated index file +\& \-\-subtitle=text add a subtitle to the generated index file +\& \-\-bodyopt=text set body tag options +\& \-\-headlevel=number use at top of page (default: 1) +\& \-\-pagetop=text insert this text between and

...

+\& \-\-pageend=text insert this text after the main body +\& \-\-pagetopend=text use this text for pagetop or pageend if undefined +\& \-\-nolegend do not add the Mrtg legend at the end of the page .Ve .PP .Vb 4 -\& --columns=number show graphs in a table with x columns (default: 2) -\& --perhost show graphs of the same host on a row -\& --compact try to make a vertically more compact page -\& --optlog log the used command line in the page (default: log) +\& \-\-columns=number show graphs in a table with x columns (default: 2) +\& \-\-perhost show graphs of the same host on a row +\& \-\-compact try to make a vertically more compact page +\& \-\-optlog log the used command line in the page (default: log) .Ve .PP .Vb 4 -\& --sort=title sort graphs by title -\& --sort=name sort graphs by their name -\& --sort=descr sort graphs by their description -\& --sort=original leave as is (default) +\& \-\-sort=title sort graphs by title +\& \-\-sort=name sort graphs by their name +\& \-\-sort=descr sort graphs by their description +\& \-\-sort=original leave as is (default) .Ve .PP .Vb 1 -\& --enumerate add a sequence number to the title of each graph +\& \-\-enumerate add a sequence number to the title of each graph .Ve .PP .Vb 6 -\& --picfirst place pictures before text (default: text first) -\& --width=number set width of graphs (default: not set) -\& --height=number -\& --sidebyside place text / pictures side by side (default: above/below) -\& --bold use bold text (default: bold) -\& --clicktext make the text link to the inner page (like the image) +\& \-\-picfirst place pictures before text (default: text first) +\& \-\-width=number set width of graphs (default: not set) +\& \-\-height=number +\& \-\-sidebyside place text / pictures side by side (default: above/below) +\& \-\-bold use bold text (default: bold) +\& \-\-clicktext make the text link to the inner page (like the image) .Ve .PP .Vb 5 -\& --show=day pick which graph to show in the index (default) -\& --show=week -\& --show=month -\& --show=year -\& --show=none +\& \-\-show=day pick which graph to show in the index (default) +\& \-\-show=week +\& \-\-show=month +\& \-\-show=year +\& \-\-show=none .Ve .PP .Vb 6 -\& --section=h1 h1 tag from pagetop as section heading (default) -\& --section=title title as section headings for graphs -\& --section=name graph name as section heading -\& --section=descr graph description as section heading -\& --section=portname port name entry in pagetop as section heading -\& --sectionhost Try to prepend the host to the section heading if missing +\& \-\-section=h1 h1 tag from pagetop as section heading (default) +\& \-\-section=title title as section headings for graphs +\& \-\-section=name graph name as section heading +\& \-\-section=descr graph description as section heading +\& \-\-section=portname port name entry in pagetop as section heading +\& \-\-sectionhost Try to prepend the host to the section heading if missing .Ve .PP .Vb 5 -\& --rrdviewer=path path to rrdviewer (default: /cgi-bin/14all.cgi) -\& --icondir=path path to icondir -\& --prefix=path path from the location of the index.html to the graphs -\& --headeradd=string add string to the html page header -\& --autoprefix try to set prefix automatically +\& \-\-rrdviewer=path path to rrdviewer (default: /cgi\-bin/14all.cgi) +\& \-\-icondir=path path to icondir +\& \-\-prefix=path path from the location of the index.html to the graphs +\& \-\-headeradd=string add string to the html page header +\& \-\-autoprefix try to set prefix automatically .Ve .PP .Vb 1 -\& ---file=file read string argument for option from file +\& \-\-\-file=file read string argument for option from file .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" diff -Nru mrtg-2.14.7/doc/indexmaker.pod mrtg-2.16.1/doc/indexmaker.pod --- mrtg-2.14.7/doc/indexmaker.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/indexmaker.pod 2008-02-17 10:27:36.000000000 +0000 @@ -1,7 +1,7 @@ #! /usr/bin/perl -w # -*- mode: Perl -*- ################################################################## -# MRTG 2.14.7 --- Index Generator +# MRTG 2.16.1 --- Index Generator ################################################################## # # This reads a mrtg.cfg file form std input or cmdline argument @@ -58,7 +58,7 @@ my $argz = "$0"; foreach my $ar (@argv) { if ($ar =~ /[ |()]/ ) { - $ar = sprintf "\"%s\"", $ar; + $ar = sprintf qq{"%s"}, $ar; } $argz .= " $ar"; } @@ -303,26 +303,27 @@ $$opt{title} - - - - - - + + + + + + + $headeradd ECHO - $index .= < - ECHO + $index .= < @@ -398,10 +399,10 @@ /^descr(iption)?$/ && do{ $section = "No Description for $item"; - $$rcfg{setenv}{$item} =~ /MRTG_INT_DESCR="(.*?)"/ #" + $$rcfg{setenv}{$item} =~ /MRTG_INT_DESCR="(.+?)"/ #" and $section = $1; $$rcfg{pagetop}{$item} =~ - m,Description:\s*\Q$section\E\s*(.*?),i + m,Description:\s*\Q$section\E\s*([^< ][^<]+?),i and $section = $1; last; }; @@ -430,9 +431,9 @@ if (not $image) { if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; + my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; $index .= - "
". + "". "$$opt{boldon}". "$section$$opt{boldoff}"; } else { @@ -463,11 +464,11 @@ if ( !($picfirstloop^$$opt{picfirst}) ) { # figure show name for rrd viewer if ($$cfg{logformat} eq 'rrdtool') { - my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; - $index .= "". + my $sep = $$opt{rrdviewer} =~ /\?/ ? '&' : '?'; + $index .= "". "\"$item" + "SRC=\"$$opt{rrdviewer}".$sep."log=$item&cfg=$$cfgfile{$item}&png=$$opt{show}.". + "s&small=1\">" } else { $index .= " @@ -615,7 +616,7 @@ $$opt{prefix} .= '/'; $$opt{prefix} =~ s|/+$|/|; } - die ("Indexmaker for mrtg-2.14.7\n") if $$opt{version}; + die ("Indexmaker for mrtg-2.16.1\n") if $$opt{version}; pod2usage(-exitval => 1, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not @ARGV; @@ -645,7 +646,7 @@ =head1 NAME -indexmaker - Creates index files for mrtg web sites (mrtg-2.14.7) +indexmaker - Creates index files for mrtg web sites (mrtg-2.16.1) =head1 SYNOPSIS diff -Nru mrtg-2.14.7/doc/indexmaker.txt mrtg-2.16.1/doc/indexmaker.txt --- mrtg-2.14.7/doc/indexmaker.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/indexmaker.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,10 +1,9 @@ -INDEXMAKER(1) mrtg INDEXMAKER(1) +INDEXMAKER(1) mrtg INDEXMAKER(1) NNAAMMEE - indexmaker - Creates index files for mrtg web sites - (mrtg-2.14.7) + indexmaker - Creates index files for mrtg web sites (mrtg-2.16.1) SSYYNNOOPPSSIISS indexmaker [options] mrtg.cfg [other.cfg ...] @@ -67,41 +66,38 @@ ---file=file read string argument for option from file DDEESSCCRRIIPPTTIIOONN - IInnddeexxmmaakkeerr can create web pages which display the status - of an array of mrtg interface status pages. + IInnddeexxmmaakkeerr can create web pages which display the status of an array of + mrtg interface status pages. ----oouuttppuutt _f_i_l_e_n_a_m_e set output filename (default: stdout) ----ffiilltteerr (ttiittllee|ppaaggeettoopp|nnaammee)(==~~|!!~~)_r_e_g_e_x_p - Several filters may get set. Each filter can match - agains the contents of a specific section of the mrtg - config file. NNaammee refers to the bit in square brackets - (option[name]: bla). + Several filters may get set. Each filter can match agains the con- + tents of a specific section of the mrtg config file. NNaammee refers to + the bit in square brackets (option[name]: bla). - Depending on the match operator chosen (==~~ or !!~~) the - match will be positive or negative. + Depending on the match operator chosen (==~~ or !!~~) the match will be + positive or negative. - Note that some shells consider !! a special character. - It may be necessary to type \\!!~~ instead. + Note that some shells consider !! a special character. It may be + necessary to type \\!!~~ instead. ----ttiittllee _t_e_x_t Set title of generated index file (default: regexp) ----bbooddyyoopptt _t_e_x_t - The value of this argument gets appended to the - tag. This allows to set document colors. By default - this option is set to + The value of this argument gets appended to the tag. This + allows to set document colors. By default this option is set to bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000" ----ccoolluummnnss _n_u_m_b_e_r - Display graphs in a table with _n_u_m_b_e_r columns - (default: 2) + Display graphs in a table with _n_u_m_b_e_r columns (default: 2) ----ssoorrtt ttiittllee|nnaammee|ddeessccrr|oorriiggiinnaall - Sort the graphs in the page either by ttiittllee, by nnaammee, - by interface ddeessccrription, or leave them as is. + Sort the graphs in the page either by ttiittllee, by nnaammee, by interface + ddeessccrription, or leave them as is. ----eennuummeerraattee Add a sequence number to the title of each graph @@ -113,60 +109,53 @@ Set the height of the graphs ----sshhooww ddaayy|wweeeekk|mmoonntthh|yyeeaarr|nnoonnee - Select which graph to show in the index page. You can - supress images completely with ----sshhooww==nnoonnee. + Select which graph to show in the index page. You can supress + images completely with ----sshhooww==nnoonnee. ----sseeccttiioonn hh11|ttiittllee|nnaammee|ddeessccrriippttiioonn|ppoorrttnnaammee - Select what to use as the title for each graph in the - page. hh11 is the H1 section from pagetop, ttiittllee is the - graph title, nnaammee is the bit in square brackets - (option[name]: bla), and ddeessccrr or ddeessccrriippttiioonn is the - text from the Description field of the PageTop (the - Cisco description text if it's available, otherwise - just the interface description). ppoorrttnnaammee is the "Port - Name:" from pagetop. + Select what to use as the title for each graph in the page. hh11 is + the H1 section from pagetop, ttiittllee is the graph title, nnaammee is the + bit in square brackets (option[name]: bla), and ddeessccrr or ddeessccrriipp-- + ttiioonn is the text from the Description field of the PageTop (the + Cisco description text if it's available, otherwise just the inter- + face description). ppoorrttnnaammee is the "Port Name:" from pagetop. ----sseeccttiioonnhhoosstt - Extract the hostname from the target line (this does - not work if the target is a mathematial expression). - Prepend the hostname (and a colon) to the section if - not already present. + Extract the hostname from the target line (this does not work if + the target is a mathematial expression). Prepend the hostname (and + a colon) to the section if not already present. ----rrrrddvviieewweerr _p_a_t_h - If you have set the LLooggFFoorrmmaatt:: rrrrddttooooll property in the - mrtg.cfg file, the index will take this into account. - The only thing you must tell it is the path to your - grapher cgi. (default: /cgi-bin/14all.cgi) + If you have set the LLooggFFoorrmmaatt:: rrrrddttooooll property in the mrtg.cfg + file, the index will take this into account. The only thing you + must tell it is the path to your grapher cgi. (default: + /cgi-bin/14all.cgi) ----pprreeffiixx _p_a_t_h - By default we assume that the file generated by - indexmaker is stored in _W_o_r_k_D_i_r. If you want to - store it somewhere else, specify how to reach - _W_o_r_k_D_i_r from the place where the Index is stored. - Note that you have to use '/' as path separator as - this will be used in urls. Speaking of which, you can - even enter a whole url. + By default we assume that the file generated by indexmaker is + stored in _W_o_r_k_D_i_r. If you want to store it somewhere else, + specify how to reach _W_o_r_k_D_i_r from the place where the Index is + stored. Note that you have to use '/' as path separator as this + will be used in urls. Speaking of which, you can even enter a whole + url. ----aauuttoopprreeffiixx _p_a_t_h - Requires --output. Try to generate the prefix auto- - matically by comparision of the path to the output - file set with --output and the Htmldir set in the con- - figuration files. Particulary useful when multiple - configuration files are specified, with different + Requires --output. Try to generate the prefix automatically by + comparision of the path to the output file set with --output and + the Htmldir set in the configuration files. Particulary useful + when multiple configuration files are specified, with different Htmldir settings. ----ooppttlloogg - Default is logging in the generated page the command - line, suppress with --nooptlog . Useful if the comman- - dline contains a complex --pagetop=string which could - confuse simple browsers. + Default is logging in the generated page the command line, suppress + with --nooptlog . Useful if the commandline contains a complex + --pagetop=string which could confuse simple browsers. ----ssoommeeooppttiioonn--ffiillee _f_i_l_e_n_a_m_e - For any someoption which takes a _s_t_r_i_n_g as parameter - you can read the string from a file by adding <-file> - to the option keyword. The whole content of the file - will be read and used as the _s_t_r_i_n_g. The file must - exist. + For any someoption which takes a _s_t_r_i_n_g as parameter you can read + the string from a file by adding <-file> to the option keyword. The + whole content of the file will be read and used as the _s_t_r_i_n_g. The + file must exist. AAUUTTHHOORR Tobias Oetiker @@ -179,4 +168,4 @@ -2.14.7 2006-09-06 INDEXMAKER(1) +2.16.1 2008-02-17 INDEXMAKER(1) diff -Nru mrtg-2.14.7/doc/mrtg.1 mrtg-2.16.1/doc/mrtg.1 --- mrtg-2.14.7/doc/mrtg.1 2006-09-06 14:42:54.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG 1" -.TH MRTG 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg \- What is MRTG ? .SH "DESCRIPTION" @@ -285,20 +285,20 @@ Enable debug options. The argument of the debug option is a comma separated list of debug values: .Sp .Vb 8 -\& cfg - watch the config file reading -\& dir - directory mangeling -\& base - basic program flow -\& tarp - target parser -\& snpo - snmp polling -\& fork - forking view -\& time - some timing info -\& log - logging of data via rateup or rrdtool +\& cfg \- watch the config file reading +\& dir \- directory mangeling +\& base \- basic program flow +\& tarp \- target parser +\& snpo \- snmp polling +\& fork \- forking view +\& time \- some timing info +\& log \- logging of data via rateup or rrdtool .Ve .Sp Example: .Sp .Vb 1 -\& --debug="cfg,snpo" +\& \-\-debug="cfg,snpo" .Ve .SH "READ ON" .IX Header "READ ON" diff -Nru mrtg-2.14.7/doc/mrtg-contrib.1 mrtg-2.16.1/doc/mrtg-contrib.1 --- mrtg-2.14.7/doc/mrtg-contrib.1 2006-09-06 14:42:54.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-contrib.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-CONTRIB 1" -.TH MRTG-CONTRIB 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-CONTRIB 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-contrib \- Contribution Guidelines for MRTG .SH "DESCRIPTION" @@ -143,7 +143,7 @@ .IX Subsection "Translations" \&\s-1MRTG\s0 messages have been translated to a number of languages but there are still many which have not been covered yet. If you want to add yours, go -into the \fImrtg\-2.14.7/translate\fR directory and follow the instructions +into the \fImrtg\-2.16.1/translate\fR directory and follow the instructions given in the \fI\s-1README\s0\fR file. .Sh "Patches" .IX Subsection "Patches" @@ -157,13 +157,13 @@ and type .PP .Vb 1 -\& diff --unified --ignore-space-change old-file new-file > simple.patch +\& diff \-\-unified \-\-ignore\-space\-change old\-file new\-file > simple.patch .Ve .PP or if you have modified several files do .PP .Vb 1 -\& diff --recursive --unified --ignore-space-change old-dir/ new-dir/ >long.patch +\& diff \-\-recursive \-\-unified \-\-ignore\-space\-change old\-dir/ new\-dir/ >long.patch .Ve .Sh "Documentation" .IX Subsection "Documentation" diff -Nru mrtg-2.14.7/doc/mrtg-contrib.pod mrtg-2.16.1/doc/mrtg-contrib.pod --- mrtg-2.14.7/doc/mrtg-contrib.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-contrib.pod 2008-02-17 10:27:36.000000000 +0000 @@ -14,7 +14,7 @@ MRTG messages have been translated to a number of languages but there are still many which have not been covered yet. If you want to add yours, go -into the F directory and follow the instructions +into the F directory and follow the instructions given in the F file. =head2 Patches diff -Nru mrtg-2.14.7/doc/mrtg-contrib.txt mrtg-2.16.1/doc/mrtg-contrib.txt --- mrtg-2.14.7/doc/mrtg-contrib.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-contrib.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-CONTRIB(1) mrtg MRTG-CONTRIB(1) +MRTG-CONTRIB(1) mrtg MRTG-CONTRIB(1) @@ -6,31 +6,29 @@ mrtg-contrib - Contribution Guidelines for MRTG DDEESSCCRRIIPPTTIIOONN - If you have written an extension to mrtg or created a bug - fix, please consider contributing it to the project. As I - get quite a number of contributions every week, here are a - few guidelines which explain how to contribute so that I - can use the contribution without too much additional work. + If you have written an extension to mrtg or created a bug fix, please + consider contributing it to the project. As I get quite a number of + contributions every week, here are a few guidelines which explain how + to contribute so that I can use the contribution without too much addi- + tional work. TTrraannssllaattiioonnss - MRTG messages have been translated to a number of lan- - guages but there are still many which have not been cov- - ered yet. If you want to add yours, go into the - _m_r_t_g_-_2_._1_4_._7_/_t_r_a_n_s_l_a_t_e directory and follow the instruc- - tions given in the _R_E_A_D_M_E file. + MRTG messages have been translated to a number of languages but there + are still many which have not been covered yet. If you want to add + yours, go into the _m_r_t_g_-_2_._1_6_._1_/_t_r_a_n_s_l_a_t_e directory and follow the + instructions given in the _R_E_A_D_M_E file. PPaattcchheess - When you have created your modification or extension to - mrtg and want to submit it to me, please crate a patch for - the files which you have modified. Do not send entire - files unless they are new. - - To create a patch, get hold of a copy of GNU diff (Many - Unix systems will have this installed already. In the NT - world you might want to get http://sources.redhat.com/cyg- - win/ to get all the nice GNU tools available.) and type + When you have created your modification or extension to mrtg and want + to submit it to me, please crate a patch for the files which you have + modified. Do not send entire files unless they are new. + + To create a patch, get hold of a copy of GNU diff (Many Unix systems + will have this installed already. In the NT world you might want to get + http://sources.redhat.com/cygwin/ to get all the nice GNU tools avail- + able.) and type diff --unified --ignore-space-change old-file new-file > simple.patch @@ -40,28 +38,27 @@ DDooccuummeennttaattiioonn - All documentation of mrtg is done with the perl PPOODD sys- - tem. If you want to learn about it, type + All documentation of mrtg is done with the perl PPOODD system. If you want + to learn about it, type perldoc perlpod - and read the instructions. If you have bugfixes or addi- - tions to the existing documents, make sure you modify the - PPOODD files and not the html or txt versions. - - I take documentation very seriously. Whenever you create a - new feature for mrtg which you want to get included in the - official release, your patch must also contain modifica- - tions for the relevant ppoodd file in the _d_o_c tree or for the - documentation sections of _c_f_g_m_a_k_e_r and _i_n_d_e_x_m_a_k_e_r. + and read the instructions. If you have bugfixes or additions to the + existing documents, make sure you modify the PPOODD files and not the html + or txt versions. + + I take documentation very seriously. Whenever you create a new feature + for mrtg which you want to get included in the official release, your + patch must also contain modifications for the relevant ppoodd file in the + _d_o_c tree or for the documentation sections of _c_f_g_m_a_k_e_r and _i_n_d_e_x_m_a_k_e_r. AADDDDRREESSSS - Send your patches, translations and contributions to - Tobias Oetiker + Send your patches, translations and contributions to Tobias Oetiker + AAUUTTHHOORR Tobias Oetiker -2.14.7 2006-09-06 MRTG-CONTRIB(1) +2.16.1 2008-02-17 MRTG-CONTRIB(1) diff -Nru mrtg-2.14.7/doc/mrtg-faq.1 mrtg-2.16.1/doc/mrtg-faq.1 --- mrtg-2.14.7/doc/mrtg-faq.1 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-faq.1 2008-02-17 10:27:36.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-FAQ 1" -.TH MRTG-FAQ 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-FAQ 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-faq \- How to get help if you have problems with MRTG .SH "SYNOPSIS" @@ -143,13 +143,13 @@ .el .Sh "Why is there no ``@#$%'' (my native language) version of \s-1MRTG\s0?" .IX Subsection "Why is there no @#$% (my native language) version of MRTG?" Nobody has contributed a \fI@#$%.pmd\fR file yet. Go into the -\&\fImrtg\-2.14.7/translate\fR directory and create your own translation file. +\&\fImrtg\-2.16.1/translate\fR directory and create your own translation file. When you are happy with it send it to me for inclusion with the next mrtg release. .Sh "I need a script to make mrtg work with my xyz device." .IX Subsection "I need a script to make mrtg work with my xyz device." Probably this has already been done. Check the stuff in the -\&\fImrtg\-2.14.7/contrib\fR directory. There is a file called \fI00INDEX\fR in +\&\fImrtg\-2.16.1/contrib\fR directory. There is a file called \fI00INDEX\fR in that directory which tells what you can find in there. .Sh "How does this \s-1SNMP\s0 thing work" .IX Subsection "How does this SNMP thing work" @@ -157,7 +157,7 @@ Take a look at this article from the Linux Journal by David Guerrero .PP .Vb 1 -\& http://www.david-guerrero.com/papers/snmp/ +\& http://www.david\-guerrero.com/papers/snmp/ .Ve .PP And at this rather long document from \s-1CISCO\s0. diff -Nru mrtg-2.14.7/doc/mrtg-faq.pod mrtg-2.16.1/doc/mrtg-faq.pod --- mrtg-2.14.7/doc/mrtg-faq.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-faq.pod 2008-02-17 10:27:36.000000000 +0000 @@ -14,7 +14,7 @@ =head2 Why is there no "@#$%" (my native language) version of MRTG? Nobody has contributed a F<@#$%.pmd> file yet. Go into the -F directory and create your own translation file. +F directory and create your own translation file. When you are happy with it send it to me for inclusion with the next mrtg release. @@ -22,7 +22,7 @@ =head2 I need a script to make mrtg work with my xyz device. Probably this has already been done. Check the stuff in the -F directory. There is a file called F<00INDEX> in +F directory. There is a file called F<00INDEX> in that directory which tells what you can find in there. =head2 How does this SNMP thing work diff -Nru mrtg-2.14.7/doc/mrtg-faq.txt mrtg-2.16.1/doc/mrtg-faq.txt --- mrtg-2.14.7/doc/mrtg-faq.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-faq.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-FAQ(1) mrtg MRTG-FAQ(1) +MRTG-FAQ(1) mrtg MRTG-FAQ(1) @@ -6,34 +6,30 @@ mrtg-faq - How to get help if you have problems with MRTG SSYYNNOOPPSSIISS - MRTG seems to raise a lot of questions. There are a number - of resources apart from the documentation where you can - find help for mrtg. + MRTG seems to raise a lot of questions. There are a number of resources + apart from the documentation where you can find help for mrtg. FFAAQQ - In the following sections you'll find some additonal Fre- - quently Asked Questions, with Answers. + In the following sections you'll find some additonal Frequently Asked + Questions, with Answers. - WWhhyy iiss tthheerree nnoo ""@@##$$%%"" ((mmyy nnaattiivvee llaanngguuaaggee)) vveerrssiioonn ooff - MMRRTTGG?? + WWhhyy iiss tthheerree nnoo ""@@##$$%%"" ((mmyy nnaattiivvee llaanngguuaaggee)) vveerrssiioonn ooff MMRRTTGG?? Nobody has contributed a _@_#_$_%_._p_m_d file yet. Go into the - _m_r_t_g_-_2_._1_4_._7_/_t_r_a_n_s_l_a_t_e directory and create your own trans- - lation file. When you are happy with it send it to me for - inclusion with the next mrtg release. + _m_r_t_g_-_2_._1_6_._1_/_t_r_a_n_s_l_a_t_e directory and create your own translation file. + When you are happy with it send it to me for inclusion with the next + mrtg release. II nneeeedd aa ssccrriipptt ttoo mmaakkee mmrrttgg wwoorrkk wwiitthh mmyy xxyyzz ddeevviiccee.. - Probably this has already been done. Check the stuff in - the _m_r_t_g_-_2_._1_4_._7_/_c_o_n_t_r_i_b directory. There is a file called - _0_0_I_N_D_E_X in that directory which tells what you can find in - there. + Probably this has already been done. Check the stuff in the + _m_r_t_g_-_2_._1_6_._1_/_c_o_n_t_r_i_b directory. There is a file called _0_0_I_N_D_E_X in that + directory which tells what you can find in there. HHooww ddooeess tthhiiss SSNNMMPP tthhiinngg wwoorrkk - There are many resources on the net that explain SNMP. - Take a look at this article from the Linux Journal by - David Guerrero + There are many resources on the net that explain SNMP. Take a look at + this article from the Linux Journal by David Guerrero http://www.david-guerrero.com/papers/snmp/ @@ -43,72 +39,63 @@ TThhee iimmaaggeess ccrreeaatteedd bbyy MMRRTTGG llooookk vveerryy ssttrraannggee.. - Remove the *-{week,day,month,year}.png files and start - MRTG again. Using MRTG for the first time, you might have - to do this twice. This will also help when you introduce - new routers into the cfg file. + Remove the *-{week,day,month,year}.png files and start MRTG again. + Using MRTG for the first time, you might have to do this twice. This + will also help when you introduce new routers into the cfg file. WWhhaatt iiss mmyy CCoommmmuunniittyy NNaammee?? - Ask the person in charge of your Router or try 'public', - as this is the default Community Name. + Ask the person in charge of your Router or try 'public', as this is the + default Community Name. MMyy ggrraapphhss sshhooww aa ffllaatt lliinnee dduurriinngg aann oouuttaaggee.. WWhhyy ?? - Well, the short answer is that when an SNMP query goes out - and a response doesn't come back, MRTG has to assume some- - thing to put in the graph, and by default it assumes that - the last answer we got back is probably closer to the - truth than zero. This assumption is not perfect (as you - have noticed). It's a trade-off that happens to fail dur- - ing a total outage. - - If this is an unacceptable trade-off, use the uunnkknnaasszzeerroo - option. - - You may want to know what you're trading off, so in the - spirit of trade-offs, here's the long answer: - - The problem is that MRTG doesn't know *why* the data - didn't come back, all it knows is that it didn't come - back. It has to do something, and it assumes it's a stray - lost packet rather than an outage. - - Why don't we always assume the circuit is down and use - zero, which will (we think) be more nearly right? Well, - it turns out that you may be taking advantage of MRTG's - "assume last" behaviour without being aware of it. - - MRTG uses SNMP (Simple Network Management Protocol) to - collect data, and SNMP uses UDP (User Datagram Protocol) - to ship packets around. UDP is connectionless (not guar- - anteed) unlike TCP where packets are tracked and acknowl- - edged and, if needed, retransmitted. UDP just throws - packets at the network and hopes they arrive. Sometimes - they don't. - - One likely cause of lost SNMP data is congestion; another - is busy routers. Other possibilities include transient - telecommunications problems, router buffer overflows - (which may or may not be congestion-related), "dirty - lines" (links with high error rates), and acts of God. - These things happen all the time; we just don't notice - because many interactive services are TCP-based and the - lost packets get retransmitted automatically. - - In the above cases where some SNMP packets are lost but - traffic is flowing, assuming zero is the wrong thing to do - - you end up with a graph that looks like it's missing - teeth whenever the link fills up. MRTG interpolates the - lost data to produce a smoother graph which is more accu- - rate in cases of intermittent packet loss. But with - V2.8.4 and above, you can use the "unknaszero" option to - produce whichever graph is best under the conditions typi- - cal for your network. + Well, the short answer is that when an SNMP query goes out and a + response doesn't come back, MRTG has to assume something to put in the + graph, and by default it assumes that the last answer we got back is + probably closer to the truth than zero. This assumption is not perfect + (as you have noticed). It's a trade-off that happens to fail during a + total outage. + + If this is an unacceptable trade-off, use the uunnkknnaasszzeerroo option. + + You may want to know what you're trading off, so in the spirit of + trade-offs, here's the long answer: + + The problem is that MRTG doesn't know *why* the data didn't come back, + all it knows is that it didn't come back. It has to do something, and + it assumes it's a stray lost packet rather than an outage. + + Why don't we always assume the circuit is down and use zero, which will + (we think) be more nearly right? Well, it turns out that you may be + taking advantage of MRTG's "assume last" behaviour without being aware + of it. + + MRTG uses SNMP (Simple Network Management Protocol) to collect data, + and SNMP uses UDP (User Datagram Protocol) to ship packets around. UDP + is connectionless (not guaranteed) unlike TCP where packets are tracked + and acknowledged and, if needed, retransmitted. UDP just throws pack- + ets at the network and hopes they arrive. Sometimes they don't. + + One likely cause of lost SNMP data is congestion; another is busy + routers. Other possibilities include transient telecommunications + problems, router buffer overflows (which may or may not be conges- + tion-related), "dirty lines" (links with high error rates), and acts of + God. These things happen all the time; we just don't notice because + many interactive services are TCP-based and the lost packets get + retransmitted automatically. + + In the above cases where some SNMP packets are lost but traffic is + flowing, assuming zero is the wrong thing to do - you end up with a + graph that looks like it's missing teeth whenever the link fills up. + MRTG interpolates the lost data to produce a smoother graph which is + more accurate in cases of intermittent packet loss. But with V2.8.4 + and above, you can use the "unknaszero" option to produce whichever + graph is best under the conditions typical for your network. AAUUTTHHOORR Tobias Oetiker -2.14.7 2006-09-06 MRTG-FAQ(1) +2.16.1 2008-02-17 MRTG-FAQ(1) diff -Nru mrtg-2.14.7/doc/mrtg-forum.1 mrtg-2.16.1/doc/mrtg-forum.1 --- mrtg-2.14.7/doc/mrtg-forum.1 2006-09-06 14:42:52.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-forum.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-FORUM 1" -.TH MRTG-FORUM 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-FORUM 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-forum \- Interactive Help for MRTG users .SH "SYNOPSIS" @@ -189,7 +189,7 @@ subject: \fBsubscribe\fR to the following address: .PP .Vb 1 -\& listname-request@list.ee.ethz.ch +\& listname\-request@lists.oetiker.ch .Ve .PP You will then get a message asking you to confirm your subscription. @@ -197,7 +197,7 @@ For posting to the lists use the following address .PP .Vb 1 -\& listname@list.ee.ethz.ch +\& listname@lists.oetiker.ch .Ve .PP Note that only people who are subscribed to the list can post. @@ -206,16 +206,22 @@ available by sending a message with the subject line \fBhelp\fR to either one of the request addresses. .PP -For past activity there is also a mailing list archive available: +There is also a webinterface to the lists on .PP .Vb 1 -\& http://lists.ee.ethz.ch/mrtg +\& http://lists.oetiker.ch .Ve .PP -There is also a web interface to manage your mailing-list subscription. +List archives are on .PP .Vb 1 -\& http://lists.ee.ethz.ch/lsg2.cgi +\& http://www.mail\-archive.com/index.php?hunt=mrtg +.Ve +.PP +and +.PP +.Vb 1 +\& http://gmane.org/find.php?list=mrtg .Ve .SH "NEWSGROUP" .IX Header "NEWSGROUP" @@ -223,14 +229,14 @@ posts to: .PP .Vb 1 -\& news:comp.dcom.net-management +\& news:comp.dcom.net\-management .Ve .PP Many \s-1MRTG\s0 users are in this forum and will help you. You can also find an archive of past activity from this Newsgroup on: .PP .Vb 1 -\& http://groups.google.com/group/comp.dcom.net-management +\& http://groups.google.com/group/comp.dcom.net\-management .Ve .SH "IRC Channel" .IX Header "IRC Channel" @@ -240,7 +246,7 @@ More information can be found at .PP .Vb 1 -\& http://mrtg.easymac.org. +\& http://mrtg.easymac.org .Ve .SH "MRTG Japan" .IX Header "MRTG Japan" @@ -248,8 +254,8 @@ translations of the traffic from MRTG-ANNOUNCE as well as updates on the Japanese Translation of the \s-1MRTG\s0 documentation. Go to http://www.mrtg.jp/ for further Information. -.SH "MRTG Türkiye" -.IX Header "MRTG Türkiye" +.SH "MRTG Turkiye" +.IX Header "MRTG Turkiye" There is a special Mailinglist for \s-1MRTG\s0 Users in Turkey. Go to http://groups.yahoo.com/group/mrtg\-turkiye/ for more information. .SH "AUTHOR" diff -Nru mrtg-2.14.7/doc/mrtg-forum.pod mrtg-2.16.1/doc/mrtg-forum.pod --- mrtg-2.14.7/doc/mrtg-forum.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-forum.pod 2008-02-17 10:27:36.000000000 +0000 @@ -78,13 +78,13 @@ It allows you to subscribe to these lists by sending a message with the subject: B to the following address: - listname-request@list.ee.ethz.ch + listname-request@lists.oetiker.ch You will then get a message asking you to confirm your subscription. For posting to the lists use the following address - listname@list.ee.ethz.ch + listname@lists.oetiker.ch Note that only people who are subscribed to the list can post. @@ -92,13 +92,17 @@ available by sending a message with the subject line B to either one of the request addresses. -For past activity there is also a mailing list archive available: +There is also a webinterface to the lists on - http://lists.ee.ethz.ch/mrtg + http://lists.oetiker.ch -There is also a web interface to manage your mailing-list subscription. +List archives are on + + http://www.mail-archive.com/index.php?hunt=mrtg - http://lists.ee.ethz.ch/lsg2.cgi +and + + http://gmane.org/find.php?list=mrtg =head1 NEWSGROUP @@ -119,7 +123,7 @@ More information can be found at - http://mrtg.easymac.org. + http://mrtg.easymac.org =head1 MRTG Japan @@ -128,7 +132,7 @@ Japanese Translation of the MRTG documentation. Go to http://www.mrtg.jp/ for further Information. -=head1 MRTG Türkiye +=head1 MRTG Turkiye There is a special Mailinglist for MRTG Users in Turkey. Go to http://groups.yahoo.com/group/mrtg-turkiye/ for more information. diff -Nru mrtg-2.14.7/doc/mrtg-forum.txt mrtg-2.16.1/doc/mrtg-forum.txt --- mrtg-2.14.7/doc/mrtg-forum.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-forum.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-FORUM(1) mrtg MRTG-FORUM(1) +MRTG-FORUM(1) mrtg MRTG-FORUM(1) @@ -6,11 +6,10 @@ mrtg-forum - Interactive Help for MRTG users SSYYNNOOPPSSIISS - There is a lot of written documentation for mrtg, but nev- - ertheless you may have a problem where you can't find the - solution. In this case some Human Help may be necessary. - With MRTG there are several ways to get Humans to help - you. + There is a lot of written documentation for mrtg, but nevertheless you + may have a problem where you can't find the solution. In this case + some Human Help may be necessary. With MRTG there are several ways to + get Humans to help you. MMAAIILLIINNGG--LLIISSTT There are three mailing lists for MRTG available. @@ -19,111 +18,104 @@ for discussion among mrtg users. mrtg-announce - for announcements regarding new versions of mrtg - related software. + for announcements regarding new versions of mrtg related software. mrtg-developers - for discussion among people who write software in con- - nection with mrtg or who hack mrtg itself. + for discussion among people who write software in connection with + mrtg or who hack mrtg itself. TTHHEE RRUULLEESS - Please note that the memebers of the mrtg mailinglist - value politeness highly. This means behave in a way you - would like others to behave towards you. + Please note that the memebers of the mrtg mailinglist value politeness + highly. This means behave in a way you would like others to behave + towards you. +o No shouting. (NO CAPS) +o No rude language - +o No demands. everybody is on the list out of their own - free will. If you do not get an answer to your ques- - tion, chances are high that you did not give sufficent - details about the nature of your problem or that the - answer to your problem is in the documentation. + +o No demands. everybody is on the list out of their own free will. If + you do not get an answer to your question, chances are high that + you did not give sufficent details about the nature of your problem + or that the answer to your problem is in the documentation. - +o If you do not follow the rules you will be unsub- - scribed from the list with no further questions asked. + +o If you do not follow the rules you will be unsubscribed from the + list with no further questions asked. - +o Decisions about your unsubscription from the list will - be taken by + +o Decisions about your unsubscription from the list will be taken by Alex van den Bogaerdt Paul C. Williamson - If you feel that you have been treated unfairly, you - may send mail to me and explain the situation. + If you feel that you have been treated unfairly, you may send mail + to me and explain the situation. Tobi Oetiker SSUUBBSSCCRRIIBBIINNGG - These lists are managed by a mailing-list management pro- - gram (listar). It allows you to subscribe to these lists - by sending a message with the subject: ssuubbssccrriibbee to the - following address: + These lists are managed by a mailing-list management program (listar). + It allows you to subscribe to these lists by sending a message with the + subject: ssuubbssccrriibbee to the following address: - listname-request@list.ee.ethz.ch + listname-request@lists.oetiker.ch - You will then get a message asking you to confirm your - subscription. + You will then get a message asking you to confirm your subscription. For posting to the lists use the following address - listname@list.ee.ethz.ch + listname@lists.oetiker.ch - Note that only people who are subscribed to the list can - post. + Note that only people who are subscribed to the list can post. - Further information about the usage of the mailing lists - is available by sending a message with the subject line - hheellpp to either one of the request addresses. + Further information about the usage of the mailing lists is available + by sending a message with the subject line hheellpp to either one of the + request addresses. - For past activity there is also a mailing list archive - available: + There is also a webinterface to the lists on - http://lists.ee.ethz.ch/mrtg + http://lists.oetiker.ch - There is also a web interface to manage your mailing-list - subscription. + List archives are on - http://lists.ee.ethz.ch/lsg2.cgi + http://www.mail-archive.com/index.php?hunt=mrtg + + and + + http://gmane.org/find.php?list=mrtg NNEEWWSSGGRROOUUPP - For discussion of MRTG or related topics on the Usenet, - please send your posts to: + For discussion of MRTG or related topics on the Usenet, please send + your posts to: news:comp.dcom.net-management - Many MRTG users are in this forum and will help you. You - can also find an archive of past activity from this News- - group on: + Many MRTG users are in this forum and will help you. You can also find + an archive of past activity from this Newsgroup on: http://groups.google.com/group/comp.dcom.net-management IIRRCC CChhaannnneell - For discussion of MRTG and related topics on IRC, the - `#mrtg' channel on EFNet has been created. + For discussion of MRTG and related topics on IRC, the `#mrtg' channel + on EFNet has been created. More information can be found at - http://mrtg.easymac.org. + http://mrtg.easymac.org MMRRTTGG JJaappaann - There is a special Mailinglist for MRTG Users in Japan. It - carries translations of the traffic from MRTG-ANNOUNCE as - well as updates on the Japanese Translation of the MRTG - documentation. Go to http://www.mrtg.jp/ for further - Information. - -MMRRTTGG TTrrkkiiyyee - There is a special Mailinglist for MRTG Users in Turkey. - Go to http://groups.yahoo.com/group/mrtg-turkiye/ for more - information. + There is a special Mailinglist for MRTG Users in Japan. It carries + translations of the traffic from MRTG-ANNOUNCE as well as updates on + the Japanese Translation of the MRTG documentation. Go to + http://www.mrtg.jp/ for further Information. + +MMRRTTGG TTuurrkkiiyyee + There is a special Mailinglist for MRTG Users in Turkey. Go to + http://groups.yahoo.com/group/mrtg-turkiye/ for more information. AAUUTTHHOORR Tobias Oetiker and many contributors -2.14.7 2006-09-06 MRTG-FORUM(1) +2.16.1 2008-02-17 MRTG-FORUM(1) diff -Nru mrtg-2.14.7/doc/mrtg-ipv6.1 mrtg-2.16.1/doc/mrtg-ipv6.1 --- mrtg-2.14.7/doc/mrtg-ipv6.1 2006-09-06 14:42:55.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-ipv6.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-IPV6 1" -.TH MRTG-IPV6 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-IPV6 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-ipv6 \- IPv6 support in MRTG .SH "OVERVIEW" diff -Nru mrtg-2.14.7/doc/mrtg-ipv6.txt mrtg-2.16.1/doc/mrtg-ipv6.txt --- mrtg-2.14.7/doc/mrtg-ipv6.txt 2006-09-06 14:42:58.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-ipv6.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-IPV6(1) mrtg MRTG-IPV6(1) +MRTG-IPV6(1) mrtg MRTG-IPV6(1) @@ -6,91 +6,82 @@ mrtg-ipv6 - IPv6 support in MRTG OOVVEERRVVIIEEWW - MRTG and cfgmaker support SNMP over IPv6. IPv6 targets can - be specified by hostname or IPv6 address, and if the - required libraries are present (see below), queries will - use IPv6. + MRTG and cfgmaker support SNMP over IPv6. IPv6 targets can be specified + by hostname or IPv6 address, and if the required libraries are present + (see below), queries will use IPv6. UUSSAAGGEE EEnnaabblliinngg IIPPvv66 - IPv6 is currently disabled by default and must be explic- - itly enabled. In MRTG this is done by turning on the - EEnnaabblleeIIPPvv66 global option in the configuration file. In - cfgmaker, it is enabled with the ----eennaabbllee--iippvv66 command- - line option. - - If IPv6 is disabled, MRTG and cfgmaker should behave in - exactly the same way as previous versions. So the addition - of IPv6 support should have no effect on existing MRTG - setups unless IPv6 is enabled. + IPv6 is currently disabled by default and must be explicitly enabled. + In MRTG this is done by turning on the EEnnaabblleeIIPPvv66 global option in the + configuration file. In cfgmaker, it is enabled with the ----eennaabbllee--iippvv66 + command-line option. + + If IPv6 is disabled, MRTG and cfgmaker should behave in exactly the + same way as previous versions. So the addition of IPv6 support should + have no effect on existing MRTG setups unless IPv6 is enabled. - IPv6 support requires the Socket6 and INET6 libraries (see - below). If MRTG can't find them, IPv6 is disabled. + IPv6 support requires the Socket6 and INET6 libraries (see below). If + MRTG can't find them, IPv6 is disabled. SSppeecciiffyyiinngg IIPPvv66 ttaarrggeettss - IPv6 targets may be specified by name or IPv6 address. - Numeric IPv6 addresses may be used with both cfgmaker and - MRTG, but they must be enclosed in square brackets. + IPv6 targets may be specified by name or IPv6 address. Numeric IPv6 + addresses may be used with both cfgmaker and MRTG, but they must be + enclosed in square brackets. For example, a target could be specified as: public@[2001:760:4::]:161 - Hostnames work as expected: first an IPv6 name lookup is - tried, then an IPv4 lookup. + Hostnames work as expected: first an IPv6 name lookup is tried, then an + IPv4 lookup. TTaarrggeettss tthhaatt ddoo nnoott ssuuppppoorrtt SSNNMMPP oovveerr IIPPvv66 - Many targets (this currently includes all Cisco routers) - do not yet support SNMP over IPv6 and must be monitored - over IPv4. This can cause problems if you specify a target - through its DNS name and the name maps to both the IPv6 - address and the IPv4 address of the target: MRTG will only - try IPv6, and will fail. - - To query these targets, use the IIPPvv44OOnnllyy per-target - option, which tells MRTG not to use SNMP over IPv6 for the - target. - - MRTG does not fall back to IPv4 for performance and cor- - rectness reasons. If there are many routers to query, a - timeout for every router would make MRTG take too long to - query them all. And if, for some reason, IPv6 connectivity - to the target is lost, MRTG's error messages can help fig- - ure out what is wrong. - - cfgmaker does fall back from IPv6 to IPv4. If IPv6 is - enabled and cfgmaker is given a hostname that resolves to - both an IPv6 and an IPv4 address, it first tries to query - the target over IPv6. If it receives no answer, it tries - again using IPv4. If the target answers, cfgmaker sets the - IPv4Only option in the generated config file. + Many targets (this currently includes all Cisco routers) do not yet + support SNMP over IPv6 and must be monitored over IPv4. This can cause + problems if you specify a target through its DNS name and the name maps + to both the IPv6 address and the IPv4 address of the target: MRTG will + only try IPv6, and will fail. + + To query these targets, use the IIPPvv44OOnnllyy per-target option, which tells + MRTG not to use SNMP over IPv6 for the target. + + MRTG does not fall back to IPv4 for performance and correctness rea- + sons. If there are many routers to query, a timeout for every router + would make MRTG take too long to query them all. And if, for some rea- + son, IPv6 connectivity to the target is lost, MRTG's error messages can + help figure out what is wrong. + + cfgmaker does fall back from IPv6 to IPv4. If IPv6 is enabled and cfg- + maker is given a hostname that resolves to both an IPv6 and an IPv4 + address, it first tries to query the target over IPv6. If it receives + no answer, it tries again using IPv4. If the target answers, cfgmaker + sets the IPv4Only option in the generated config file. IIPPvv66 LLIIBBRRAARRIIEESS LLiibbrraarriieess rreeqquuiirreedd - IPv6 support requires the SSoocckkeett66 and IINNEETT66 Perl modules. - Both can be downloaded from CPAN: + IPv6 support requires the SSoocckkeett66 and IINNEETT66 Perl modules. Both can be + downloaded from CPAN: http://search.cpan.org/author/UMEMOTO/Socket6/ http://search.cpan.org/author/MONDEJAR/INET6/ - If you use Debian, you will need the packages lliibb-- - ssoocckkeett66--ppeerrll and lliibbiioo--ssoocckkeett--iinneett66--ppeerrll, which are (or - should soon be) in unstable. - - So far, IPv6 support has been tested on Linux only, and - only with Socket6 version 0.12. Also note that IPv6 won't - work at all if you don't have INET6.pm version 2.00 or - newer. + If you use Debian, you will need the packages lliibbssoocckkeett66--ppeerrll and + lliibbiioo--ssoocckkeett--iinneett66--ppeerrll, which are (or should soon be) in unstable. + + So far, IPv6 support has been tested on Linux only, and only with + Socket6 version 0.12. Also note that IPv6 won't work at all if you + don't have INET6.pm version 2.00 or newer. IInnssttaalllliinngg tthhee lliibbrraarriieess - Building and installing Socket6 and INET6 is very simple. - For each module, just unpack the archive and then do: + Building and installing Socket6 and INET6 is very simple. For each mod- + ule, just unpack the archive and then do: perl Makefile.PL make @@ -100,13 +91,12 @@ su make install - If you have installed the libraries successfully, cfgmaker - and mrtg should automatically detect them and allow IPv6 - support to be enabled. + If you have installed the libraries successfully, cfgmaker and mrtg + should automatically detect them and allow IPv6 support to be enabled. AAUUTTHHOORR Lorenzo Colitti -2.14.7 2006-09-06 MRTG-IPV6(1) +2.16.1 2008-02-17 MRTG-IPV6(1) diff -Nru mrtg-2.14.7/doc/mrtglib.1 mrtg-2.16.1/doc/mrtglib.1 --- mrtg-2.14.7/doc/mrtglib.1 2006-09-06 14:42:55.000000000 +0100 +++ mrtg-2.16.1/doc/mrtglib.1 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTGLIB 1" -.TH MRTGLIB 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTGLIB 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" MRTG_lib.pm \- Library for MRTG and support scripts .SH "SYNOPSIS" @@ -217,8 +217,8 @@ .Vb 4 \& $extrules{option} = [sub{$_[0] =~ m/^\ed+$/}, sub{"Error message for $_[0]"}] \& i.e. -\& $extrules{option}[0] -> a test expression -\& $extrules{option}[1] -> error message if test fails +\& $extrules{option}[0] \-> a test expression +\& $extrules{option}[1] \-> error message if test fails .Ve .Sp The first part of the array is a perl expression to test the value of the diff -Nru mrtg-2.14.7/doc/mrtglib.pod mrtg-2.16.1/doc/mrtglib.pod --- mrtg-2.14.7/doc/mrtglib.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtglib.pod 2008-02-17 10:27:36.000000000 +0000 @@ -1,7 +1,7 @@ # -*- mode: Perl -*- package MRTG_lib; ################################################################### -# MRTG 2.14.7 Support library MRTG_lib.pm +# MRTG 2.16.1 Support library MRTG_lib.pm ################################################################### # Created by Tobias Oetiker # and Dave Rand @@ -99,7 +99,9 @@ [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], 'interval' => - [sub{int($_[0]) >= 1 and int($_[0]) <= 60}, sub{"$_[0] should be at least 1 Minute and no more than 60 Minutes"}], + [sub{$_[0] =~ /(\d+)(?::(\d+))?/ ; + my $int = $1*60; $int += $2 if $2; + $int >= 1 and $int <= 60*60}, sub{"$_[0] should be at least 1 Second (0:01) and no more than 60 Minutes (60)"}], 'writeexpires' => [sub{1}, sub{"Internal Error"}], @@ -168,6 +170,9 @@ 'routername[]' => [sub{1}, sub{"Internal Error"}], #will test this later + 'nohc[]' => + [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], + 'maxbytes[]' => [sub{(($_[0] =~ /^[0-9]+$/) && ($_[0] > 0)) }, sub{"$_[0] must be a Number bigger than 0"}], @@ -210,6 +215,10 @@ 'rrdrowcount[]' => [sub{1}, sub{"Internal Error"}], #what ever the user chooses. + 'rrdhwrras[]' => + [sub{$_[0] =~ /^RRA:(HWPREDICT|SEASONAL|DEVPREDICT|DEVSEASONAL|FAILURES):\S+(\s+RRA:(HWPREDICT|SEASONAL|DEVPREDICT|DEVSEASONAL|FAILURES):\S+)*$/}, + sub{"This does not look like rrdtool HW RRAs. Check the rrdcreate manual page for inspiration. ($_[0])"}], + 'extension[]' => [sub{1}, sub{"Internal Error"}], #what ever the user chooses. @@ -296,6 +305,7 @@ [sub{$_[0] =~ /^(?:[-\w]+=\"[^"]*"(?:\s+|$))+$/}, sub{"$_[0] must be XY=\"dddd\" AASD=\"kjlkj\" ... "}], + 'xzoom[]' => [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, sub{"$_[0] must be a Number xxx.xxx"}], @@ -314,6 +324,20 @@ 'threshdir' => [sub{$_[0] && (-d $_[0])}, sub{"Threshold directory $_[0] does not exist"}], + + 'threshhyst' => + [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, + sub{"$_[0] must be a Number xxx.xxx"}], + + 'hwthreshhyst' => + [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, + sub{"$_[0] must be a Number xxx.xxx"}], + + 'threshmailserver' => + [sub{$_[0] && gethostbyname($_[0])}, sub{"Unknown mailserver hostname $_[0]"}], + + 'threshmailsender' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], 'threshmini[]' => [sub{1}, sub{"Internal Threshold Config Error"}], @@ -342,6 +366,39 @@ 'threshprogoko[]' => [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + 'threshmailaddress[]' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], + + 'hwthreshmini[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmino[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmaxi[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmaxo[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshdesc[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshprogi[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogo[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogoki[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogoko[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshmailaddress[]' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], + 'timestrpos[]' => [sub{$_[0] =~ /^(no|[lr][ul])$/i}, sub{"Must be a string of NO, LU, RU, LL, RL"}], @@ -657,6 +714,16 @@ mkdirhier $$cfg{imagedir} unless $opts->{check}; } } + if ($cfg->{threshmailserver} and not $cfg->{threshmailsender}){ + warn ("WARNING: If \"ThreshMailServer\" is defined, then \"ThreshMailSender\" must be defined too.\n"); + $error = "yes"; + } + if ($cfg->{threshmailsender} and not $cfg->{threshmailserver}){ + warn ("WARNING: If \"ThreshMailSender\" is defined, then \"ThreshMailServer\" must be defined too.\n"); + $error = "yes"; + } + + $cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst}; # build relativ path from htmldir to image dir. my @htmldir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{htmldir}; my @imagedir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{imagedir}; @@ -735,10 +802,15 @@ } # default interval is 5 minutes - $$cfg{interval} = 5 unless defined $$cfg{interval}; + if ($cfg->{interval} and $cfg->{interval} =~ /(\d+)(?::(\d+))?/){ + $cfg->{interval} = $1; + $cfg->{interval} += $2/60.0 if $2; + } else { + $cfg->{interval} = 5; + } unless ($$cfg{logformat} eq 'rrdtool') { # interval has to be 5 minutes at least without userrdtool - if ($$cfg{interval} < 5) { + if ($$cfg{interval} < 5.0) { die "ERROR: CFG Error in \"Interval\": should be at least 5 Minutes (unless you use rrdtool)"; } } @@ -755,10 +827,18 @@ die "ERROR: File $cfg->{ conversioncode } conversion code evaluation failed\n$@\n" unless eval $code; } + my $thresh_error; foreach $rou (@$routers) { # and now for the testing - + if (defined $rcfg->{threshmailaddress}{$rou}){ + if (not defined $cfg->{threshmailserver} and not $thresh_error){ + warn (qq{ERROR: ThreshMailAddress[$rou]: specified without "ThreshMailServer:"}); + $error = "yes"; + $thresh_error = "yes"; + } + # the dependency between sender and server is taken care of already + } if (! defined $rcfg->{snmpoptions}{$rou}) { $rcfg->{snmpoptions}{$rou} = {%{$cfg->{snmpoptions}}} if defined $cfg->{snmpoptions}; @@ -881,8 +961,14 @@ $ipv4only = 0 unless (defined $$rcfg{ipv4only}{$rou}) && (lc($$rcfg{ipv4only}{$rou}) eq 'yes'); } + # Check if nohc has been set, designating a low-speed interface + # without working HC counters. Default is that high-speed + # counters exist. + my $nohc = 0; + $nohc = 1 if (defined $$rcfg{nohc}{$rou}) && (lc($$rcfg{nohc}{$rou}) eq 'yes'); + ( $$rcfg{target}{$rou}, $$rcfg{uniqueTarget}{$rou} ) = - targparser( $$rcfg{target}{$rou}, $target, $targIndex, $ipv4only, $rcfg->{snmpoptions}{$rou} ); + targparser( $$rcfg{target}{$rou}, $target, $targIndex, $ipv4only, $rcfg->{snmpoptions}{$rou}, $nohc ); } else { warn ("WARNING: I can't find a \"target[$rou]\" definition\n"); $error = "yes"; @@ -997,7 +1083,7 @@ sub ensureSL($) { # return; my $ref = shift; - return if $$ref eq ""; + return if not $$ref; debug('dir',"ensure path IN: '$$ref'"); if (${MRTG_lib::SL} eq '\\'){ # two slashes at the start of the string are OK @@ -1030,7 +1116,7 @@ # create expire date for expiery in ARG Minutes sub expistr ($) { - my ($time) = time+$_[0]*60+5; + my ($time) = time+int($_[0]*60)+5; my ($wday) = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat')[(gmtime($time))[6]]; my ($month) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep', 'Oct','Nov','Dec')[(gmtime($time))[4]]; @@ -1114,6 +1200,7 @@ require 'POSIX.pm'; POSIX::setsid() or die "Can't start a new session: $!"; open STDOUT,'>/dev/null' or die "ERROR: Redirecting STDOUT to /dev/null: $!"; + open STDERR,'>/dev/null' or die "ERROR: Redirecting STDERR to /dev/null: $!"; open STDIN, '{OID}) + '((?:\.\d+)*?\.?[-a-zA-Z0-9]*(?:\.\d+)*?)' . # OID possibly starting with a MIB name ($if->{OID}) '(' . # Interface specification alternatives: ($if->{Alt}) '\.' . # separator $ifSimple . # simple alternatives (6 variables) @@ -1395,7 +1484,7 @@ my $d2 = 1 - $d1; # Set the OIDs depending on whether SNMPv2 has been specified # and on the direction - if( $if->{SnmpInfo} =~ m/(?::[^:]*){4}:[32][Cc]?/ ) { + if( $if->{SnmpInfo} =~ m/(?::[^:]*){4}:[32][Cc]?/ and $nohc == 0 ) { $if->{OID}[$d1] = 'ifHCInOctets'; $if->{OID}[$d2] = 'ifHCOutOctets'; } else { @@ -1567,7 +1656,9 @@ my $hostkey = cleanhostkey $host; return if defined $$confcache{$hostkey} and not $reread; my $snmp_errlevel = $SNMP_Session::suppress_warnings; - $SNMP_Session::suppress_warnings = 3; + my $net_snmp_errlevel = $Net_SNMP_util::suppress_warnings; + $SNMP_Session::suppress_warnings = 3; + $Net_SNMP_util::suppress_warnings = 3; debug('coca',"populate confcache $host"); # clear confcache for host; @@ -1584,8 +1675,9 @@ foreach my $node (@nodes) { next if $confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300; $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, $node); - unless ( $SNMP_Session::errmsg){ + unless ( $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ foreach my $ret (@ret) { my ($oid, $desc) = split(':', $ret, 2); @@ -1599,17 +1691,21 @@ }; } else { $confcache->{___deadhosts}{$hostkey} = time - if $SNMP_Session::errmsg =~ /no response received/; + if defined($SNMP_Session::errmsg) and $SNMP_Session::errmsg =~ /no response received/; + $confcache->{___deadhosts}{$hostkey} = time + if defined($Net_SNMP_util::ErrorMessage) and $Net_SNMP_util::ErrorMessage =~ /No response from remote/; debug('coca',"Skipping $node scanning because $host does not seem to support it"); } } if ($confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300){ $SNMP_Session::suppress_warnings = $snmp_errlevel; + $Net_SNMP_util::suppress_warnings = $snmp_errlevel; return; } $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, "ifPhysAddress"); - unless ( $SNMP_Session::errmsg){ + unless ( $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ foreach my $ret (@ret) { my ($oid, $bin) = split(':', $ret, 2); @@ -1631,6 +1727,7 @@ push @{$$confcache{___updated}}, $hostkey; $SNMP_Session::suppress_warnings = $snmp_errlevel; + $Net_SNMP_util::supress_warnings = $net_snmp_errlevel; } sub log2rrd ($$$) { @@ -1736,7 +1833,7 @@ $DST = 'COUNTER' } - my $MHB = $$cfg{interval} * 60 * 2; + my $MHB = int($$cfg{interval} * 60 * 2); my $MAX1 = $$rcfg{'absmax'}{$router} @@ -1864,7 +1961,7 @@ my $tag = shift; my $msg = shift; return unless grep {$_ eq $tag} @main::DEBUG; - warn "--",$tag,": ",$msg,"\n"; + warn "--".$tag.": ".$msg."\n"; return; } diff -Nru mrtg-2.14.7/doc/mrtglib.txt mrtg-2.16.1/doc/mrtglib.txt --- mrtg-2.14.7/doc/mrtglib.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtglib.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTGLIB(1) mrtg MRTGLIB(1) +MRTGLIB(1) mrtg MRTGLIB(1) @@ -13,11 +13,10 @@ cfgcheck(\@target_names, \%globalcfg, \%targetcfg, \@parsed_targets); DDEESSCCRRIIPPTTIIOONN - MRTG_lib is part of MRTG, the Multi Router Traffic Gra- - pher. It was separated from MRTG to allow other programs - to easily use the same config files. The main part of - MRTG_lib is the config file parser but some other funcions - are there too. + MRTG_lib is part of MRTG, the Multi Router Traffic Grapher. It was sep- + arated from MRTG to allow other programs to easily use the same config + files. The main part of MRTG_lib is the config file parser but some + other funcions are there too. $MRTG_lib::OS Type of OS: WIN, UNIX, VMS @@ -29,15 +28,14 @@ Path separator in PATH variable "readcfg" - "readcfg($file, \@targets, \%globalcfg, \%targetcfg [, - $prefix, \%extrules])" + "readcfg($file, \@targets, \%globalcfg, \%targetcfg [, $prefix, + \%extrules])" - Reads a config file, parses it and fills some arrays - and hashes. The mandatory arguments are: the name of - the config file, a ref to an array which will be - filled with a list of the target names, a hashref for - the global configuration, a hashref for the target - configuration. + Reads a config file, parses it and fills some arrays and hashes. + The mandatory arguments are: the name of the config file, a ref to + an array which will be filled with a list of the target names, a + hashref for the global configuration, a hashref for the target con- + figuration. The configuration file syntax is: @@ -60,59 +58,54 @@ $targetcfg{configoption}{targetname} = 'value' - See mrtg-reference for more information about the MRTG - configuration syntax. + See mrtg-reference for more information about the MRTG configura- + tion syntax. - "readcfg" can take two additional arguments to extend - the config file syntax. This allows programs to put - their configuration into the mrtg config file. The - fifth argument is the prefix of the extension, the - sixth argument is a hash with the checkrules for these - extension settings. E.g. if the prefix is "14all" - "readcfg" will check config lines that begin with - "14all*", i.e. all lines like + "readcfg" can take two additional arguments to extend the config + file syntax. This allows programs to put their configuration into + the mrtg config file. The fifth argument is the prefix of the + extension, the sixth argument is a hash with the checkrules for + these extension settings. E.g. if the prefix is "14all" "readcfg" + will check config lines that begin with "14all*", i.e. all lines + like 14all*columns: 2 14all*graphsize[target3]: 500 200 - against the rules in %extrules. The format of this - hash is: + against the rules in %extrules. The format of this hash is: $extrules{option} = [sub{$_[0] =~ m/^\d+$/}, sub{"Error message for $_[0]"}] i.e. $extrules{option}[0] -> a test expression $extrules{option}[1] -> error message if test fails - The first part of the array is a perl expression to - test the value of the option. The test can access this - value in the variable "$arg". The second part of the - array is an error message to display when the test - fails. The failed value can be integrated by using the - variable "$arg". - - Config settings with an different prefix than the one - given in the "readcfg" call are not checked but - inserted into _%_g_l_o_b_a_l_c_f_g and _%_t_a_r_g_e_t_c_f_g. Prefixed - settings keep their prefix in the config hashes: + The first part of the array is a perl expression to test the value + of the option. The test can access this value in the variable + "$arg". The second part of the array is an error message to display + when the test fails. The failed value can be integrated by using + the variable "$arg". + + Config settings with an different prefix than the one given in the + "readcfg" call are not checked but inserted into _%_g_l_o_b_a_l_c_f_g and + _%_t_a_r_g_e_t_c_f_g. Prefixed settings keep their prefix in the config + hashes: $targetcfg{'14all*graphsize'}{'target3'} = '500 200' "cfgcheck" - "cfgcheck(\@target_names, \%globalcfg, \%targetcfg, - \@parsed_targets)" + "cfgcheck(\@target_names, \%globalcfg, \%targetcfg, \@parsed_tar- + gets)" - Checks the configuration read by "readcfg". Checks the - values in the config for syntactical and/or semantical - errors. Sets defaults for some options. Parses the - "target[...]" options and filles the array - @parsed_targets ready for mrtg functions. - - The first three arguments are the same as for "read- - cfg". The fourth argument is an arrayref which will be - filled with the parsed target defs. + Checks the configuration read by "readcfg". Checks the values in + the config for syntactical and/or semantical errors. Sets defaults + for some options. Parses the "target[...]" options and filles the + array @parsed_targets ready for mrtg functions. + + The first three arguments are the same as for "readcfg". The fourth + argument is an arrayref which will be filled with the parsed target + defs. - "cfgcheck" converts the values of target settings - _o_p_t_i_o_n_s, e.g. + "cfgcheck" converts the values of target settings _o_p_t_i_o_n_s, e.g. options[router1]: bits, growright @@ -121,18 +114,16 @@ $targetcfg{'option'}{'bits'}{'router1'} = 1 $targetcfg{'option'}{'growright'}{'router1'} = 1 - This is not done by "readcfg" so if you don't use - "cfgcheck" you have to check the scalar variable _$_t_a_r_- - _g_e_t_c_f_g_{_'_o_p_t_i_o_n_'_}_{_'_r_o_u_t_e_r_1_'_} (MRTG allows options to be - separated by space or ','). + This is not done by "readcfg" so if you don't use "cfgcheck" you + have to check the scalar variable _$_t_a_r_g_e_t_c_f_g_{_'_o_p_t_i_o_n_'_}_{_'_r_o_u_t_e_r_1_'_} + (MRTG allows options to be separated by space or ','). "ensureSL" "ensureSL(\$pathname)" - Checks that the _p_a_t_h_n_a_m_e does not contain double path - separators and ends with a path separator. It uses - $MRTG_lib::SL as path separator which will be / or \ - depending on the OS. + Checks that the _p_a_t_h_n_a_m_e does not contain double path separators + and ends with a path separator. It uses $MRTG_lib::SL as path sepa- + rator which will be / or \ depending on the OS. "log2rrd" "log2rrd ($router,\%globalcfg,\%targetcfg)" @@ -142,9 +133,9 @@ "datestr" "datestr(time)" - Returns the time given in the argument as a nicely - formated date string. The argument has to be in UNIX - time format (seconds since 1970-1-1). + Returns the time given in the argument as a nicely formated date + string. The argument has to be in UNIX time format (seconds since + 1970-1-1). "timestamp" "timestamp()" @@ -154,16 +145,15 @@ "setup_loghandlers" "setup_loghandlers(filename)" - Install signalhandlers for __DIE__ and __WARN__ making - the errors go the the specified destination. If file- - name is 'eventlog' mrtg will log to the windows event - logger. + Install signalhandlers for __DIE__ and __WARN__ making the errors + go the the specified destination. If filename is 'eventlog' mrtg + will log to the windows event logger. "expistr" "expistr(time)" - Returns the time given in the argument formatted suit- - able for HTTP Expire-Headers. + Returns the time given in the argument formatted suitable for HTTP + Expire-Headers. "create_pid" "create_pid()" @@ -173,16 +163,15 @@ "demonize_me" "demonize_me()" - Puts the running program into background, detaching it - from the terminal. + Puts the running program into background, detaching it from the + terminal. "populatecache" - "populatecache(\%confcache, $host, $reread, $snmpopt- - shash)" + "populatecache(\%confcache, $host, $reread, $snmpoptshash)" - Reads the SNMP variables _i_f_D_e_s_c_r, _i_p_A_d_E_n_t_I_f_I_n_d_e_x, - _i_f_P_h_y_s_A_d_d_r_e_s_s, _i_f_N_a_m_e from the _h_o_s_t and stores the - values in _%_c_o_n_f_c_a_c_h_e as follows: + Reads the SNMP variables _i_f_D_e_s_c_r, _i_p_A_d_E_n_t_I_f_I_n_d_e_x, _i_f_P_h_y_s_A_d_d_r_e_s_s, + _i_f_N_a_m_e from the _h_o_s_t and stores the values in _%_c_o_n_f_c_a_c_h_e as fol- + lows: $confcache{$host}{'Descr'}{ifDescr}{oid} = (ifDescr or 'Dup') $confcache{$host}{'IP'}{ipAdEntIfIndex}{oid} = (ipAdEntIfIndex or 'Dup') @@ -190,8 +179,8 @@ $confcache{$host}{'Name'}{ifName}{oid} = (ifName or 'Dup') $confcache{$host}{'Type'}{ifType}{oid} = (ifType or 'Dup') - The value (at the right side of =) is 'Dup' if a value - was retrieved muliple times, the retrieved value else. + The value (at the right side of =) is 'Dup' if a value was + retrieved muliple times, the retrieved value else. "readconfcache" "my $confcache = readconfcache($file)" @@ -220,9 +209,8 @@ "debug" "debug($type, $message)" - Prints the _m_e_s_s_a_g_e on STDERR if debugging is enabled - for type _t_y_p_e. A debug type is enabled if _t_y_p_e is in - array @main::DEBUG. + Prints the _m_e_s_s_a_g_e on STDERR if debugging is enabled for type _t_y_p_e. + A debug type is enabled if _t_y_p_e is in array @main::DEBUG. AAUUTTHHOORRSS Rainer Bawidamann @@ -231,4 +219,4 @@ -2.14.7 2006-09-06 MRTGLIB(1) +2.16.1 2008-02-17 MRTGLIB(1) diff -Nru mrtg-2.14.7/doc/mrtg-logfile.1 mrtg-2.16.1/doc/mrtg-logfile.1 --- mrtg-2.14.7/doc/mrtg-logfile.1 2006-09-06 14:42:51.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-logfile.1 2008-02-17 10:27:36.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-LOGFILE 1" -.TH MRTG-LOGFILE 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-LOGFILE 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-logfile \- description of the mrtg\-2 logfile format .SH "SYNOPSIS" @@ -187,7 +187,7 @@ you can also ask perl to help by typing .Sp .Vb 1 -\& perl -e 'print scalar localtime(x),"\en"' +\& perl \-e 'print scalar localtime(x),"\en"' .Ve .Sp \&\fBx\fR is the unix timestamp and \fBy\fR is the offset in seconds diff -Nru mrtg-2.14.7/doc/mrtg-logfile.txt mrtg-2.16.1/doc/mrtg-logfile.txt --- mrtg-2.14.7/doc/mrtg-logfile.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-logfile.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-LOGFILE(1) mrtg MRTG-LOGFILE(1) +MRTG-LOGFILE(1) mrtg MRTG-LOGFILE(1) @@ -6,22 +6,21 @@ mrtg-logfile - description of the mrtg-2 logfile format SSYYNNOOPPSSIISS - This document provides a description of the contents of - the mrtg-2 logfile. + This document provides a description of the contents of the mrtg-2 log- + file. OOVVEERRVVIIEEWW The logfile consists of two main sections. The first Line - It stores the traffic counters from the most recent - run of mrtg. + It stores the traffic counters from the most recent run of mrtg. The rest of the File - Stores past traffic rate averates and maxima at incre- - assing intervals. + Stores past traffic rate averates and maxima at increassing inter- + vals. - The first number on each line is a unix time stamp. It - represents the number of seconds since 1970. + The first number on each line is a unix time stamp. It represents the + number of seconds since 1970. DDEETTAAIILLSS TThhee ffiirrsstt LLiinnee @@ -29,10 +28,9 @@ The first line has 3 numbers which are: A (1st column) - A timestamp of when MRTG last ran for this interface. - The timestamp is the number of non-skip seconds passed - since the standard UNIX "epoch" of midnight on 1st of - January 1970 GMT. + A timestamp of when MRTG last ran for this interface. The times- + tamp is the number of non-skip seconds passed since the standard + UNIX "epoch" of midnight on 1st of January 1970 GMT. B (2nd column) The "incoming bytes counter" value. @@ -42,56 +40,53 @@ TThhee rreesstt ooff tthhee FFiillee - The second and remaining lines of the file contains 5 num- - bers which are: + The second and remaining lines of the file contains 5 numbers which + are: A (1st column) - The Unix timestamp for the point in time the data on - this line is relevant. Note that the interval between - timestamps increases as you prograss through the file. - At first it is 5 minutes and at the end it is one day - between two lines. + The Unix timestamp for the point in time the data on this line is + relevant. Note that the interval between timestamps increases as + you prograss through the file. At first it is 5 minutes and at the + end it is one day between two lines. - This timestamp may be converted in OpenOffice Calc or - MS Excel by using the following formula + This timestamp may be converted in OpenOffice Calc or MS Excel by + using the following formula =(x+y)/86400+DATE(1970;1;1) - (instead of ";" it may be that you have to use "," - this depends on the context and your locale settings) + (instead of ";" it may be that you have to use "," this depends on + the context and your locale settings) you can also ask perl to help by typing perl -e 'print scalar localtime(x),"\n"' - xx is the unix timestamp and yy is the offset in seconds - from UTC. (Perl knows yy). + xx is the unix timestamp and yy is the offset in seconds from UTC. + (Perl knows yy). B (2nd column) - The average incoming transfer rate in bytes per sec- - ond. This is valid for the time between the A value of - the current line and the A value of the previous line. + The average incoming transfer rate in bytes per second. This is + valid for the time between the A value of the current line and the + A value of the previous line. C (3rd column) - The average outgoing transfer rate in bytes per second - since the previous measurement. + The average outgoing transfer rate in bytes per second since the + previous measurement. D (4th column) - The maximum incoming transfer rate in bytes per second - for the current interval. This is calculated from all - the updates which have occured in the current inter- - val. If the current interval is 1 hour, and updates - have occured every 5 minutes, it will be the biggest 5 + The maximum incoming transfer rate in bytes per second for the cur- + rent interval. This is calculated from all the updates which have + occured in the current interval. If the current interval is 1 hour, + and updates have occured every 5 minutes, it will be the biggest 5 minute transfer rate seen during the hour. E (5th column) - The maximum outgoing transfer rate in bytes per second - for the current interval. + The maximum outgoing transfer rate in bytes per second for the cur- + rent interval. AAUUTTHHOORR - Butch Kemper and Tobias Oetiker - + Butch Kemper and Tobias Oetiker -2.14.7 2006-09-06 MRTG-LOGFILE(1) +2.16.1 2008-02-17 MRTG-LOGFILE(1) diff -Nru mrtg-2.14.7/doc/mrtg-mibhelp.1 mrtg-2.16.1/doc/mrtg-mibhelp.1 --- mrtg-2.14.7/doc/mrtg-mibhelp.1 2006-09-06 14:42:52.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-mibhelp.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-MIBHELP 1" -.TH MRTG-MIBHELP 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-MIBHELP 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-mibhelp \- A Table of some interesting OIDs .SH "OVERVIEW" @@ -139,7 +139,7 @@ you may have to put \fBgauge\fR into the \fBOptions[]:\fR parameter. .PP For information about how to create a \fBTarget[]:\fR parameter which -references these \s-1MIB\s0 entries, please consult mrtg-reference. +references these \s-1MIB\s0 entries, please consult mrtg\-reference. .SH "MIB LIST" .IX Header "MIB LIST" .Sh "ifOperStatus" diff -Nru mrtg-2.14.7/doc/mrtg-mibhelp.pod mrtg-2.16.1/doc/mrtg-mibhelp.pod --- mrtg-2.14.7/doc/mrtg-mibhelp.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-mibhelp.pod 2008-02-17 10:27:36.000000000 +0000 @@ -9,7 +9,7 @@ you may have to put B into the B parameter. For information about how to create a B parameter which -references these MIB entries, please consult L. +references these MIB entries, please consult mrtg-reference. =head1 MIB LIST diff -Nru mrtg-2.14.7/doc/mrtg-mibhelp.txt mrtg-2.16.1/doc/mrtg-mibhelp.txt --- mrtg-2.14.7/doc/mrtg-mibhelp.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-mibhelp.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-MIBHELP(1) mrtg MRTG-MIBHELP(1) +MRTG-MIBHELP(1) mrtg MRTG-MIBHELP(1) @@ -6,14 +6,12 @@ mrtg-mibhelp - A Table of some interesting OIDs OOVVEERRVVIIEEWW - This File Contains a collection of interesting MIB Entries - ... mrtg knows about their names ... depending on the - ASN.1 Syntax you may have to put ggaauuggee into the OOppttiioonnss[[]]:: - parameter. - - For information about how to create a TTaarrggeett[[]]:: parameter - which references these MIB entries, please consult mrtg- - reference. + This File Contains a collection of interesting MIB Entries ... mrtg + knows about their names ... depending on the ASN.1 Syntax you may have + to put ggaauuggee into the OOppttiioonnss[[]]:: parameter. + + For information about how to create a TTaarrggeett[[]]:: parameter which refer- + ences these MIB entries, please consult mrtg-reference. MMIIBB LLIISSTT iiffOOppeerrSSttaattuuss @@ -23,9 +21,8 @@ ASN.1 Syntax: INTEGER Enumeration: up 1, down 2, testing 3 - The current operational state of the interface. The _t_e_s_t_- - _i_n_g(3) state indicates that no operational packets can be - passed. + The current operational state of the interface. The _t_e_s_t_i_n_g(3) state + indicates that no operational packets can be passed. iiffAAddmmiinnSSttaattuuss @@ -34,9 +31,8 @@ ASN.1 Syntax: INTEGER Enumeration: up 1, down 2, testing 3 - The current administrative state of the interface. The - _t_e_s_t_i_n_g(3) state indicates that no operational packets can - be passed. + The current administrative state of the interface. The _t_e_s_t_i_n_g(3) + state indicates that no operational packets can be passed. iiffIInnOOcctteettss @@ -44,8 +40,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.10 ASN.1 Syntax: Counter32 - The total number of octets received on the interface, - including framing characters. + The total number of octets received on the interface, including framing + characters. iiffIInnUUccaassttPPkkttss @@ -53,8 +49,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.11 ASN.1 Syntax: Counter32 - The number of subnetwork-unicast packets delivered to a - higher-layer protocol. + The number of subnetwork-unicast packets delivered to a higher-layer + protocol. iiffIInnNNUUccaassttPPkkttss @@ -62,9 +58,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.12 ASN.1 Syntax: Counter32 - The number of non-unicast (i.e., subnetwork- broadcast or - subnetwork-multicast) packets delivered to a higher-layer - protocol. + The number of non-unicast (i.e., subnetwork- broadcast or subnet- + work-multicast) packets delivered to a higher-layer protocol. iiffIInnDDiissccaarrddss @@ -72,11 +67,10 @@ Identifier: 1.3.6.1.2.1.2.2.1.13 ASN.1 Syntax: Counter32 - The number of inbound packets which were chosen to be dis- - carded even though no errors had been detected to prevent - their being deliverable to a higher-layer protocol. One - possible reason for discarding such a packet could be to - free up buffer space. + The number of inbound packets which were chosen to be discarded even + though no errors had been detected to prevent their being deliverable + to a higher-layer protocol. One possible reason for discarding such a + packet could be to free up buffer space. iiffIInnEErrrroorrss @@ -84,9 +78,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.14 ASN.1 Syntax: Counter32 - The number of inbound packets that contained errors pre- - venting them from being deliverable to a higher-layer pro- - tocol. + The number of inbound packets that contained errors preventing them + from being deliverable to a higher-layer protocol. iiffIInnUUnnkknnoowwnnPPrroottooss @@ -94,9 +87,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.15 ASN.1 Syntax: Counter32 - The number of packets received via the interface which - were discarded because of an unknown or unsupported proto- - col. + The number of packets received via the interface which were discarded + because of an unknown or unsupported protocol. iiffOOuuttOOcctteettss @@ -104,8 +96,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.16 ASN.1 Syntax: Counter32 - The total number of octets transmitted out of the inter- - face, including framing characters. + The total number of octets transmitted out of the interface, including + framing characters. iiffOOuuttUUccaassttPPkkttss @@ -113,9 +105,9 @@ Identifier: 1.3.6.1.2.1.2.2.1.17 ASN.1 Syntax: Counter32 - The total number of packets that higher-level protocols - requested be transmitted to a subnetwork-unicast address, - including those that were discarded or not sent. + The total number of packets that higher-level protocols requested be + transmitted to a subnetwork-unicast address, including those that were + discarded or not sent. iiffOOuuttNNUUccaassttPPkkttss @@ -123,13 +115,10 @@ Identifier: 1.3.6.1.2.1.2.2.1.18 ASN.1 Syntax: Counter32 - The total number of packets that higher-level protocols - requested be transmitted to a non- unicast (i.e., a sub- - network-broadcast or subnetwork-multicast) address, - including those that were discarded or not sent. - - - + The total number of packets that higher-level protocols requested be + transmitted to a non- unicast (i.e., a subnetwork-broadcast or subnet- + work-multicast) address, including those that were discarded or not + sent. iiffOOuuttDDiissccaarrddss @@ -137,10 +126,10 @@ Identifier: 1.3.6.1.2.1.2.2.1.19 ASN.1 Syntax: Counter32 - The number of outbound packets which were chosen to be - discarded even though no errors had been detected to pre- - vent their being transmitted. One possible reason for - discarding such a packet could be to free up buffer space. + The number of outbound packets which were chosen to be discarded even + though no errors had been detected to prevent their being transmitted. + One possible reason for discarding such a packet could be to free up + buffer space. iiffOOuuttEErrrroorrss @@ -148,8 +137,8 @@ Identifier: 1.3.6.1.2.1.2.2.1.20 ASN.1 Syntax: Counter32 - The number of outbound packets that could not be transmit- - ted because of errors. + The number of outbound packets that could not be transmitted because of + errors. iiffOOuuttQQLLeenn @@ -170,15 +159,15 @@ frInOctets.pp.dd&frOutOctets.pp.dd:community@cisco.router - where pp is the physical port that the frame relay pvc is - defined on and dd is the DLCI of the pvc gets you the in - and out octets for just that pvc. + where pp is the physical port that the frame relay pvc is defined on + and dd is the DLCI of the pvc gets you the in and out octets for just + that pvc. iiffAAddmmiinnHHaacckk aanndd iiffOOppeerrHHaacckk - The return values of ifAdminStatus and ifOperStatus are - not very usefull for graphing. Use ifOperHack and ifAdmin- - Hack instead. They return 1 for UP and 0 otherwise. + The return values of ifAdminStatus and ifOperStatus are not very use- + full for graphing. Use ifOperHack and ifAdminHack instead. They return + 1 for UP and 0 otherwise. Note these are not real MIB entities but mrtg hacks @@ -193,4 +182,4 @@ -2.14.7 2006-09-06 MRTG-MIBHELP(1) +2.16.1 2008-02-17 MRTG-MIBHELP(1) diff -Nru mrtg-2.14.7/doc/mrtg-nt-guide.1 mrtg-2.16.1/doc/mrtg-nt-guide.1 --- mrtg-2.14.7/doc/mrtg-nt-guide.1 2006-09-06 14:42:51.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nt-guide.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,9 +129,9 @@ .\" ======================================================================== .\" .IX Title "MRTG-NT-GUIDE 1" -.TH MRTG-NT-GUIDE 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-NT-GUIDE 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" -mrtg\-nt\-guide \- The Windows Guide to MRTG 2.14.7 +mrtg\-nt\-guide \- The MRTG 2.16.1 Windows Installation Guide .SH "SYNOPSIS" .IX Header "SYNOPSIS" Installing \s-1MRTG\s0 on a Windows box is not quite as \*(L"click and point\*(R" as some @@ -142,13 +142,12 @@ To get \s-1MRTG\s0 to work on Windows you need the following: .IP "\(bu" 4 A current copy of Perl. -For Example ActivePerl from -http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl +For Example ActivePerl 5.8.8 from ActiveState +http://www.activestate.com/store/activeperl/download/ .IP "\(bu" 4 -The latest version of \s-1MRTG\s0 from -http://oss.oetiker.ch/mrtg/pub Look for mrtg\-2.14.7.zip -or better. The archive also contains a precompiled copy of rateup.exe for -Win32. +The latest version of \s-1MRTG\s0 from http://oss.oetiker.ch/mrtg/pub. Look for +mrtg\-2.16.1.zip or better. The archive also contains a precompiled copy of +rateup.exe for Win32. .SH "INSTALLING" .IX Header "INSTALLING" I suggest you do the following from the machine that will be running \s-1MRTG\s0, @@ -156,7 +155,7 @@ to a \s-1LOCAL\s0 machine. .IP "First" 4 .IX Item "First" -Unzip \s-1MRTG\s0 to C:\emrtg\-2.14.7 on the Windows machine of your choice. +Unzip \s-1MRTG\s0 to C:\emrtg\-2.16.1 on the Windows machine of your choice. .IP "Next" 4 .IX Item "Next" Install Perl on the same Windows machine. You might want to make sure @@ -169,7 +168,7 @@ You can manually check this by going to [Control Panel]\->[System]\->[Environment] .PP To see if everything is installed properly you can open a Command Shell -and go into \fIc:\emrtg\-2.14.7\ebin\fR. Type: +and go into \fIc:\emrtg\-2.16.1\ebin\fR. Type: .PP .Vb 1 \& perl mrtg @@ -195,11 +194,11 @@ traffic, and the \s-1CPU\s0 load. Let's begin. .PP The first thing we do in setting up \s-1MRTG\s0 is making a default config file. -Get to a cmd prompt and change to the \fIc:\emrtg\-2.14.7\ebin\fR directory. Type the +Get to a cmd prompt and change to the \fIc:\emrtg\-2.16.1\ebin\fR directory. Type the following command: .PP .Vb 1 -\& perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\ewww\emrtg" --output mrtg.cfg +\& perl cfgmaker public@10.10.10.1 \-\-global "WorkDir: c:\ewww\emrtg" \-\-output mrtg.cfg .Ve .PP This creates an initial \s-1MRTG\s0 config file for you. Note that in this file all interfaces @@ -226,7 +225,7 @@ \& ###################################################################### \& # Description: LCP SUWGB \& # Contact: Administrator -\& # System Name: LC-Bridge +\& # System Name: LC\-Bridge \& # Location: Here \& #..................................................................... .Ve @@ -244,7 +243,7 @@ .Ve .PP .Vb 1 -\& Title[10.10.10.1.1]: LC-Bridge (sample.device): ether0 +\& Title[10.10.10.1.1]: LC\-Bridge (sample.device): ether0 .Ve .PP This section determines how the web page headers will look @@ -252,7 +251,7 @@ .Vb 9 \& PageTop[10.10.10.1.1]:

Traffic Analysis for ether0

\& -\& +\& \& \& \& @@ -264,10 +263,10 @@ .Vb 12 \& Target[10.10.10.1.2]: 2:public@10.10.10.1 \& MaxBytes[10.10.10.1.2]: 1250000 -\& Title[10.10.10.1.2]: LC-Bridge (): ulink0 +\& Title[10.10.10.1.2]: LC\-Bridge (): ulink0 \& PageTop[10.10.10.1.2]:

Traffic Analysis for ulink0

\&
System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ether0(1)
IP:sample.device(10.10.10.1)
-\& +\& \& \& \& @@ -277,11 +276,11 @@ .Ve .PP .Vb 1 -\& #--------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP And that's a very basic \s-1MRTG\s0 config file. You can run this and see your -results by going into the \fIc:\emrtg\-2.14.7\ebin\fR directory and typing: +results by going into the \fIc:\emrtg\-2.16.1\ebin\fR directory and typing: .PP .Vb 1 \& perl mrtg mrtg.cfg @@ -313,7 +312,7 @@ to your mrtg.cfg file and start it with: .PP .Vb 1 -\& start /Dc:\emrtg-2.14.7\ebin wperl mrtg --logging=eventlog mrtg.cfg +\& start /Dc:\emrtg\-2.16.1\ebin wperl mrtg \-\-logging=eventlog mrtg.cfg .Ve .PP If you use \fBwperl\fR instead of \fBperl\fR, no console window will show. \s-1MRTG\s0 is now @@ -325,8 +324,8 @@ If you put a shortcut with .PP .Vb 2 -\& Target: wperl mrtg --logging=eventlog mrtg.cfg -\& Start in: c:\emrtg-2.14.7\ebin +\& Target: wperl mrtg \-\-logging=eventlog mrtg.cfg +\& Start in: c:\emrtg\-2.16.1\ebin .Ve .PP into your start-up folder, \s-1MRTG\s0 will now start whenever you login to your \s-1NT\s0 @@ -373,7 +372,7 @@ .Vb 4 \& [HKEY_LOCAL_MACHINE\eSYSTEM\eCurrentControlSet\eServices\eMRTG\eParameters] \& "Application"="c:\e\eperl\e\ebin\e\ewperl.exe" -\& "AppParameters"="c:\e\emrtg\e\ebin\e\emrtg --logging=eventlog c:\e\emrtg\e\ebin\e\emrtg.cfg" +\& "AppParameters"="c:\e\emrtg\e\ebin\e\emrtg \-\-logging=eventlog c:\e\emrtg\e\ebin\e\emrtg.cfg" \& "AppDirectory"="c:\e\emrtg\e\ebin\e\e" .Ve .Sh "Service Installation" @@ -432,7 +431,7 @@ \& ###################################################################### \& # Description: LCP SUWGB \& # Contact: Administrator -\& # System Name: LC-Bridge +\& # System Name: LC\-Bridge \& # Location: Here \& #..................................................................... .Ve @@ -440,29 +439,29 @@ .Vb 12 \& Target[10.10.10.1.1]: 3:public@10.10.10.1 \& MaxBytes[10.10.10.1.1]: 1250000 -\& Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0 +\& Title[10.10.10.1.1]: LC\-Bridge (sample\-device): ether0 \& PageTop[10.10.10.1.1]:

Traffic Analysis for ether0

\&
System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ulink0(2)
IP:()
-\& +\& \& \& -\& +\& \& \& \&
System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ether0(3)
IP:sample-device(10.10.10.1)
IP:sample\-device(10.10.10.1)
Max Speed:1250.0 kBytes/s (ethernetCsmacd)
.Ve .PP .Vb 1 -\& #--------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP .Vb 12 \& Target[10.10.10.1.2]: 5:public@10.10.10.1 \& MaxBytes[10.10.10.1.2]: 1250000 -\& Title[10.10.10.1.2]: LC-Bridge (): ulink0 +\& Title[10.10.10.1.2]: LC\-Bridge (): ulink0 \& PageTop[10.10.10.1.2]:

Traffic Analysis for ulink0

\& -\& +\& \& \& \& @@ -472,35 +471,35 @@ .Ve .PP .Vb 1 -\& #--------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP .Vb 12 \& Target[10.10.10.1.1]: 10:public@10.10.10.1 \& MaxBytes[10.10.10.1.1]: 1250000 -\& Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0 +\& Title[10.10.10.1.1]: LC\-Bridge (sample\-device): ether0 \& PageTop[10.10.10.1.1]:

Traffic Analysis for ether0

\&
System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ulink0(5)
IP:()
-\& +\& \& \& -\& +\& \& \& \&
System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ether0(10)
IP:sample-device(10.10.10.1)
IP:sample\-device(10.10.10.1)
Max Speed:1250.0 kBytes/s (ethernetCsmacd)
.Ve .PP .Vb 1 -\& #--------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP .Vb 12 \& Target[10.10.10.1.2]: 24:public@10.10.10.1 \& MaxBytes[10.10.10.1.2]: 1250000 -\& Title[10.10.10.1.2]: LC-Bridge (): ulink0 +\& Title[10.10.10.1.2]: LC\-Bridge (): ulink0 \& PageTop[10.10.10.1.2]:

Traffic Analysis for ulink0

\& -\& +\& \& \& \& @@ -510,7 +509,7 @@ .Ve .PP .Vb 1 -\& #--------------------------------------------------------------- +\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP .Vb 18 @@ -544,4 +543,4 @@ Steve Pierce , Artyom Adjemov , Ilja Ivanov -Karel Fajkus +Karel Fajkus diff -Nru mrtg-2.14.7/doc/mrtg-nt-guide.pod mrtg-2.16.1/doc/mrtg-nt-guide.pod --- mrtg-2.14.7/doc/mrtg-nt-guide.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nt-guide.pod 2008-02-17 10:27:36.000000000 +0000 @@ -1,6 +1,6 @@ =head1 NAME -mrtg-nt-guide - The Windows Guide to MRTG 2.14.7 +mrtg-nt-guide - The MRTG 2.16.1 Windows Installation Guide =head1 SYNOPSIS @@ -17,16 +17,15 @@ =item * A current copy of Perl. -For Example ActivePerl from -http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl +For Example ActivePerl 5.8.8 from ActiveState +http://www.activestate.com/store/activeperl/download/ =item * -The latest version of MRTG from -http://oss.oetiker.ch/mrtg/pub Look for mrtg-2.14.7.zip -or better. The archive also contains a precompiled copy of rateup.exe for -Win32. +The latest version of MRTG from http://oss.oetiker.ch/mrtg/pub. Look for +mrtg-2.16.1.zip or better. The archive also contains a precompiled copy of +rateup.exe for Win32. =back @@ -41,7 +40,7 @@ =item First -Unzip MRTG to C:\mrtg-2.14.7 on the Windows machine of your choice. +Unzip MRTG to C:\mrtg-2.16.1 on the Windows machine of your choice. =item Next @@ -55,7 +54,7 @@ =back To see if everything is installed properly you can open a Command Shell -and go into F. Type: +and go into F. Type: perl mrtg @@ -90,7 +89,7 @@ traffic, and the CPU load. Let's begin. The first thing we do in setting up MRTG is making a default config file. -Get to a cmd prompt and change to the F directory. Type the +Get to a cmd prompt and change to the F directory. Type the following command: perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\www\mrtg" --output mrtg.cfg @@ -158,7 +157,7 @@ #--------------------------------------------------------------- And that's a very basic MRTG config file. You can run this and see your -results by going into the F directory and typing: +results by going into the F directory and typing: perl mrtg mrtg.cfg @@ -187,7 +186,7 @@ to your mrtg.cfg file and start it with: - start /Dc:\mrtg-2.14.7\bin wperl mrtg --logging=eventlog mrtg.cfg + start /Dc:\mrtg-2.16.1\bin wperl mrtg --logging=eventlog mrtg.cfg If you use B instead of B, no console window will show. MRTG is now running in the background. If it runs into problems it will tell you so @@ -198,7 +197,7 @@ If you put a shortcut with Target: wperl mrtg --logging=eventlog mrtg.cfg - Start in: c:\mrtg-2.14.7\bin + Start in: c:\mrtg-2.16.1\bin into your start-up folder, MRTG will now start whenever you login to your NT box. @@ -407,6 +406,6 @@ Steve Pierce EMRTG@HDL.comE, Artyom Adjemov Eone.bofh@gmail.comE, Ilja Ivanov Eivanov@bseu.byE -Karel Fajkus Ekarel@fajkus.czE +Karel Fajkus Ehttp://fajkus.cz/E diff -Nru mrtg-2.14.7/doc/mrtg-nt-guide.txt mrtg-2.16.1/doc/mrtg-nt-guide.txt --- mrtg-2.14.7/doc/mrtg-nt-guide.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nt-guide.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,98 +1,86 @@ -MRTG-NT-GUIDE(1) mrtg MRTG-NT-GUIDE(1) +MRTG-NT-GUIDE(1) mrtg MRTG-NT-GUIDE(1) NNAAMMEE - mrtg-nt-guide - The Windows Guide to MRTG 2.14.7 + mrtg-nt-guide - The MRTG 2.16.1 Windows Installation Guide SSYYNNOOPPSSIISS - Installing MRTG on a Windows box is not quite as "click - and point" as some might want it to be. But then again, it - is not all that difficult if you follow the instructions - below. + Installing MRTG on a Windows box is not quite as "click and point" as + some might want it to be. But then again, it is not all that difficult + if you follow the instructions below. PPRREERREEQQUUIISSIITTEESS To get MRTG to work on Windows you need the following: - +o A current copy of Perl. For Example ActivePerl from - http://www.activestate.com/Products/Download/Down- - load.plex?id=ActivePerl - - +o The latest version of MRTG from - http://oss.oetiker.ch/mrtg/pub Look for - mrtg-2.14.7.zip or better. The archive also contains a + +o A current copy of Perl. For Example ActivePerl 5.8.8 from ActiveS- + tate http://www.activestate.com/store/activeperl/download/ + + +o The latest version of MRTG from http://oss.oetiker.ch/mrtg/pub. + Look for mrtg-2.16.1.zip or better. The archive also contains a precompiled copy of rateup.exe for Win32. IINNSSTTAALLLLIINNGG - I suggest you do the following from the machine that will - be running MRTG, which, in this case, is also a web - server. All examples are for doing things to a LOCAL - machine. + I suggest you do the following from the machine that will be running + MRTG, which, in this case, is also a web server. All examples are for + doing things to a LOCAL machine. First - Unzip MRTG to C:\mrtg-2.14.7 on the Windows machine of - your choice. + Unzip MRTG to C:\mrtg-2.16.1 on the Windows machine of your choice. Next - Install Perl on the same Windows machine. You might - want to make sure that the Perl binary directory is - listed in your system path. + Install Perl on the same Windows machine. You might want to make + sure that the Perl binary directory is listed in your system path. C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;... - You can manually check this by going to [Control - Panel]->[System]->[Environment] + You can manually check this by going to [Control Panel]->[Sys- + tem]->[Environment] - To see if everything is installed properly you can open a - Command Shell and go into _c_:_\_m_r_t_g_-_2_._1_4_._7_\_b_i_n. Type: + To see if everything is installed properly you can open a Command Shell + and go into _c_:_\_m_r_t_g_-_2_._1_6_._1_\_b_i_n. Type: perl mrtg - This should give you a friendly error message complaining - about the missing MRTG configuration file. Now, you have - successfully installed MRTG and Perl. + This should give you a friendly error message complaining about the + missing MRTG configuration file. Now, you have successfully installed + MRTG and Perl. CCOONNFFIIGGUURRIINNGG MMRRTTGG - Now it is time to create a configuration for MRTG. But - before we begin you need to know a few things. Take an - opportunity to gather the following information: - - +o The IP address or hostname and the SNMP port number, - (if non standard), of the device you want to monitor. - - +o If you want to monitor something other than bytes in - and out, you must also know the SNMPOID of what you - want to monitor. - - +o Finally you need to know the read-only SNMP community - string for your device. If you don't know it, try ppuubb-- - lliicc, that is the default. - - For the rest of this document we will be using device - 1100..1100..1100..11 ( a CISCO Catalyst 5000) with Community string - ppuubblliicc. We are interested in monitoring traffic, and the - CPU load. Let's begin. - - The first thing we do in setting up MRTG is making a - default config file. Get to a cmd prompt and change to - the _c_:_\_m_r_t_g_-_2_._1_4_._7_\_b_i_n directory. Type the following com- - mand: + Now it is time to create a configuration for MRTG. But before we begin + you need to know a few things. Take an opportunity to gather the fol- + lowing information: + + +o The IP address or hostname and the SNMP port number, (if non stan- + dard), of the device you want to monitor. + + +o If you want to monitor something other than bytes in and out, you + must also know the SNMPOID of what you want to monitor. + + +o Finally you need to know the read-only SNMP community string for + your device. If you don't know it, try ppuubblliicc, that is the default. + + For the rest of this document we will be using device 1100..1100..1100..11 ( a + CISCO Catalyst 5000) with Community string ppuubblliicc. We are interested in + monitoring traffic, and the CPU load. Let's begin. + + The first thing we do in setting up MRTG is making a default config + file. Get to a cmd prompt and change to the _c_:_\_m_r_t_g_-_2_._1_6_._1_\_b_i_n direc- + tory. Type the following command: perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\www\mrtg" --output mrtg.cfg - This creates an initial MRTG config file for you. Note - that in this file all interfaces of your router will be - stored by number. Unfortunately, these numbers are likely - to change whenever you reconfigure your router. In order - to work around this you can get _c_f_g_m_a_k_e_r to produce a con- - figuration which is based on Ip numbers, or even Interface + This creates an initial MRTG config file for you. Note that in this + file all interfaces of your router will be stored by number. Unfortu- + nately, these numbers are likely to change whenever you reconfigure + your router. In order to work around this you can get _c_f_g_m_a_k_e_r to pro- + duce a configuration which is based on Ip numbers, or even Interface Descriptions. Check cfgmaker - If you get an error message complaining about nnoo ssuucchh nnaammee - or nnoo rreessppoonnssee, your community name is probably wrong. + If you get an error message complaining about nnoo ssuucchh nnaammee or nnoo + rreessppoonnssee, your community name is probably wrong. - Now, let's take a look at the mrtg.cfg file that was cre- - ated. + Now, let's take a look at the mrtg.cfg file that was created. In Perl, a "#" is a comment, synonymous with "REM" in DOS. @@ -100,8 +88,7 @@ WorkDir: D:\InetPub\wwwroot\MRTG - This is where the web pages are created, usually a web - root. + This is where the web pages are created, usually a web root. ###################################################################### # Description: LCP SUWGB @@ -110,13 +97,12 @@ # Location: Here #..................................................................... - TargetDevice's IP Address:Interface Number:Community:IP - Address + TargetDevice's IP Address:Interface Number:Community:IP Address Target[10.10.10.1.1]: 1:public@10.10.10.1 - This is the interface speed (Default is 10 megabits; for - 100Mbit devices use 12500000 and so on...) + This is the interface speed (Default is 10 megabits; for 100Mbit + devices use 12500000 and so on...) MaxBytes[10.10.10.1.1]: 1250000 @@ -124,12 +110,6 @@ This section determines how the web page headers will look - - - - - - PageTop[10.10.10.1.1]:

Traffic Analysis for ether0

System:LC-Bridge inAndover
System:LC\-Bridge inAndover
Maintainer:Administrator
Interface:ulink0(24)
IP:()
@@ -155,31 +135,27 @@ #--------------------------------------------------------------- - And that's a very basic MRTG config file. You can run this - and see your results by going into the _c_:_\_m_r_t_g_-_2_._1_4_._7_\_b_i_n - directory and typing: + And that's a very basic MRTG config file. You can run this and see your + results by going into the _c_:_\_m_r_t_g_-_2_._1_6_._1_\_b_i_n directory and typing: perl mrtg mrtg.cfg - It is normal to get errors for the first two times you run - this command. The errors will alert you about the fact - that there have not been any log files in existence - before. - - If you take a look at those web pages they are not very - exciting (yet). You need to have the MRTG files run every - five minutes to produce the desired results. Just run it - again after a few minutes. You should now be able to see - the first lines in your graphs. + It is normal to get errors for the first two times you run this com- + mand. The errors will alert you about the fact that there have not been + any log files in existence before. + + If you take a look at those web pages they are not very exciting (yet). + You need to have the MRTG files run every five minutes to produce the + desired results. Just run it again after a few minutes. You should now + be able to see the first lines in your graphs. MMAAKKEE MMRRTTGG RRUUNN AALLLL TTHHEE TTIIMMEE - Starting MRTG by hand every time you want to run it is not - going to make you happy I guess. + Starting MRTG by hand every time you want to run it is not going to + make you happy I guess. - There is a special option you can set in the MRTG configu- - ration file so so that MRTG will not terminate after it - was started. Instead it will wait for 5 minutes and then - run again. + There is a special option you can set in the MRTG configuration file so + so that MRTG will not terminate after it was started. Instead it will + wait for 5 minutes and then run again. Add the option @@ -187,66 +163,57 @@ to your mrtg.cfg file and start it with: - start /Dc:\mrtg-2.14.7\bin wperl mrtg --logging=eventlog mrtg.cfg + start /Dc:\mrtg-2.16.1\bin wperl mrtg --logging=eventlog mrtg.cfg - If you use wwppeerrll instead of ppeerrll, no console window will - show. MRTG is now running in the background. If it runs - into problems it will tell you so over the EventLog. To - stop MRTG, open the Task Manager and terminate the - wwppeerrll..eexxee process. If mrtg has anything to tell you these + If you use wwppeerrll instead of ppeerrll, no console window will show. MRTG is + now running in the background. If it runs into problems it will tell + you so over the EventLog. To stop MRTG, open the Task Manager and ter- + minate the wwppeerrll..eexxee process. If mrtg has anything to tell you these messages can be found in the event log. If you put a shortcut with Target: wperl mrtg --logging=eventlog mrtg.cfg - Start in: c:\mrtg-2.14.7\bin + Start in: c:\mrtg-2.16.1\bin - into your start-up folder, MRTG will now start whenever - you login to your NT box. + into your start-up folder, MRTG will now start whenever you login to + your NT box. - If you do not want to log into your box just to start - MRTG. Have a look at http://www.firedae- - mon.com/mrtg-howto.html which describes a free tool to - start any program as a Service. The pages gives specific + If you do not want to log into your box just to start MRTG. Have a look + at http://www.firedaemon.com/mrtg-howto.html which describes a free + tool to start any program as a Service. The pages gives specific instructions for MRTG users. HHOOWW TTOO SSEETTUUPP MMRRTTGG AASS AA WWIINNDDOOWWSS SSEERRVVIICCEE AAddddiittiioonnaall PPrreerreeqquuiissiitteess - +o MRTG must be installed and fully configured on the - target system. In the following exercise the assump- - tion is that MRTG is installed under c:\mrtg\ and all - the sample files use this location. - - +o Microsoft Tools SSRRVVAANNYY..eexxee (Applications as Services - Utility) and IINNSSTTSSRRVV..eexxee (Service Installer) - Those - files can be downloaded from Microsoft as a part of - Windows 2000 Resource Kit at + +o MRTG must be installed and fully configured on the target system. + In the following exercise the assumption is that MRTG is installed + under c:\mrtg\ and all the sample files use this location. + + +o Microsoft Tools SSRRVVAANNYY..eexxee (Applications as Services Utility) and + IINNSSTTSSRRVV..eexxee (Service Installer) - Those files can be downloaded + from Microsoft as a part of Windows 2000 Resource Kit at . They are also avail- - able from other locations such as , - , etc. - Detailed instructions on how to use this package are - available at . In order to follow - the steps in this HOW-TO you MMUUSSTT obtain both executa- - bles. + info/reskit/tools/default.asp>. They are also available from other + locations such as , + , etc. Detailed instruc- + tions on how to use this package are available at . In order to follow the steps in + this HOW-TO you MMUUSSTT obtain both executables. - +o You must have administrative rights on the target sys- - tem. + +o You must have administrative rights on the target system. PPrreeppaarraattiioonn - Please complete the following steps before starting the - installation: + Please complete the following steps before starting the installation: - +o Copy ssrrvvaannyy..eexxee and iinnssttssrrvv..eexxee to c:\mrtg\bin\ (your - MRTG bin directory). + +o Copy ssrrvvaannyy..eexxee and iinnssttssrrvv..eexxee to c:\mrtg\bin\ (your MRTG bin + directory). - +o Create a file called mmrrttgg..rreegg anywhere on your system - and paste the following content into it: + +o Create a file called mmrrttgg..rreegg anywhere on your system and paste the + following content into it: Windows Registry Editor Version 5.00 @@ -257,52 +224,47 @@ SSeerrvviiccee IInnssttaallllaattiioonn - Once again, assuming that MRTG is already fully installed - and configured on the target system under c:\mrtg\ the - following steps are necessary to setup MRTG as a service. - - Using the command prompt go into the temporary directory - where you unzipped the package. When there type the fol- - lowing command to create a service named "MRTG" in the - Windows Services management console: + Once again, assuming that MRTG is already fully installed and config- + ured on the target system under c:\mrtg\ the following steps are neces- + sary to setup MRTG as a service. + + Using the command prompt go into the temporary directory where you + unzipped the package. When there type the following command to create + a service named "MRTG" in the Windows Services management console: instsrv MRTG c:\mrtg\bin\srvany.exe - Now you need to create the AApppp** entries required for the - new service. You can do this by either right-clicking on - the mrtg.reg file and selecting 'merge' or by running the - following command: + Now you need to create the AApppp** entries required for the new service. + You can do this by either right-clicking on the mrtg.reg file and + selecting 'merge' or by running the following command: regedit /s mrtg.reg - After setting up the registry entry it is time to point it - to your MRTG installation. If you have installed MRTG - under _c_:_\_m_r_t_g_\, you can skip this step. Open your reg- - istry editor (Start -> Run -> regedt32), and locate the - [[HHKKEEYY__LLOOCCAALL__MMAACCHHIINNEE\\SSYYSSTTEEMM\\CCuurrrreennttCCoonnttrroollSSeett\\SSeerr-- - vviicceess\\MMRRTTGG]] key. Make sure that the IImmaaggeePPaatthh variable is - correctly pointing to ssrrvvaannyy..eexxee located in your MRTG bin - directory (for example c:\mrtg\bin\srvany.exe). Next you - have to expand the MRTG tree, and go to the - [[HHKKEEYY__LLOOCCAALL__MMAACCHHIINNEE\\SSYYSSTTEEMM\\CCuurrrreennttCCoonnttrroollSSeett\\SSeerr-- - vviicceess\\MMRRTTGG\\PPaarraammeetteerrss]] key. Under Parameters make sure - that all the AApppplliiccaattiioonn variables are setup properly. - - At this point you are ready to run the service. The only - thing left to do is to start the MRTG service in the Ser- - vices management console. After you do this, you should - see two new processes running on your system: srvany.exe - and wperl.exe. Make sure to stop any previously running - MRTG processes to avoid conflict. + After setting up the registry entry it is time to point it to your MRTG + installation. If you have installed MRTG under _c_:_\_m_r_t_g_\, you can skip + this step. Open your registry editor (Start -> Run -> regedt32), and + locate the [[HHKKEEYY__LLOOCCAALL__MMAACCHHIINNEE\\SSYYSSTTEEMM\\CCuurrrreennttCCoonnttrroollSSeett\\SSeerrvviicceess\\MMRRTTGG]] + key. Make sure that the IImmaaggeePPaatthh variable is correctly pointing to + ssrrvvaannyy..eexxee located in your MRTG bin directory (for example + c:\mrtg\bin\srvany.exe). Next you have to expand the MRTG tree, and go + to the [[HHKKEEYY__LLOOCCAALL__MMAACCHHIINNEE\\SSYYSSTTEEMM\\CCuurrrreennttCCoonnttrroollSSeett\\SSeerr-- + vviicceess\\MMRRTTGG\\PPaarraammeetteerrss]] key. Under Parameters make sure that all the + AApppplliiccaattiioonn variables are setup properly. + + At this point you are ready to run the service. The only thing left to + do is to start the MRTG service in the Services management console. + After you do this, you should see two new processes running on your + system: srvany.exe and wperl.exe. Make sure to stop any previously + running MRTG processes to avoid conflict. - Note that it is imperative to set the RRuunnAAssDDaaeemmoonn:: yyeess - option or the service will stop after just one single run! + Note that it is imperative to set the RRuunnAAssDDaaeemmoonn:: yyeess option or the + service will stop after just one single run! EEXXAAMMPPLLEE - Now lets look at a config file to monitor what we wanted - to on our mythical Cisco Cat 5000 -- utilization on ports - 3, 5, 10, and 24, and the CPU Load, which will show us - nonstandard mrtg configurations as well as more options.. + Now lets look at a config file to monitor what we wanted to on our + mythical Cisco Cat 5000 -- utilization on ports 3, 5, 10, and 24, and + the CPU Load, which will show us nonstandard mrtg configurations as + well as more options.. WorkDir: D:\InetPub\wwwroot\MRTG RunAsDaemon: yes @@ -393,17 +355,15 @@ LegendO[cpu.1]:  Usage Options[cpu.1]: gauge - This is a nice example of how to monitor any SNMP device - if you know what OID you want to use. Once again, for an - explanation of the more advance features of mrtg, please - see the rest of the documentation. + This is a nice example of how to monitor any SNMP device if you know + what OID you want to use. Once again, for an explanation of the more + advance features of mrtg, please see the rest of the documentation. AAUUTTHHOORRSS - Tobi Oetiker , David S. Divins , Steve Pierce , Artyom - Adjemov , Ilja Ivanov - Karel Fajkus + Tobi Oetiker , David S. Divins , + Steve Pierce , Artyom Adjemov , Ilja + Ivanov Karel Fajkus -2.14.7 2006-09-06 MRTG-NT-GUIDE(1) +2.16.1 2008-02-17 MRTG-NT-GUIDE(1) diff -Nru mrtg-2.14.7/doc/mrtg-nw-guide.1 mrtg-2.16.1/doc/mrtg-nw-guide.1 --- mrtg-2.14.7/doc/mrtg-nw-guide.1 2006-09-06 14:42:51.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nw-guide.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-NW-GUIDE 1" -.TH MRTG-NW-GUIDE 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-NW-GUIDE 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-nw\-guide \- MRTG for NetWare .SH "SYNOPSIS" @@ -208,37 +208,37 @@ Copy from the \s-1MRTG\s0 package the following files: .Sp .Vb 1 -\& \ebin\e* to SYS:/Mrtg/bin All files. See Note 1. +\& \ebin\e* to SYS:/Mrtg/bin All files. See Note 1. .Ve .Sp .Vb 2 -\& Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. -\& The rateup.exe will NOT be needed on the NetWare server. +\& Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. +\& The rateup.exe will NOT be needed on the NetWare server. .Ve .Sp .Vb 4 -\& \econtrib\e* to SYS:/Mrtg/contrib/ Include sub-directories -\& \edoc\e* to SYS:/Mrtg/doc/ All files -\& \eimages\e* to SYS:/Mrtg/html/images/ All files -\& \etranslate\e* to SYS:/Mrtg/translate/ All files. See Note 2. +\& \econtrib\e* to SYS:/Mrtg/contrib/ Include sub\-directories +\& \edoc\e* to SYS:/Mrtg/doc/ All files +\& \eimages\e* to SYS:/Mrtg/html/images/ All files +\& \etranslate\e* to SYS:/Mrtg/translate/ All files. See Note 2. .Ve .Sp .Vb 1 -\& Note 2: For English-only language support, all \etranslate files EXCEPT Locales_mrtg may be deleted. +\& Note 2: For English\-only language support, all \etranslate files EXCEPT Locales_mrtg may be deleted. .Ve .Sp .Vb 1 -\& \elib\e* to SYS:/Mrtg/lib Include sub-directories. See Note 3. +\& \elib\e* to SYS:/Mrtg/lib Include sub\-directories. See Note 3. .Ve .Sp .Vb 1 -\& Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. +\& Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. .Ve .IP "4." 4 Create copies of the three .ncf files and install them: .Sp .Vb 1 -\& *.ncf to SYS:/Mrtg/bin +\& *.ncf to SYS:/Mrtg/bin .Ve .Sp See NetWare Support in this document for details on how to create copies of these files. @@ -253,22 +253,19 @@ .IP "\(bu" 4 Edit sys:/mrtg/bin/MakeMrtgCfg.ncf: .Sp -.Vb 2 -\& - replace ccccc with the GET community name for the SNMP device (typically 'public'), -\& - replace ddddd with the DNS name or IP address of the device to be monitored. -.Ve -.Sp -.Vb 1 -\& e.g public@www.myserver.com, public@10.202.65.180 +.Vb 3 +\& \- replace ccccc with the GET community name for the SNMP device (typically 'public'), +\& \- replace ddddd with the DNS name or IP address of the device to be monitored. +\& e.g public@www.myserver.com, public@10.202.65.180 .Ve .Sp .Vb 2 -\& Note 1: These are NOT mail addresses, they just look like one! -\& Note 2: If multiple devices are to be monitored, add their entries to the same line: +\& Note 1: These are NOT mail addresses, they just look like one! +\& Note 2: If multiple devices are to be monitored, add their entries to the same line: .Ve .Sp .Vb 1 -\& e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg +\& e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg .Ve .Sp In this \*(L"Getting Started\*(R", it is 'suggested' to only monitor a single device. @@ -276,7 +273,7 @@ At the server console, run: .Sp .Vb 1 -\& sys:/mrtg/bin/MakeMrtgCfg.ncf +\& sys:/mrtg/bin/MakeMrtgCfg.ncf .Ve .Sp This will create Mrtg.cfg in sys:/mrtg/bin. @@ -287,7 +284,7 @@ the following message: .Sp .Vb 5 -\& ### Interface 1 >> Descr: 'Intel(R)-8255x-based-Network-Connection'... +\& ### Interface 1 >> Descr: 'Intel(R)\-8255x\-based\-Network\-Connection'... \& ### The following interface is commented out because: \& ### * has a speed of 0 which makes no sense \& # @@ -297,7 +294,7 @@ If this occurs, edit MakeMrtgCfg.ncf and add the following parameter as shown: .Sp .Vb 1 -\& perl sys:\emrtg\ebin\ecfgmaker.pl --zero-speed=nnn public@10.202.65.180 > sys:\emrtg\ebin\eMrtg.cfg +\& perl sys:\emrtg\ebin\ecfgmaker.pl \-\-zero\-speed=nnn public@10.202.65.180 > sys:\emrtg\ebin\eMrtg.cfg .Ve .Sp where \fBnnn\fR is the interface speed in bits per second. For a 100 Megabit \s-1LAN\s0 \s-1NIC\s0, nnn = 10000000. It will be @@ -359,7 +356,7 @@ match the value entered for (HtmlDir). .Sp .Vb 1 -\& perl --noscreen sys:/mrtg/bin/indexmaker.pl sys:/mrtg/bin/Mrtg.cfg > /index.html +\& perl \-\-noscreen sys:/mrtg/bin/indexmaker.pl sys:/mrtg/bin/Mrtg.cfg > /index.html .Ve .IP "\(bu" 4 Create an index.html page linking the seperate device \s-1HTML\s0 page(s). At the server console, run: @@ -465,7 +462,7 @@ commandline switch: .PP .Vb 1 -\& RATEUP -f filename +\& RATEUP \-f filename .Ve .PP where the filename parameter can include a leading path element. @@ -498,12 +495,12 @@ .Ve .PP .Vb 2 -\& # Replace ccccc with your device GET SNMP Community Name - If unsure try 'public'. +\& # Replace ccccc with your device GET SNMP Community Name \- If unsure try 'public'. \& # Replace ddddd with your device IP (n.n.n.n) or domain name. .Ve .PP .Vb 1 -\& perl --noscreen sys:\emrtg\ebin\ecfgmaker.pl ccccc@ddddd > sys:\emrtg\ebin\eMrtg.cfg +\& perl \-\-noscreen sys:\emrtg\ebin\ecfgmaker.pl ccccc@ddddd > sys:\emrtg\ebin\eMrtg.cfg .Ve .PP .Vb 2 @@ -528,7 +525,7 @@ .Ve .PP .Vb 1 -\& perl --noscreen sys:\emrtg\ebin\emrtg.pl sys:\emrtg\ebin\emrtg.cfg +\& perl \-\-noscreen sys:\emrtg\ebin\emrtg.pl sys:\emrtg\ebin\emrtg.cfg .Ve .PP .Vb 2 @@ -555,7 +552,7 @@ .Ve .PP .Vb 1 -\& perl --noscreen sys:\emrtg\ebin\eindexmaker.pl sys:\emrtg\ebin\eMrtg.cfg > sys:\emrtg\ehtml\eindex.html +\& perl \-\-noscreen sys:\emrtg\ebin\eindexmaker.pl sys:\emrtg\ebin\eMrtg.cfg > sys:\emrtg\ehtml\eindex.html .Ve .PP .Vb 2 diff -Nru mrtg-2.14.7/doc/mrtg-nw-guide.pod mrtg-2.16.1/doc/mrtg-nw-guide.pod --- mrtg-2.14.7/doc/mrtg-nw-guide.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nw-guide.pod 2008-02-17 10:27:36.000000000 +0000 @@ -115,27 +115,27 @@ Copy from the MRTG package the following files: - \bin\* to SYS:/Mrtg/bin All files. See Note 1. + \bin\* to SYS:/Mrtg/bin All files. See Note 1. - Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. - The rateup.exe will NOT be needed on the NetWare server. + Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. + The rateup.exe will NOT be needed on the NetWare server. - \contrib\* to SYS:/Mrtg/contrib/ Include sub-directories - \doc\* to SYS:/Mrtg/doc/ All files - \images\* to SYS:/Mrtg/html/images/ All files - \translate\* to SYS:/Mrtg/translate/ All files. See Note 2. + \contrib\* to SYS:/Mrtg/contrib/ Include sub-directories + \doc\* to SYS:/Mrtg/doc/ All files + \images\* to SYS:/Mrtg/html/images/ All files + \translate\* to SYS:/Mrtg/translate/ All files. See Note 2. - Note 2: For English-only language support, all \translate files EXCEPT Locales_mrtg may be deleted. + Note 2: For English-only language support, all \translate files EXCEPT Locales_mrtg may be deleted. - \lib\* to SYS:/Mrtg/lib Include sub-directories. See Note 3. + \lib\* to SYS:/Mrtg/lib Include sub-directories. See Note 3. - Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. + Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. =item 4. Create copies of the three .ncf files and install them: - *.ncf to SYS:/Mrtg/bin + *.ncf to SYS:/Mrtg/bin See NetWare Support in this document for details on how to create copies of these files. @@ -159,15 +159,14 @@ Edit sys:/mrtg/bin/MakeMrtgCfg.ncf: - - replace ccccc with the GET community name for the SNMP device (typically 'public'), - - replace ddddd with the DNS name or IP address of the device to be monitored. + - replace ccccc with the GET community name for the SNMP device (typically 'public'), + - replace ddddd with the DNS name or IP address of the device to be monitored. + e.g public@www.myserver.com, public@10.202.65.180 - e.g public@www.myserver.com, public@10.202.65.180 + Note 1: These are NOT mail addresses, they just look like one! + Note 2: If multiple devices are to be monitored, add their entries to the same line: - Note 1: These are NOT mail addresses, they just look like one! - Note 2: If multiple devices are to be monitored, add their entries to the same line: - - e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg + e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg In this "Getting Started", it is 'suggested' to only monitor a single device. @@ -175,7 +174,7 @@ At the server console, run: - sys:/mrtg/bin/MakeMrtgCfg.ncf + sys:/mrtg/bin/MakeMrtgCfg.ncf This will create Mrtg.cfg in sys:/mrtg/bin. diff -Nru mrtg-2.14.7/doc/mrtg-nw-guide.txt mrtg-2.16.1/doc/mrtg-nw-guide.txt --- mrtg-2.14.7/doc/mrtg-nw-guide.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-nw-guide.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-NW-GUIDE(1) mrtg MRTG-NW-GUIDE(1) +MRTG-NW-GUIDE(1) mrtg MRTG-NW-GUIDE(1) @@ -6,13 +6,12 @@ mrtg-nw-guide - MRTG for NetWare SSYYNNOOPPSSIISS - This guide is intended to aid in the installation and con- - figuration of MRTG on a NetWare server. + This guide is intended to aid in the installation and configuration of + MRTG on a NetWare server. OOVVEERRVVIIEEWW - MRTG is a relative newcomer to the NetWare platform. Ear- - lier versions of NetWare could not run MRTG natively for - several reasons: + MRTG is a relative newcomer to the NetWare platform. Earlier versions + of NetWare could not run MRTG natively for several reasons: +o Absence of NetWare OS support in the MRTG package. @@ -24,66 +23,58 @@ +o Problems with NetWare's implementation of Perl. - Support for the NetWare OS has now been fully added into - MRTG, beginning with MRTG release 2.12.2. + Support for the NetWare OS has now been fully added into MRTG, begin- + ning with MRTG release 2.12.2. - Liberallly minded operating systems support a commandline - length approaching 1000 characters. In such environments - it was an easy matter to pass the sometimes high number of - parameters used by MRTG's Rateup executable directly on - the commandline. Until NetWare 6.5, NetWare had a command- - line limit of 512 characters. This limitation was also - removed for NetWare 6.0 by Service Pack 5. For other Net- - Ware versions and earlier Service Packs, this limitation - remains. To permit a 'standard' interface for NetWare, the - Rateup executable has been modified to also read its - parameters from a file, and the MRTG script has been modi- - fied to support this method on a NetWare platform. (See - New Rateup Switch) - - A Rateup NLM is now available, along with the necessary - scripts to build it if required. See the NetWare Support - section of this document for further details. Addition- - ally, mrtg.pl has been revised because of the unique (to - NetWare) name of executables (NLM). - - The absence of a specific installation procedure has - caused MRTG to fail in the past because the Perl script - could not find or load the Rateup executable. The instal- - lation method supplied here will solve this problem for - now. - - The MRTG.pl script in the 2.12.2 (or later) version of - MRTG has been configured to suit all likely versions of - NetWare able to use Perl5, and bypasses all of the known - problems with NetWare Perl running MRTG. + Liberallly minded operating systems support a commandline length + approaching 1000 characters. In such environments it was an easy matter + to pass the sometimes high number of parameters used by MRTG's Rateup + executable directly on the commandline. Until NetWare 6.5, NetWare had + a commandline limit of 512 characters. This limitation was also removed + for NetWare 6.0 by Service Pack 5. For other NetWare versions and ear- + lier Service Packs, this limitation remains. To permit a 'standard' + interface for NetWare, the Rateup executable has been modified to also + read its parameters from a file, and the MRTG script has been modified + to support this method on a NetWare platform. (See New Rateup Switch) + + A Rateup NLM is now available, along with the necessary scripts to + build it if required. See the NetWare Support section of this document + for further details. Additionally, mrtg.pl has been revised because of + the unique (to NetWare) name of executables (NLM). + + The absence of a specific installation procedure has caused MRTG to + fail in the past because the Perl script could not find or load the + Rateup executable. The installation method supplied here will solve + this problem for now. + + The MRTG.pl script in the 2.12.2 (or later) version of MRTG has been + configured to suit all likely versions of NetWare able to use Perl5, + and bypasses all of the known problems with NetWare Perl running MRTG. PPRREERREEQQUUIISSIITTEESS You will need the following: - +o Perl 5.8.0 for NetWare with latest Perl Updates - (February, 2005 or later; previous versions MAY work) + +o Perl 5.8.0 for NetWare with latest Perl Updates (February, 2005 or + later; previous versions MAY work) - +o NetWare 5.1 w/ SP8, NetWare 6.0 w/ SP5 or NetWare 6.5 - w/ SP2. + +o NetWare 5.1 w/ SP8, NetWare 6.0 w/ SP5 or NetWare 6.5 w/ SP2. - +o A copy of the MRTG Package (v2.12.2 at time of writ- - ting) + +o A copy of the MRTG Package (v2.12.2 at time of writting) - +o Three .ncf files to execute the Perl scripts at the - NetWare server console. + +o Three .ncf files to execute the Perl scripts at the NetWare server + console. +o A copy of the Rateup NLM (Pre-built or compiled) - +o Optionally, any NetWare supported Web Server - (Netscape, Apache 1.3 or 2.0) + +o Optionally, any NetWare supported Web Server (Netscape, Apache 1.3 + or 2.0) - For copies of the .ncf files and Rateup NLM, see NetWare - Support in this document. + For copies of the .ncf files and Rateup NLM, see NetWare Support in + this document. IINNSSTTAALLLLIINNGG MMRRTTGG - 1. Install the latest Perl 5.8.x release on your server. - See the Perl documentation for details. + 1. Install the latest Perl 5.8.x release on your server. See the Perl + documentation for details. 2. Create the following directories: @@ -100,67 +91,62 @@ 3. Copy from the MRTG package the following files: - \bin\* to SYS:/Mrtg/bin All files. See Note 1. + \bin\* to SYS:/Mrtg/bin All files. See Note 1. - Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. - The rateup.exe will NOT be needed on the NetWare server. + Note 1: Add a .pl extension to the mrtg, cfgmaker and indexmaker files. + The rateup.exe will NOT be needed on the NetWare server. - \contrib\* to SYS:/Mrtg/contrib/ Include sub-directories - \doc\* to SYS:/Mrtg/doc/ All files - \images\* to SYS:/Mrtg/html/images/ All files - \translate\* to SYS:/Mrtg/translate/ All files. See Note 2. + \contrib\* to SYS:/Mrtg/contrib/ Include sub-directories + \doc\* to SYS:/Mrtg/doc/ All files + \images\* to SYS:/Mrtg/html/images/ All files + \translate\* to SYS:/Mrtg/translate/ All files. See Note 2. - Note 2: For English-only language support, all \translate files EXCEPT Locales_mrtg may be deleted. + Note 2: For English-only language support, all \translate files EXCEPT Locales_mrtg may be deleted. - \lib\* to SYS:/Mrtg/lib Include sub-directories. See Note 3. + \lib\* to SYS:/Mrtg/lib Include sub-directories. See Note 3. - Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. + Note 3: This will create the SYS:/Mrtg/lib/mrtg2 and ./pod directories. - 4. Create copies of the three .ncf files and install - them: + 4. Create copies of the three .ncf files and install them: - *.ncf to SYS:/Mrtg/bin + *.ncf to SYS:/Mrtg/bin - See NetWare Support in this document for details on - how to create copies of these files. + See NetWare Support in this document for details on how to create + copies of these files. - 5. See Compiling Rateup.nlm"> in this document for - details on compiling the Rateup NLM yourself if - desired. A prebuit verion is available in the - .\mrtg\bin directory where it must remain. + 5. See Compiling Rateup.nlm"> in this document for details on compil- + ing the Rateup NLM yourself if desired. A prebuit verion is avail- + able in the .\mrtg\bin directory where it must remain. CCOONNFFIIGGUURRIINNGG MMRRTTGG - +o Refer to Novell documentation on configuring and load- - ing SNMP support on your server if this is the device - to be monitored. + +o Refer to Novell documentation on configuring and loading SNMP sup- + port on your server if this is the device to be monitored. +o Edit sys:/mrtg/bin/MakeMrtgCfg.ncf: - - replace ccccc with the GET community name for the SNMP device (typically 'public'), - - replace ddddd with the DNS name or IP address of the device to be monitored. - - e.g public@www.myserver.com, public@10.202.65.180 + - replace ccccc with the GET community name for the SNMP device (typically 'public'), + - replace ddddd with the DNS name or IP address of the device to be monitored. + e.g public@www.myserver.com, public@10.202.65.180 - Note 1: These are NOT mail addresses, they just look like one! - Note 2: If multiple devices are to be monitored, add their entries to the same line: + Note 1: These are NOT mail addresses, they just look like one! + Note 2: If multiple devices are to be monitored, add their entries to the same line: - e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg + e.g perl cfgmaker.pl public@www.myserver.com public@10.202.65.180 > sys:/mrtg/bin/mrtg.cfg - In this "Getting Started", it is 'suggested' to only - monitor a single device. + In this "Getting Started", it is 'suggested' to only monitor a sin- + gle device. +o At the server console, run: - sys:/mrtg/bin/MakeMrtgCfg.ncf + sys:/mrtg/bin/MakeMrtgCfg.ncf This will create Mrtg.cfg in sys:/mrtg/bin. - +o Edit the Mrtg.cfg configuration file created in the - previous step. Note the following: + +o Edit the Mrtg.cfg configuration file created in the previous step. + Note the following: - It was found, when testing MRTG on a NetWare 6.5 - server using a NIC Interface, that mrtg.cfg contained - the following message: + It was found, when testing MRTG on a NetWare 6.5 server using a NIC + Interface, that mrtg.cfg contained the following message: ### Interface 1 >> Descr: 'Intel(R)-8255x-based-Network-Connection'... ### The following interface is commented out because: @@ -168,15 +154,14 @@ # ... - If this occurs, edit MakeMrtgCfg.ncf and add the fol- - lowing parameter as shown: + If this occurs, edit MakeMrtgCfg.ncf and add the following parame- + ter as shown: perl sys:\mrtg\bin\cfgmaker.pl --zero-speed=nnn public@10.202.65.180 > sys:\mrtg\bin\Mrtg.cfg - where nnnnnn is the interface speed in bits per second. - For a 100 Megabit LAN NIC, nnn = 10000000. It will be - necessary to re-execute the MakeMrtgCfg.ncf script - before continuing with this section. + where nnnnnn is the interface speed in bits per second. For a 100 + Megabit LAN NIC, nnn = 10000000. It will be necessary to re-execute + the MakeMrtgCfg.ncf script before continuing with this section. Below line 16 (*** Global Defaults), add: @@ -186,66 +171,61 @@ IconDir: e.g IconDir: ./images Note 1 - The HtmlDir entry specifies where MRTG will create - its HTML pages. + The HtmlDir entry specifies where MRTG will create its HTML + pages. Note 2 - The ImageDir entry specifies where the created - graphic icons are placed. + The ImageDir entry specifies where the created graphic icons + are placed. Note 3 - The IconDir entry specifies where the supplied - MRTG icons are located. It MUST be a relative - path from HtmlDir or absolute URL. The value shown - is recommended. + The IconDir entry specifies where the supplied MRTG icons are + located. It MUST be a relative path from HtmlDir or absolute + URL. The value shown is recommended. +o At the server console run: sys:/mrtg/bin/RunMrtg.ncf - several times. By the third time it should run without - showing error messages on the console screen. This - should create: + several times. By the third time it should run without showing + error messages on the console screen. This should create: - +o A HTML page in the (HtmlDir) directory for each - monitored device, + +o A HTML page in the (HtmlDir) directory for each monitored + device, - +o A .dat file in the (ImageDir) directory for each - monitored device, + +o A .dat file in the (ImageDir) directory for each monitored + device, +o Several .png icons in the (ImageDir) directory, +o Some log file entries in the (LogDir) directory. - Note: If you experience a "Use of uninitialised value - in split" error, it will be necessary to create a - 'Path' environment variable at the server console; use - the following example + Note: If you experience a "Use of uninitialised value in split" + error, it will be necessary to create a 'Path' environment variable + at the server console; use the following example env path="SYS:\" (The actual value is immaterial, as long as the var itself exists.) - +o Edit sys:/mrtg/bin/MakeMrtgIndex.ncf. Change the indi- - cated shown in the following example to match - the value entered for (HtmlDir). + +o Edit sys:/mrtg/bin/MakeMrtgIndex.ncf. Change the indicated + shown in the following example to match the value entered for + (HtmlDir). perl --noscreen sys:/mrtg/bin/indexmaker.pl sys:/mrtg/bin/Mrtg.cfg > /index.html - +o Create an index.html page linking the seperate device - HTML page(s). At the server console, run: + +o Create an index.html page linking the seperate device HTML page(s). + At the server console, run: sys:/mrtg/bin/MakeMrtgIndex.ncf - This will create index.html in the (HtmlDir) direc- - tory. + This will create index.html in the (HtmlDir) directory. - +o Optionally, configure a Web Server to permit access to - the directory specified in (HtmlDir) to view the MRTG - graphs remotely, at, for example: + +o Optionally, configure a Web Server to permit access to the direc- + tory specified in (HtmlDir) to view the MRTG graphs remotely, at, + for example: http://ip_or_dns/mrtg/index.html - A sample configuration for an Apache Webserver is - shown: + A sample configuration for an Apache Webserver is shown: Alias /mrtg/ "SYS:/mrtg/html/" @@ -254,17 +234,16 @@ Allow from all - +o Set the property of the directory pointed to by - (ImageDir), to 'Purge Immediate'. + +o Set the property of the directory pointed to by (ImageDir), to + 'Purge Immediate'. - +o Finally, read the MRTG documentation for much more - detailed configuration/usage information. + +o Finally, read the MRTG documentation for much more detailed config- + uration/usage information. Welcome to MRTG!! MMAAKKEE MMRRTTGG RRUUNN AALLLL TTHHEE TTIIMMEE - MRTG can be made to run periodically by at least two - means: + MRTG can be made to run periodically by at least two means: +o Using CRON Scheduling @@ -272,38 +251,35 @@ CCRROONN SScchheedduulliinngg - To use CRON scheduling, create a CRON Scheduler entry to - execute the RunMrtg.ncf file on a frequency appropriate - for the server environment and information desired. The - following entry in the sys:\etc\crontab file will execute - MRTG every five minutes: + To use CRON scheduling, create a CRON Scheduler entry to execute the + RunMrtg.ncf file on a frequency appropriate for the server environment + and information desired. The following entry in the sys:\etc\crontab + file will execute MRTG every five minutes: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * sys:\mrtg\bin\runmrtg.ncf - The CRON Scheduler (cron.nlm) can be started automatically - by adding it in AUTOEXEC.ncf or, manually loading it at - the server console. + The CRON Scheduler (cron.nlm) can be started automatically by adding it + in AUTOEXEC.ncf or, manually loading it at the server console. MMRRTTGG iinn DDaaeemmoonn MMooddee - Refer to the MRTG-Reference document for information about - the 'RunAsDaemon' option. Its use is outside the scope of - this document. + Refer to the MRTG-Reference document for information about the 'RunAs- + Daemon' option. Its use is outside the scope of this document. TTRROOUUBBLLEESSHHOOOOTTIINNGG - Read the MRTG documents, Perl documents or, finally, sub- - mit questions to the MRTG User forums. + Read the MRTG documents, Perl documents or, finally, submit questions + to the MRTG User forums. - For NetWare specific issues, submit questions to the Perl - forum at news://developer-forums.novell.com/novell.dev- - sup.perl (Novell Developer Forums). + For NetWare specific issues, submit questions to the Perl forum at + news://developer-forums.novell.com/novell.devsup.perl (Novell Developer + Forums). CCOOMMPPIILLIINNGG RRAATTEEUUPP..NNLLMM - In addition to the rateup.c and Makefile.Netware supplied - with the MRTG release, you will also need: + In addition to the rateup.c and Makefile.Netware supplied with the MRTG + release, you will also need: - +o Metrowerks CodeWarrior with NetWare Support OR GCC - Compiler (v3.0.3 or later) with NlmConv Utility + +o Metrowerks CodeWarrior with NetWare Support OR GCC Compiler (v3.0.3 + or later) with NlmConv Utility +o Novell LibC NDK (February 2004 or later) @@ -322,50 +298,44 @@ GD Graphics Library. (See http://www.boutell.com/gd/ ) - PNG Graphics Library. (See http://libpng.source- - forge.net/ ) + PNG Graphics Library. (See http://libpng.sourceforge.net/ ) - zLib Compression Library. (See http://www.gzip.org/zlib/ - ) + zLib Compression Library. (See http://www.gzip.org/zlib/ ) - Edit the Makefile.Netware file as required to match your - installation paths; search the file for the key word - 'Edit'. + Edit the Makefile.Netware file as required to match your installation + paths; search the file for the key word 'Edit'. NNEETTWWAARREE SSUUPPPPOORRTT - For copies of the NCF and get_ver.awk scripts, see - Appendix. + For copies of the NCF and get_ver.awk scripts, see Appendix. - For NetWare specific issues, submit questions to the Perl - forum at news://developer-forums.novell.com/novell.dev- - sup.perl (Novell Developer Forums). - - To move the MRTG application to a volume other than SYS: - you will need to edit the NCF scripts provided plus the - MRTG[.pl] script itself in two places. + For NetWare specific issues, submit questions to the Perl forum at + news://developer-forums.novell.com/novell.devsup.perl (Novell Developer + Forums). + + To move the MRTG application to a volume other than SYS: you will need + to edit the NCF scripts provided plus the MRTG[.pl] script itself in + two places. NNEEWW RRAATTEEUUPP SSWWIITTCCHH - The MRTG[.pl] script, when used on a NetWare platform, - uses Rateup[.nlm] with the new commandline switch: + The MRTG[.pl] script, when used on a NetWare platform, uses + Rateup[.nlm] with the new commandline switch: RATEUP -f filename - where the filename parameter can include a leading path - element. + where the filename parameter can include a leading path element. - The file format is exactly the same as that used on the - commandline by other operating systems, including the - leading path and name of the Rateup NLM. + The file format is exactly the same as that used on the commandline by + other operating systems, including the leading path and name of the + Rateup NLM. AAPPPPEENNDDIIXX The Appendix includes 'copies' of the following files: +o The NCF files used during MRTG configuration, - To create copies of these files, simply 'cut and paste' - into your favourite 'tteexxtt eeddiittoorr' and save under their - respective names. You should remove the leading space from - each line. + To create copies of these files, simply 'cut and paste' into your + favourite 'tteexxtt eeddiittoorr' and save under their respective names. You + should remove the leading space from each line. _M_a_k_e_M_r_t_g_C_f_g_._N_C_F @@ -424,12 +394,12 @@ GNU General Public License CCRREEDDIITTSS - The MRTG for NetWare exists largely through the efforts of - Guenter Knauf and feedback from beta testers. + The MRTG for NetWare exists largely through the efforts of Guenter + Knauf and feedback from beta testers. AAUUTTHHOORR Norm W.. -2.14.7 2006-09-06 MRTG-NW-GUIDE(1) +2.16.1 2008-02-17 MRTG-NW-GUIDE(1) diff -Nru mrtg-2.14.7/doc/mrtg-reference.1 mrtg-2.16.1/doc/mrtg-reference.1 --- mrtg-2.14.7/doc/mrtg-reference.1 2006-09-06 14:42:53.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-reference.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,15 +129,15 @@ .\" ======================================================================== .\" .IX Title "MRTG-REFERENCE 1" -.TH MRTG-REFERENCE 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-REFERENCE 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" -mrtg\-reference \- MRTG 2.14.7 configuration reference +mrtg\-reference \- MRTG 2.16.1 configuration reference .SH "OVERVIEW" .IX Header "OVERVIEW" -The runtime behaviour of \s-1MRTG\s0 is governed by a configuration file. Run\-of\- -ther-mill configuration files can be generated with \fBcfgmaker\fR. (Check -cfgmaker). But for more elaborate configurations some hand-tuning is -required. +The runtime behaviour of \s-1MRTG\s0 is governed by a configuration file. +Run-of-the-mill configuration files can be generated with \fBcfgmaker\fR. +(Check cfgmaker). But for more elaborate configurations some hand-tuning +is required. .PP This document describes all the configuration options understood by the mrtg software. @@ -161,7 +161,7 @@ Example: .Sp .Vb 1 -\& Include: base-options.inc +\& Include: base\-options.inc .Ve .Sp If included files are specified with relative paths, both the current @@ -233,9 +233,9 @@ .Sh "EnableIPv6" .IX Subsection "EnableIPv6" When set to yes, IPv6 support is enabled if the required libraries are -present (see the mrtg\-ipv6 manpage). When IPv6 is enabled, mrtg can talk to routers -using \s-1SNMP\s0 over IPv6 and targets may be specified by their numeric IPv6 -addresses as well as by hostname or IPv4 address. +present (see the mrtg\-ipv6 manpage). When IPv6 is enabled, mrtg can talk +to routers using \s-1SNMP\s0 over IPv6 and targets may be specified by their +numeric IPv6 addresses as well as by hostname or IPv4 address. .PP If IPv6 is enabled and the target is a hostname, mrtg will try to resolve the hostname to an IPv6 address and, if this fails, to an IPv4 address. @@ -301,11 +301,17 @@ .Ve .PP Note that unless you are using rrdtool you can not set Interval to less -than 5 minutes. If you are using rrdtool you can set interval down to 1 -minute. Note though, setting the Interval for an rrdtool/mrtg setup will -influence the initial creation of the database. If you change the interval -later, all existing databases will remain at the resolution they were -initially created with. +than 5 minutes. If you are using rrdtool you can set interval in the format +.PP +.Vb 1 +\& Interval: MM[:SS] +.Ve +.PP +Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg +setup will influence the initial creation of the database. If you change the +interval later, all existing databases will remain at the resolution they +were initially created with. Also note that you must make sure that your +mrtg-rrd Web-frontend can deal with this kind of Interval setting. .Sh "MaxAge" .IX Subsection "MaxAge" \&\s-1MRTG\s0 relies heavily on the real time clock of your computer. If the time is @@ -322,7 +328,8 @@ \& MaxAge: 7200 .Ve .PP -The example above will make mrtg refuse to update log files older than 2 hours (7200 seconds). +The example above will make mrtg refuse to update log files older than 2 +hours (7200 seconds). .Sh "WriteExpires" .IX Subsection "WriteExpires" With this switch mrtg will generate .meta files for \s-1CERN\s0 @@ -525,12 +532,12 @@ as each new process runs forever. Instead \s-1MRTG\s0 should be started from the command prompt or by a system startup script. .PP -If you want mrtg to run under a particular user and group (it is not recomended to run -\&\s-1MRTG\s0 as root) then you can use the \fB\-\-user=\fR\fIuser_name\fR and \fB\-\-group=\fR\fIgroup_name\fR -options on the mrtg commandline. +If you want mrtg to run under a particular user and group (it is not +recomended to run \s-1MRTG\s0 as root) then you can use the \fB\-\-user=\fR\fIuser_name\fR +and \fB\-\-group=\fR\fIgroup_name\fR options on the mrtg commandline. .PP .Vb 1 -\& mrtg --user=mrtg_user --group=mrtg_group mrtg.cfg +\& mrtg \-\-user=mrtg_user \-\-group=mrtg_group mrtg.cfg .Ve .PP Also note that in daemon mode restarting the process is required in order to @@ -636,7 +643,7 @@ Example: .Sp .Vb 1 -\& Target[myrouter]: 2:public@wellfleet-fddi.domain +\& Target[myrouter]: 2:public@wellfleet\-fddi.domain .Ve .Sp If your community contains a \*(L"@\*(R" or a \*(L" \*(R" these characters @@ -673,6 +680,18 @@ Example: Target[myrouter]: 2:router1:::::3 SnmpOptions[myrouter]: username=>'user1' +.IP "noHC" 4 +.IX Item "noHC" +Not all routers that support SNMPv2 or SNMPv3 provide the ifHC* counters +on every interface. The noHC[] per-target keyword signals that the +low-speed counters ifInOctets and ifOutOctets should be queried instead. +cfgmaker will automatically insert this tag if SNMPv2 or SNMPv3 is specified +but the ifHC* counters are unavailable. +.Sp +Example: + Target[myrouter]: #Bri0:router1:::::3 + SnmpOptions[myrouter]: username=>'user1' + noHC[myrouter]: yes .IP "Reversing" 4 .IX Item "Reversing" Sometimes you are sitting on the wrong side of the @@ -684,7 +703,7 @@ Example: .Sp .Vb 1 -\& Target[ezci]: -1:public@ezci-ether.domain +\& Target[ezci]: \-1:public@ezci\-ether.domain .Ve .IP "Explicit OIDs" 4 .IX Item "Explicit OIDs" @@ -728,6 +747,32 @@ .Vb 1 \& Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter .Ve +.IP "SnmpGetNext" 4 +.IX Item "SnmpGetNext" +A special case of an snmp object that is only reachable by 'walking' occurs +when a single snmpgetnext will return the correct value, but snmpwalk fails. +This may occur with snmp V2 or V3, as the snmpgetbulk method is used in these +versions. You can get mrtg to use getnext instead of getbulk by prepending the +\&\s-1OID\s0 with the string \fBGeTNEXT\fR. +.Sp +Example: +.Sp +.Vb 1 +\& Target[myrouter]: GeTNEXTstrangeOid&GeTNEXTstrangeOid:public@myrouter +.Ve +.IP "Counted \s-1SNMP\s0 Walk" 4 +.IX Item "Counted SNMP Walk" +In other situations, an snmpwalk is needed to count rows, but the actual data +is uninteresting. For example, counting the number of mac-addresses in a \s-1CAM\s0 +table, or the number of simultaneous dialup sessions. You can get \s-1MRTG\s0 to count +the number of instances by prepending the \s-1OID\s0 with the string \fBCnTWaLK\fR. The +following will retrieve the number of simultaneous \s-1VOIP\s0 calls on some routers: +.Sp +Example: +.Sp +.Vb 1 +\& Target[myrouter]: CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3&CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3:public@myrouter +.Ve .IP "Interface by \s-1IP\s0" 4 .IX Item "Interface by IP" Sometimes \s-1SNMP\s0 interface index can change, like when new interfaces are @@ -747,10 +792,9 @@ .Sp Example: .Sp -.Vb 4 -\& Target[myrouter]: /1.2.3.4:public@wellfleet-fddi.domain -\& Target[ezci]: -/1.2.3.4:public@ezci-ether.domain -\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14/1.2.3.4&1.3.6.1.2.1.2.2.1.14/1.2.3.4:public@myrouter +.Vb 3 +\& Target[myrouter]: /1.2.3.4:public@wellfleet\-fddi.domain +\& Target[ezci]: \-/1.2.3.4:public@ezci\-ether.domain \& Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter .Ve .IP "Interface by Description" 4 @@ -764,11 +808,10 @@ .Sp Example: .Sp -.Vb 4 -\& Target[myrouter]: \eMy-Interface2:public@wellfleet-fddi.domain -\& Target[ezci]: -\eMy-Interface2:public@ezci-ether.domain -\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14\eMy-Interface2&1.3.6.1.2.1.2.2.1.14\eMy-Interface3:public@myrouter -\& Target[myrouter]: ifInErrors\eMy-Interface2&ifOutErrors\eMy-Interface3:public@myrouter +.Vb 3 +\& Target[myrouter]: \eMy\-Interface2:public@wellfleet\-fddi.domain +\& Target[ezci]: \-\eMy\-Interface2:public@ezci\-ether.domain +\& Target[myrouter]: ifInErrors\eMy\-If2&ifOutErrors\eMy\-If3:public@myrouter .Ve .Sp If your description contains a \*(L"&\*(R", a \*(L":\*(R", a \*(L"@\*(R" or a \*(L" \*(R" you can include @@ -786,15 +829,14 @@ .Sp Example: .Sp -.Vb 4 -\& Target[myrouter]: #2/11:public@wellfleet-fddi.domain -\& Target[ezci]: -#2/11:public@ezci-ether.domain -\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14#3/7&1.3.6.1.2.1.2.2.1.14#3/7:public@myrouter +.Vb 3 +\& Target[myrouter]: #2/11:public@wellfleet\-fddi.domain +\& Target[ezci]: \-#2/11:public@ezci\-ether.domain \& Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter .Ve .Sp -If your description contains a \*(L"&\*(R", a \*(L":\*(R", a \*(L"@\*(R" or a \*(L" \*(R" you can include them but you must escape with -a backlash: +If your description contains a \*(L"&\*(R", a \*(L":\*(R", a \*(L"@\*(R" or a \*(L" \*(R" you can include +them but you must escape with a backlash: .Sp .Vb 1 \& Target[myrouter]: #\e:\e fun:public@hello.router @@ -822,12 +864,16 @@ .Sp Example: .Sp -.Vb 4 -\& Target[myrouter]: !0a-0b-0c-0d:public@wellfleet-fddi.domain -\& Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.domain -\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51&!0a-00-10-23-44-51:public@myrouter -\& Target[myrouter]: ifInErrors!0a-00-10-23-44-51&ifOutErrors!0a-00-10-23-44-51:public@myrouter +.Vb 6 +\& Target[myrouter]: !0a\-0b\-0c\-0d:public@wellfleet\-fddi.domain +\& Target[ezci]: \-!0\-f\-bb\-05\-71\-22:public@ezci\-ether.domain +\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a\-00\-10\-23\-44\-51& *BREAK* +\& 1.3.6.1.2.1.2.2.1.14!0a\-00\-10\-23\-44\-51:public@myrouter +\& Target[myrouter]: ifInErrors!0a\-00\-10\-23\-44\-51& *BREAK* +\& ifOutErrors!0a\-00\-10\-23\-44\-51:public@myrouter .Ve +.Sp +Join the lines at *BREAK* ... .IP "Interface by Type" 4 .IX Item "Interface by Type" It seems that there are devices that try to defy all monitoring efforts: the interesting interfaces have @@ -840,12 +886,26 @@ .Sp Example: .Sp -.Vb 4 -\& Target[myrouter]: %13:public@wellfleet-fddi.domain -\& Target[ezci]: -%13:public@ezci-ether.domain -\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14%13&1.3.6.1.2.1.2.2.1.14%14:public@myrouter +.Vb 3 +\& Target[myrouter]: %13:public@wellfleet\-fddi.domain +\& Target[ezci]: \-%13:public@ezci\-ether.domain \& Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter .Ve +.IP "Extended positioning of ifIndex" 4 +.IX Item "Extended positioning of ifIndex" +There are OIDs that contain the interface index at some inner position within +the \s-1OID\s0. To use the above mentioned Interface by IP/Description/Name/Type methods +in the target definition the keyword 'IndexPOS' can be used to indicate the +position of ifIndex. If 'IndexPOS' is not used the ifIndex will be appended at the +end of the \s-1OID\s0. +.Sp +Example: +.Sp +.Vb 1 +\& Target[myrouter]: OID.IndexPOS.1/1.2.3.4&OID.IndexPOS.1/1.2.3.4:public@myrouter +.Ve +.Sp +Replace \s-1OID\s0 by your numeric \s-1OID\s0. .IP "Extended Host Name Syntax" 4 .IX Item "Extended Host Name Syntax" In all places where ``community@router'' is accepted, you can add @@ -863,6 +923,31 @@ .IP "port" 4 .IX Item "port" the \s-1UDP\s0 port under which to contact the \s-1SNMP\s0 agent (default: 161) +.Sp +The complete syntax of the port parameter is +.Sp +.Vb 1 +\& remote_port[!local_address[!local_port]] +.Ve +.Sp +Some machines have additional security features that only allow \s-1SNMP\s0 queries +to come from certain \s-1IP\s0 addresses. If the host doing the query has multiple +interface, it may be necessary to specify the interface the query should +come from. +.Sp +The port parameter allows the specification of the port of the machine being +queried. In addition, the \s-1IP\s0 address (or hostname) and port of the machine +doing the query may be specified. +.Sp +Examples: +.Sp +.Vb 5 +\& somehost +\& somehost:161 +\& somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source +\& somehost:!192.168.2.4 use 192.168.2.4 as source +\& somehost:!!4000 use port 4000 as source +.Ve .IP "timeout" 4 .IX Item "timeout" initial timeout for \s-1SNMP\s0 queries, in seconds (default: 2.0) @@ -912,7 +997,7 @@ Example: .Sp .Vb 1 -\& Target[ezci]: 1:public@ezci-ether.domain:9161::4 +\& Target[ezci]: 1:public@ezci\-ether.domain:9161::4 .Ve .Sp This would refer to the input/output octet counters for the interface @@ -990,8 +1075,8 @@ .Ve .Sp .Vb 2 -\& Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice / -\& 1.3.6.1.4.1.999.3&1.3.6.1.4.1.999.4:public@mydevice * 100 +\& Target[myrouter]: .1.3.6.1.4.1.999.1&.1.3.6.1.4.1.999.2:public@mydevice / +\& .1.3.6.1.4.1.999.3&.1.3.6.1.4.1.999.4:public@mydevice * 100 .Ve .Sp Note that whitespace must surround each target definition in the expression. @@ -1093,12 +1178,19 @@ name should be displayed you have to specify its community and address again with the \fIRouterUptime\fR keyword. .PP +If you want to use a special \s-1OID\s0 for queriing the router uptime, +use prepend the oid. +.PP Example: .PP .Vb 2 \& Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250 \& RouterUptime[kacisco.comp.edu]: public@194.64.66.250 .Ve +.PP +.Vb 1 +\& RouterUptime[kacisco.comp.edu]: hrSystemUptime.0:public@194.64.66.250 +.Ve .Sh "RouterName" .IX Subsection "RouterName" If the default name of the router is incorrect/uninformative, @@ -1272,13 +1364,12 @@ .Ve .Sh "AbsMax" .IX Subsection "AbsMax" -If you are monitoring a link which can handle more traffic -than the \fIMaxBytes\fR value. Eg, a line which uses compression -or some frame relay link, you can use the \fIAbsMax\fR keyword -to give the absolute maximum value ever to be reached. -We need to know this in order to sort out unrealistic values -returned by the routers. If you do not set \fIAbsMax\fR, rateup -will ignore values higher than \fIMaxBytes\fR. +If you are monitoring a link which can handle more traffic than the +\&\fIMaxBytes\fR value. Eg, a line which uses compression or some frame relay +link, you can use the \fIAbsMax\fR keyword to give the absolute maximum value +ever to be reached. We need to know this in order to sort out unrealistic +values returned by the routers. If you do not set \fIAbsMax\fR, rateup will +ignore values higher than \fIMaxBytes\fR. .PP Example: .PP @@ -1287,16 +1378,13 @@ .Ve .Sh "Unscaled" .IX Subsection "Unscaled" -By default each graph is scaled vertically to make the -actual data visible even when it is much lower than -\&\fIMaxBytes\fR. With the \fIUnscaled\fR variable you can suppress -this. It's argument is a string, containing one letter -for each graph you don't want to be scaled: d=day w=week -m=month y=year. There is also a special case to unset the -variable completely: n=none. This could be useful in the -event you need to override a global configuration. In the -example scaling for the yearly and the monthly graph are -suppressed. +By default each graph is scaled vertically to make the actual data visible +even when it is much lower than \fIMaxBytes\fR. With the \fIUnscaled\fR variable +you can suppress this. It's argument is a string, containing one letter for +each graph you don't want to be scaled: d=day w=week m=month y=year. There +is also a special case to unset the variable completely: n=none. This could +be useful in the event you need to override a global configuration. In the +example scaling for the yearly and the monthly graph are suppressed. .PP Example: .PP @@ -1370,7 +1458,8 @@ If the \fIDirectory\fR option is specified, the \fIClonedirectory\fR option will copy all the contents of \fIDirectory\fR to the \fIClonedirectory\fR. .PP -As well as the \fIDirectory\fR option requires, the clone directory must already exist; mrtg will not create it. +As well as the \fIDirectory\fR option requires, the clone directory must +already exist; mrtg will not create it. .PP Example: .PP @@ -1380,7 +1469,8 @@ \& Clonedirectory[myrouter]: myclonedirectory .Ve .PP -\&\s-1NOTE:\s0 the Clonedirectory option must always be 'relative' or bad things will happen. +\&\s-1NOTE:\s0 the Clonedirectory option must always be 'relative' or bad things will +happen. .Sh "XSize and YSize" .IX Subsection "XSize and YSize" By default mrtgs graphs are 100 by 400 pixels wide (plus @@ -1465,7 +1555,7 @@ Example: .PP .Vb 1 -\& PNGTitle[myrouter]: WAN Link UK-US +\& PNGTitle[myrouter]: WAN Link UK\-US .Ve .Sh "Options" .IX Subsection "Options" @@ -1798,6 +1888,21 @@ .Vb 1 \& RRDRowCount[myrouter]: 1600 .Ve +.Sh "RRDHWRRAs" +.IX Subsection "RRDHWRRAs" +Normally the RRDs created by \s-1MRTG\s0 will just contain the information gathered +directly from the respective target. With this option you can tap into +rrdtools advanced aberrant behaviour detection module based on Holt-Winters +forecasting. The RRDHWRRAs property specifies the Holt-Winters RRAs as +described in the rrdcreate manual page. +.PP +Note, this setting will only affect newly created RRDs (targets). +.PP +Example: +.PP +.Vb 1 +\& RRDHWRRAs[myrouter]: RRA:HWPREDICT:1440:0.1:0.0035:288 +.Ve .Sh "TimeStrPos" .IX Subsection "TimeStrPos" This defines placement of the timestamp string on the image. Possible @@ -1840,16 +1945,52 @@ .Vb 1 \& ThreshDir: /var/mrtg/thresh .Ve +.Sh "ThreshHyst (\s-1GLOBAL\s0)" +.IX Subsection "ThreshHyst (GLOBAL)" +If a threshold is broken, and you have a threshdir defined, then mrtg will +send mail once the threshold becomes 'unborken' to avoid situations where +broken and un-broken messages get sent in close succession, we only send an +unbroken message once the curent value is 0.1 (10%) away from the threshold. +using the ThreshHyst config variable you can customize this value. +.PP +Example for 5%: +.PP +.Vb 1 +\& ThreshHyst: 0.05 +.Ve +.Sh "ThreshMailServer (\s-1GLOBAL\s0)" +.IX Subsection "ThreshMailServer (GLOBAL)" +Adderss of an \s-1SMTP\s0 server which is going to accept mail about Thresholds being broken and unbroken. +.Sh "ThreshMailSender (\s-1GLOBAL\s0)" +.IX Subsection "ThreshMailSender (GLOBAL)" +What is the sender address of the threshold mail. +.PP +Example: +.PP +.Vb 1 +\& ThreshMailSender: mrtg@example.com +.Ve +.Sh "ThreshMailAddress (\s-1PER\s0 \s-1TARGET\s0)" +.IX Subsection "ThreshMailAddress (PER TARGET)" +Email address for Threshold related Mails. This will only work if a mailserver has been configured. +.PP +Example: +.PP +.Vb 2 +\& ThreshMailAddress[_]: admin@example.com +\& ThreshMailAddress[router]: +.Ve +.PP +This would bring threshold releaed mail to all but the target called 'router'. .Sh "ThreshMinI (\s-1PER\s0 \s-1TARGET\s0)" .IX Subsection "ThreshMinI (PER TARGET)" This is the minimum acceptable value for the Input (first) parameter. If the parameter falls below this value, the program specified in ThreshProgI -will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes. +will be run and a mail will be sent to the ThreshMailAddress if specified. +If the value ends in '%' then the threshold is defined relative to MaxBytes. .Sh "ThreshMaxI (\s-1PER\s0 \s-1TARGET\s0)" .IX Subsection "ThreshMaxI (PER TARGET)" -This is the maximum acceptable value for the Input (first) parameter. If -the parameter falls above this value, the program specified in ThreshProgI -will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes. +Works the same as TheshMinI but it acts when the value is higher than ThreshMaxI. .Sh "ThreshDesc (\s-1PER\s0 \s-1TARGET\s0)" .IX Subsection "ThreshDesc (PER TARGET)" Its value will be assigned to the environment variable \s-1THRESH_DESC\s0 before @@ -1870,9 +2011,6 @@ .IX Subsection "ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO" These work the same as their *I counterparts, except on the Output (second) parameter. -.PP -\&\fINote that you can use the SetEnv parameter explained above to pass -additional information to the threshold programs.\fR .Sh "SetEnv" .IX Subsection "SetEnv" When calling threshold scripts from within your cfg file you might want to @@ -1888,6 +2026,27 @@ \& SetEnv[myrouter]: EMAIL="contact_email@someplace.net" \& HOST="www.some_server.net" .Ve +.Sh "\s-1HW\s0 Failure Bassed Threshol Checking" +.IX Subsection "HW Failure Bassed Threshol Checking" +When using rrd based logging with \s-1HW\s0 RRAs defined. You can use the +confidence bounds violations stored in the \s-1FAILURES\s0 \s-1RRA\s0 for threshold based +alerts. +.PP +There the all target specific threshold variables have a Hold-Winters counterpart: +.PP +.Vb 3 +\& ThreshMailAddress \-> HWThreshMailAddress +\& ThreshMinI \-> HWThreshMinI +\& ... +.Ve +.PP +The global variables for threshold checking are shared except for the +.PP +.Vb 1 +\& ThreshHyst \-> HWThreshHyst +.Ve +.PP +And HWThreshDesc sets the \s-1HWTHRESH_DESC\s0 variable. .SH "PER TARGET DEFAULT VALUES" .IX Header "PER TARGET DEFAULT VALUES" .Sh "Pre\- and Postfix" @@ -1994,12 +2153,14 @@ appended with \f(CW\*(C`_l\*(C'\fR). .IP "\fB\-\-confcache\-file\fR \fIfilename\fR" 4 .IX Item "--confcache-file filename" -Use an alternate confcache-file (the default is to use the configuration-file appended with \f(CW\*(C`.ok\*(C'\fR) +Use an alternate confcache-file (the default is to use the +configuration-file appended with \f(CW\*(C`.ok\*(C'\fR) .IP "\fB\-\-logging\fR \fIfilename\fR|\fBeventlog\fR" 4 .IX Item "--logging filename|eventlog" -If this is set to writable filename, all output from mrtg (warnings, debug messages, errors) -will go to \fIfilename\fR. If you are running on Win32 you can specify \fBeventlog\fR instead of a filename -which will send all error to the windows event log. +If this is set to writable filename, all output from mrtg (warnings, debug +messages, errors) will go to \fIfilename\fR. If you are running on Win32 you +can specify \fBeventlog\fR instead of a filename which will send all error to +the windows event log. .Sp \&\fB\s-1NOTE:\s0\fR Note, there is no Message \s-1DLL\s0 for mrtg included with mrtg. This has the side effect that the windows event logger will display a nice message @@ -2023,31 +2184,34 @@ Define the name and path of the pid file for mrtg running as a daemon .IP "\fB\-\-debug=s\fR" 4 .IX Item "--debug=s" -Enable debug options. The argument of the debug option is a comma separated list of debug values: +Enable debug options. The argument of the debug option is a comma separated +list of debug values: .Sp -.Vb 10 -\& cfg - watch the config file reading -\& dir - directory mangeling -\& base - basic program flow -\& tarp - target parser -\& snpo - snmp polling -\& coca - confcache operations -\& fork - forking view -\& time - some timing info -\& log - logging of data via rateup or rrdtool -\& eval - print eval strings before evaluting them +.Vb 11 +\& cfg \- watch the config file reading +\& dir \- directory mangeling +\& base \- basic program flow +\& tarp \- target parser +\& snpo \- snmp polling +\& coca \- confcache operations +\& fork \- forking view +\& time \- some timing info +\& log \- logging of data via rateup or rrdtool +\& eval \- print eval strings before evaluting them +\& prof \- add hires timing info the rrd calls .Ve .Sp Example: .Sp .Vb 1 -\& --debug="cfg,snpo" +\& \-\-debug="cfg,snpo" .Ve .SH "EXIT CODES" .IX Header "EXIT CODES" -An exit code of 0 indicates that all targets were successful. Generally speaking, most codes greater -than 0 indicate that there was an unrecoverable problem. One exception to this is code 91, which -indicates that at least one of the targets was succesful. A partial listing of the codes follows: +An exit code of 0 indicates that all targets were successful. Generally +speaking, most codes greater than 0 indicate that there was an unrecoverable +problem. One exception to this is code 91, which indicates that at least +one of the targets was succesful. A partial listing of the codes follows: .PP .Vb 1 \& 0: All targets sucessful diff -Nru mrtg-2.14.7/doc/mrtg-reference.pod mrtg-2.16.1/doc/mrtg-reference.pod --- mrtg-2.14.7/doc/mrtg-reference.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-reference.pod 2008-02-17 10:27:36.000000000 +0000 @@ -1,13 +1,13 @@ =head1 NAME -mrtg-reference - MRTG 2.14.7 configuration reference +mrtg-reference - MRTG 2.16.1 configuration reference =head1 OVERVIEW -The runtime behaviour of MRTG is governed by a configuration file. Run-of- -ther-mill configuration files can be generated with B. (Check -L). But for more elaborate configurations some hand-tuning is -required. +The runtime behaviour of MRTG is governed by a configuration file. +Run-of-the-mill configuration files can be generated with B. +(Check L). But for more elaborate configurations some hand-tuning +is required. This document describes all the configuration options understood by the mrtg software. @@ -112,9 +112,9 @@ =head2 EnableIPv6 When set to yes, IPv6 support is enabled if the required libraries are -present (see the L manpage). When IPv6 is enabled, mrtg can talk to routers -using SNMP over IPv6 and targets may be specified by their numeric IPv6 -addresses as well as by hostname or IPv4 address. +present (see the L manpage). When IPv6 is enabled, mrtg can talk +to routers using SNMP over IPv6 and targets may be specified by their +numeric IPv6 addresses as well as by hostname or IPv4 address. If IPv6 is enabled and the target is a hostname, mrtg will try to resolve the hostname to an IPv6 address and, if this fails, to an IPv4 address. @@ -183,11 +183,15 @@ Interval: 10 Note that unless you are using rrdtool you can not set Interval to less -than 5 minutes. If you are using rrdtool you can set interval down to 1 -minute. Note though, setting the Interval for an rrdtool/mrtg setup will -influence the initial creation of the database. If you change the interval -later, all existing databases will remain at the resolution they were -initially created with. +than 5 minutes. If you are using rrdtool you can set interval in the format + + Interval: MM[:SS] + +Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg +setup will influence the initial creation of the database. If you change the +interval later, all existing databases will remain at the resolution they +were initially created with. Also note that you must make sure that your +mrtg-rrd Web-frontend can deal with this kind of Interval setting. =head2 MaxAge @@ -203,7 +207,8 @@ MaxAge: 7200 -The example above will make mrtg refuse to update log files older than 2 hours (7200 seconds). +The example above will make mrtg refuse to update log files older than 2 +hours (7200 seconds). =head2 WriteExpires @@ -396,9 +401,9 @@ as each new process runs forever. Instead MRTG should be started from the command prompt or by a system startup script. -If you want mrtg to run under a particular user and group (it is not recomended to run -MRTG as root) then you can use the B<--user=>I and B<--group=>I -options on the mrtg commandline. +If you want mrtg to run under a particular user and group (it is not +recomended to run MRTG as root) then you can use the B<--user=>I +and B<--group=>I options on the mrtg commandline. mrtg --user=mrtg_user --group=mrtg_group mrtg.cfg @@ -429,6 +434,7 @@ this will make mrtg run but without detaching it from the terminal. + =head2 ConversionCode Some devices may produce non-numeric values that would nevertheless @@ -534,6 +540,19 @@ Target[myrouter]: 2:router1:::::3 SnmpOptions[myrouter]: username=>'user1' +=item noHC + +Not all routers that support SNMPv2 or SNMPv3 provide the ifHC* counters +on every interface. The noHC[] per-target keyword signals that the +low-speed counters ifInOctets and ifOutOctets should be queried instead. +cfgmaker will automatically insert this tag if SNMPv2 or SNMPv3 is specified +but the ifHC* counters are unavailable. + +Example: + Target[myrouter]: #Bri0:router1:::::3 + SnmpOptions[myrouter]: username=>'user1' + noHC[myrouter]: yes + =item Reversing Sometimes you are sitting on the wrong side of the @@ -583,6 +602,31 @@ Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter + +=item SnmpGetNext + +A special case of an snmp object that is only reachable by 'walking' occurs +when a single snmpgetnext will return the correct value, but snmpwalk fails. +This may occur with snmp V2 or V3, as the snmpgetbulk method is used in these +versions. You can get mrtg to use getnext instead of getbulk by prepending the +OID with the string B. + +Example: + + Target[myrouter]: GeTNEXTstrangeOid&GeTNEXTstrangeOid:public@myrouter + +=item Counted SNMP Walk + +In other situations, an snmpwalk is needed to count rows, but the actual data +is uninteresting. For example, counting the number of mac-addresses in a CAM +table, or the number of simultaneous dialup sessions. You can get MRTG to count +the number of instances by prepending the OID with the string B. The +following will retrieve the number of simultaneous VOIP calls on some routers: + +Example: + + Target[myrouter]: CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3&CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3:public@myrouter + =item Interface by IP Sometimes SNMP interface index can change, like when new interfaces are @@ -604,7 +648,6 @@ Target[myrouter]: /1.2.3.4:public@wellfleet-fddi.domain Target[ezci]: -/1.2.3.4:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14/1.2.3.4&1.3.6.1.2.1.2.2.1.14/1.2.3.4:public@myrouter Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter =item Interface by Description @@ -620,8 +663,7 @@ Target[myrouter]: \My-Interface2:public@wellfleet-fddi.domain Target[ezci]: -\My-Interface2:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14\My-Interface2&1.3.6.1.2.1.2.2.1.14\My-Interface3:public@myrouter - Target[myrouter]: ifInErrors\My-Interface2&ifOutErrors\My-Interface3:public@myrouter + Target[myrouter]: ifInErrors\My-If2&ifOutErrors\My-If3:public@myrouter If your description contains a "&", a ":", a "@" or a " " you can include them but you must escape with a backlash: @@ -639,11 +681,10 @@ Target[myrouter]: #2/11:public@wellfleet-fddi.domain Target[ezci]: -#2/11:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14#3/7&1.3.6.1.2.1.2.2.1.14#3/7:public@myrouter Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter -If your description contains a "&", a ":", a "@" or a " " you can include them but you must escape with -a backlash: +If your description contains a "&", a ":", a "@" or a " " you can include +them but you must escape with a backlash: Target[myrouter]: #\:\ fun:public@hello.router @@ -672,10 +713,14 @@ Target[myrouter]: !0a-0b-0c-0d:public@wellfleet-fddi.domain Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51&!0a-00-10-23-44-51:public@myrouter - Target[myrouter]: ifInErrors!0a-00-10-23-44-51&ifOutErrors!0a-00-10-23-44-51:public@myrouter + Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51& *BREAK* + 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51:public@myrouter + Target[myrouter]: ifInErrors!0a-00-10-23-44-51& *BREAK* + ifOutErrors!0a-00-10-23-44-51:public@myrouter +Join the lines at *BREAK* ... + =item Interface by Type It seems that there are devices that try to defy all monitoring efforts: the interesting interfaces have @@ -690,9 +735,23 @@ Target[myrouter]: %13:public@wellfleet-fddi.domain Target[ezci]: -%13:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14%13&1.3.6.1.2.1.2.2.1.14%14:public@myrouter Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter +=item Extended positioning of ifIndex + + +There are OIDs that contain the interface index at some inner position within +the OID. To use the above mentioned Interface by IP/Description/Name/Type methods +in the target definition the keyword 'IndexPOS' can be used to indicate the +position of ifIndex. If 'IndexPOS' is not used the ifIndex will be appended at the +end of the OID. + +Example: + + Target[myrouter]: OID.IndexPOS.1/1.2.3.4&OID.IndexPOS.1/1.2.3.4:public@myrouter + +Replace OID by your numeric OID. + =item Extended Host Name Syntax In all places where ``community@router'' is accepted, you can add @@ -711,6 +770,27 @@ the UDP port under which to contact the SNMP agent (default: 161) +The complete syntax of the port parameter is + + remote_port[!local_address[!local_port]] + +Some machines have additional security features that only allow SNMP queries +to come from certain IP addresses. If the host doing the query has multiple +interface, it may be necessary to specify the interface the query should +come from. + +The port parameter allows the specification of the port of the machine being +queried. In addition, the IP address (or hostname) and port of the machine +doing the query may be specified. + +Examples: + + somehost + somehost:161 + somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source + somehost:!192.168.2.4 use 192.168.2.4 as source + somehost:!!4000 use port 4000 as source + =item timeout initial timeout for SNMP queries, in seconds (default: 2.0) @@ -785,7 +865,7 @@ The external command must return 4 lines of output: -=over 4 +=over =item Line 1 @@ -836,8 +916,8 @@ Target[myrouter]: 2:public@wellfleetA + 1:public@wellfleetA - Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice / - 1.3.6.1.4.1.999.3&1.3.6.1.4.1.999.4:public@mydevice * 100 + Target[myrouter]: .1.3.6.1.4.1.999.1&.1.3.6.1.4.1.999.2:public@mydevice / + .1.3.6.1.4.1.999.3&.1.3.6.1.4.1.999.4:public@mydevice * 100 Note that whitespace must surround each target definition in the expression. Target definitions themselves must not contain whitespace, except in @@ -937,12 +1017,18 @@ name should be displayed you have to specify its community and address again with the I keyword. +If you want to use a special OID for queriing the router uptime, +use prepend the oid. Example: Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250 RouterUptime[kacisco.comp.edu]: public@194.64.66.250 + RouterUptime[kacisco.comp.edu]: hrSystemUptime.0:public@194.64.66.250 + + + =head2 RouterName @@ -1129,13 +1215,12 @@ =head2 AbsMax -If you are monitoring a link which can handle more traffic -than the I value. Eg, a line which uses compression -or some frame relay link, you can use the I keyword -to give the absolute maximum value ever to be reached. -We need to know this in order to sort out unrealistic values -returned by the routers. If you do not set I, rateup -will ignore values higher than I. +If you are monitoring a link which can handle more traffic than the +I value. Eg, a line which uses compression or some frame relay +link, you can use the I keyword to give the absolute maximum value +ever to be reached. We need to know this in order to sort out unrealistic +values returned by the routers. If you do not set I, rateup will +ignore values higher than I. Example: @@ -1143,16 +1228,13 @@ =head2 Unscaled -By default each graph is scaled vertically to make the -actual data visible even when it is much lower than -I. With the I variable you can suppress -this. It's argument is a string, containing one letter -for each graph you don't want to be scaled: d=day w=week -m=month y=year. There is also a special case to unset the -variable completely: n=none. This could be useful in the -event you need to override a global configuration. In the -example scaling for the yearly and the monthly graph are -suppressed. +By default each graph is scaled vertically to make the actual data visible +even when it is much lower than I. With the I variable +you can suppress this. It's argument is a string, containing one letter for +each graph you don't want to be scaled: d=day w=week m=month y=year. There +is also a special case to unset the variable completely: n=none. This could +be useful in the event you need to override a global configuration. In the +example scaling for the yearly and the monthly graph are suppressed. Example: @@ -1221,7 +1303,8 @@ If the I option is specified, the I option will copy all the contents of I to the I. -As well as the I option requires, the clone directory must already exist; mrtg will not create it. +As well as the I option requires, the clone directory must +already exist; mrtg will not create it. Example: @@ -1229,7 +1312,8 @@ Directory[myrouter]: myrouter Clonedirectory[myrouter]: myclonedirectory -NOTE: the Clonedirectory option must always be 'relative' or bad things will happen. +NOTE: the Clonedirectory option must always be 'relative' or bad things will +happen. =head2 XSize and YSize @@ -1601,7 +1685,7 @@ displayed for the various legends of the graph and in the HTML document: -=over 4 +=over =item YLegend @@ -1681,6 +1765,20 @@ RRDRowCount[myrouter]: 1600 +=head2 RRDHWRRAs + +Normally the RRDs created by MRTG will just contain the information gathered +directly from the respective target. With this option you can tap into +rrdtools advanced aberrant behaviour detection module based on Holt-Winters +forecasting. The RRDHWRRAs property specifies the Holt-Winters RRAs as +described in the rrdcreate manual page. + +Note, this setting will only affect newly created RRDs (targets). + +Example: + + RRDHWRRAs[myrouter]: RRA:HWPREDICT:1440:0.1:0.0035:288 + =head2 TimeStrPos This defines placement of the timestamp string on the image. Possible @@ -1721,17 +1819,51 @@ ThreshDir: /var/mrtg/thresh +=head2 ThreshHyst (GLOBAL) + +If a threshold is broken, and you have a threshdir defined, then mrtg will +send mail once the threshold becomes 'unborken' to avoid situations where +broken and un-broken messages get sent in close succession, we only send an +unbroken message once the curent value is 0.1 (10%) away from the threshold. +using the ThreshHyst config variable you can customize this value. + +Example for 5%: + + ThreshHyst: 0.05 + +=head2 ThreshMailServer (GLOBAL) + +Adderss of an SMTP server which is going to accept mail about Thresholds being broken and unbroken. + +=head2 ThreshMailSender (GLOBAL) + +What is the sender address of the threshold mail. + +Example: + + ThreshMailSender: mrtg@example.com + +=head2 ThreshMailAddress (PER TARGET) + +Email address for Threshold related Mails. This will only work if a mailserver has been configured. + +Example: + + ThreshMailAddress[_]: admin@example.com + ThreshMailAddress[router]: + +This would bring threshold releaed mail to all but the target called 'router'. + =head2 ThreshMinI (PER TARGET) This is the minimum acceptable value for the Input (first) parameter. If the parameter falls below this value, the program specified in ThreshProgI -will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes. +will be run and a mail will be sent to the ThreshMailAddress if specified. +If the value ends in '%' then the threshold is defined relative to MaxBytes. =head2 ThreshMaxI (PER TARGET) -This is the maximum acceptable value for the Input (first) parameter. If -the parameter falls above this value, the program specified in ThreshProgI -will be run. If the value ends in '%' then the threshold is defined relative to MaxBytes. +Works the same as TheshMinI but it acts when the value is higher than ThreshMaxI. =head2 ThreshDesc (PER TARGET) @@ -1757,9 +1889,6 @@ These work the same as their *I counterparts, except on the Output (second) parameter. -I - =head2 SetEnv When calling threshold scripts from within your cfg file you might want to @@ -1774,6 +1903,24 @@ SetEnv[myrouter]: EMAIL="contact_email@someplace.net" HOST="www.some_server.net" +=head2 HW Failure Bassed Threshol Checking + +When using rrd based logging with HW RRAs defined. You can use the +confidence bounds violations stored in the FAILURES RRA for threshold based +alerts. + +There the all target specific threshold variables have a Hold-Winters counterpart: + + ThreshMailAddress -> HWThreshMailAddress + ThreshMinI -> HWThreshMinI + ... + +The global variables for threshold checking are shared except for the + + ThreshHyst -> HWThreshHyst + +And HWThreshDesc sets the HWTHRESH_DESC variable. + =head1 PER TARGET DEFAULT VALUES =head2 Pre- and Postfix @@ -1875,13 +2022,15 @@ =item B<--confcache-file> I -Use an alternate confcache-file (the default is to use the configuration-file appended with C<.ok>) +Use an alternate confcache-file (the default is to use the +configuration-file appended with C<.ok>) =item B<--logging> I|B -If this is set to writable filename, all output from mrtg (warnings, debug messages, errors) -will go to I. If you are running on Win32 you can specify B instead of a filename -which will send all error to the windows event log. +If this is set to writable filename, all output from mrtg (warnings, debug +messages, errors) will go to I. If you are running on Win32 you +can specify B instead of a filename which will send all error to +the windows event log. B Note, there is no Message DLL for mrtg included with mrtg. This has the side effect that the windows event logger will display a nice message @@ -1910,7 +2059,8 @@ =item B<--debug=s> -Enable debug options. The argument of the debug option is a comma separated list of debug values: +Enable debug options. The argument of the debug option is a comma separated +list of debug values: cfg - watch the config file reading dir - directory mangeling @@ -1922,6 +2072,7 @@ time - some timing info log - logging of data via rateup or rrdtool eval - print eval strings before evaluting them + prof - add hires timing info the rrd calls Example: @@ -1931,9 +2082,10 @@ =head1 EXIT CODES -An exit code of 0 indicates that all targets were successful. Generally speaking, most codes greater -than 0 indicate that there was an unrecoverable problem. One exception to this is code 91, which -indicates that at least one of the targets was succesful. A partial listing of the codes follows: +An exit code of 0 indicates that all targets were successful. Generally +speaking, most codes greater than 0 indicate that there was an unrecoverable +problem. One exception to this is code 91, which indicates that at least +one of the targets was succesful. A partial listing of the codes follows: 0: All targets sucessful diff -Nru mrtg-2.14.7/doc/mrtg-reference.txt mrtg-2.16.1/doc/mrtg-reference.txt --- mrtg-2.14.7/doc/mrtg-reference.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-reference.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,33 +1,32 @@ -MRTG-REFERENCE(1) mrtg MRTG-REFERENCE(1) +MRTG-REFERENCE(1) mrtg MRTG-REFERENCE(1) NNAAMMEE - mrtg-reference - MRTG 2.14.7 configuration reference + mrtg-reference - MRTG 2.16.1 configuration reference OOVVEERRVVIIEEWW - The runtime behaviour of MRTG is governed by a configura- - tion file. Run-of- ther-mill configuration files can be - generated with ccffggmmaakkeerr. (Check cfgmaker). But for more - elaborate configurations some hand-tuning is required. + The runtime behaviour of MRTG is governed by a configuration file. + Run-of-the-mill configuration files can be generated with ccffggmmaakkeerr. + (Check cfgmaker). But for more elaborate configurations some hand-tun- + ing is required. - This document describes all the configuration options - understood by the mrtg software. + This document describes all the configuration options understood by the + mrtg software. SSYYNNTTAAXX MRTG configuration file syntax follows some simple rules: +o Keywords must start at the beginning of a line. - +o Lines which follow a keyword line which start with a - blank are appended to the keyword line + +o Lines which follow a keyword line which start with a blank are + appended to the keyword line +o Empty Lines are ignored +o Lines starting with a # sign are comments. - +o You can add other files into the configuration file - using + +o You can add other files into the configuration file using IInncclluuddee:: _f_i_l_e @@ -35,16 +34,15 @@ Include: base-options.inc - If included files are specified with relative paths, - both the current working directory and the directory - containing the main config file will be searched for - the files. + If included files are specified with relative paths, both the cur- + rent working directory and the directory containing the main config + file will be searched for the files. GGLLOOBBAALL KKEEYYWWOORRDDSS WWoorrkkDDiirr - WorkDir specifies where the logfiles and the webpages - should be created. + WorkDir specifies where the logfiles and the webpages should be cre- + ated. Example: @@ -53,22 +51,19 @@ OOPPTTIIOONNAALL GGLLOOBBAALL KKEEYYWWOORRDDSS HHttmmllDDiirr - HtmlDir specifies the directory where the html (or shtml, - but we'll get on to those later) lives. + HtmlDir specifies the directory where the html (or shtml, but we'll get + on to those later) lives. - NOTE: Workdir overrides the settings for htmldir, imagedir - and logdir. + NOTE: Workdir overrides the settings for htmldir, imagedir and logdir. Example: Htmldir: /www/mrtg/ - - IImmaaggeeDDiirr - ImageDir specifies the directory where the images live. - They should be under the html directory. + ImageDir specifies the directory where the images live. They should be + under the html directory. Example: @@ -76,8 +71,8 @@ LLooggDDiirr - LogDir specifies the directory where the logs are stored. - This need not be under htmldir directive. + LogDir specifies the directory where the logs are stored. This need + not be under htmldir directive. Example: @@ -85,17 +80,14 @@ FFoorrkkss ((UUNNIIXX oonnllyy)) - With system that supports fork (UNIX for example), mrtg - can fork itself into multiple instances while it is - acquiring data via snmp. - - For situations with high latency or a great number of - devices this will speed things up considerably. It will - not make things faster, though, if you query a single - switch sitting next door. + With system that supports fork (UNIX for example), mrtg can fork itself + into multiple instances while it is acquiring data via snmp. + + For situations with high latency or a great number of devices this will + speed things up considerably. It will not make things faster, though, + if you query a single switch sitting next door. - As far as I know NT can not fork so this option is not - available on NT. + As far as I know NT can not fork so this option is not available on NT. Example: @@ -103,23 +95,20 @@ EEnnaabblleeIIPPvv66 - When set to yes, IPv6 support is enabled if the required - libraries are present (see the mrtg-ipv6 manpage). When - IPv6 is enabled, mrtg can talk to routers using SNMP over - IPv6 and targets may be specified by their numeric IPv6 - addresses as well as by hostname or IPv4 address. - - If IPv6 is enabled and the target is a hostname, mrtg will - try to resolve the hostname to an IPv6 address and, if - this fails, to an IPv4 address. Note that mrtg will only - use IPv4 if you specify an IPv4 address or a hostname with - no corresponding IPv6 address; it will not fall back to - IPv4 if it simply fails to communicate with the target + When set to yes, IPv6 support is enabled if the required libraries are + present (see the mrtg-ipv6 manpage). When IPv6 is enabled, mrtg can + talk to routers using SNMP over IPv6 and targets may be specified by + their numeric IPv6 addresses as well as by hostname or IPv4 address. + + If IPv6 is enabled and the target is a hostname, mrtg will try to + resolve the hostname to an IPv6 address and, if this fails, to an IPv4 + address. Note that mrtg will only use IPv4 if you specify an IPv4 + address or a hostname with no corresponding IPv6 address; it will not + fall back to IPv4 if it simply fails to communicate with the target using IPv6. This is by design. - Note that many routers do not currently support SNMP over - IPv6. Use the _I_P_v_4_O_n_l_y per target option for these - routers. + Note that many routers do not currently support SNMP over IPv6. Use the + _I_P_v_4_O_n_l_y per target option for these routers. IPv6 is disabled by default. @@ -127,16 +116,11 @@ EnableIPv6: Yes - - - - EEnnaabblleeSSnnmmppVV33 - When set to yes, uses the Net::SNMP module instead of the - SNMP_SESSION module for generating snmp queries. This - allows the use of SNMPv3 if other snmpv3 parameters are - set. + When set to yes, uses the Net::SNMP module instead of the SNMP_SESSION + module for generating snmp queries. This allows the use of SNMPv3 if + other snmpv3 parameters are set. SNMPv3 is disabled by default. @@ -146,9 +130,9 @@ RReeffrreesshh - How many seconds apart should the browser (Netscape) be - instructed to reload the page? If this is not defined, the - default is 300 seconds (5 minutes). + How many seconds apart should the browser (Netscape) be instructed to + reload the page? If this is not defined, the default is 300 seconds (5 + minutes). Example: @@ -156,63 +140,65 @@ IInntteerrvvaall - How often do you call mrtg? The default is 5 minutes. If - you call it less often, you should specify it here. This - does two things: - - +o The generated HTML page contains the right information - about the calling interval ... - - +o A META header in the generated HTML page will instruct - caches about the time-to-live of this page ..... - - In this example, we tell mrtg that we will be calling it - every 10 minutes. If you are calling mrtg every 5 minutes, - you can leave this line commented out. + How often do you call mrtg? The default is 5 minutes. If you call it + less often, you should specify it here. This does two things: + + +o The generated HTML page contains the right information about the + calling interval ... + + +o A META header in the generated HTML page will instruct caches about + the time-to-live of this page ..... + + In this example, we tell mrtg that we will be calling it every 10 min- + utes. If you are calling mrtg every 5 minutes, you can leave this line + commented out. Example: Interval: 10 - Note that unless you are using rrdtool you can not set - Interval to less than 5 minutes. If you are using rrdtool - you can set interval down to 1 minute. Note though, set- - ting the Interval for an rrdtool/mrtg setup will influence - the initial creation of the database. If you change the - interval later, all existing databases will remain at the - resolution they were initially created with. + Note that unless you are using rrdtool you can not set Interval to less + than 5 minutes. If you are using rrdtool you can set interval in the + format + + Interval: MM[:SS] + + Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg + setup will influence the initial creation of the database. If you + change the interval later, all existing databases will remain at the + resolution they were initially created with. Also note that you must + make sure that your mrtg-rrd Web-frontend can deal with this kind of + Interval setting. MMaaxxAAggee - MRTG relies heavily on the real time clock of your com- - puter. If the time is set to a wrong value, especially if - it is advanced far into the future, this will cause mrtg - to expire lots of supposedly old data from the log files. - - To prevent this, you can add a 'reasonability' check by - specifying a maximum age for log files. If a file seems to - be older, mrtg will not touch it but complain instead, - giving you a chance to investigate the cause. + MRTG relies heavily on the real time clock of your computer. If the + time is set to a wrong value, especially if it is advanced far into the + future, this will cause mrtg to expire lots of supposedly old data from + the log files. + + To prevent this, you can add a 'reasonability' check by specifying a + maximum age for log files. If a file seems to be older, mrtg will not + touch it but complain instead, giving you a chance to investigate the + cause. Example: MaxAge: 7200 - The example above will make mrtg refuse to update log - files older than 2 hours (7200 seconds). + The example above will make mrtg refuse to update log files older than + 2 hours (7200 seconds). WWrriitteeEExxppiirreess - With this switch mrtg will generate .meta files for CERN - and Apache servers which contain Expiration tags for the - html and gif files. The *.meta files will be created in - the same directory as the other files, so you will have to - set "MetaDir ." and "MetaFiles on" in your apache.conf or - .htaccess file for this to work - - NOTE: If you are running Apache-1.2 or later, you can use - the mod_expire to achieve the same effect ... see the file - htaccess.txt + With this switch mrtg will generate .meta files for CERN and Apache + servers which contain Expiration tags for the html and gif files. The + *.meta files will be created in the same directory as the other files, + so you will have to set "MetaDir ." and "MetaFiles on" in your + apache.conf or .htaccess file for this to work + + NOTE: If you are running Apache-1.2 or later, you can use the + mod_expire to achieve the same effect ... see the file htaccess.txt Example: @@ -220,15 +206,14 @@ NNooMMiibb22 - Normally we ask the SNMP device for 'sysUptime' and 'sys- - Name' properties. Some do not have these. If you want to - avoid getting complaints from mrtg about these missing - properties, specify the nomib2 option. - - An example of agents which do not implement base mib2 - attributes are Computer Associates - Unicenter TNG Agents. - CA relies on using the base OS SNMP agent in addition to - its own agents to supplement the management of a system. + Normally we ask the SNMP device for 'sysUptime' and 'sysName' proper- + ties. Some do not have these. If you want to avoid getting complaints + from mrtg about these missing properties, specify the nomib2 option. + + An example of agents which do not implement base mib2 attributes are + Computer Associates - Unicenter TNG Agents. CA relies on using the + base OS SNMP agent in addition to its own agents to supplement the man- + agement of a system. Example: @@ -236,10 +221,9 @@ SSiinngglleeRReeqquueesstt - Some SNMP implementations can not deal with requests ask- - ing for multiple snmp variables in one go. Set this in - your cfg file to force mrtg to only ask for one variable - per request. + Some SNMP implementations can not deal with requests asking for multi- + ple snmp variables in one go. Set this in your cfg file to force mrtg + to only ask for one variable per request. Examples @@ -247,10 +231,10 @@ SSnnmmppOOppttiioonnss - Apart from the per target timeout options, you can also - configure the behaviour of the snmpget process on a more - profound level. SnmpOptions accepts a hash of options. The - following options are currently supported: + Apart from the per target timeout options, you can also configure the + behaviour of the snmpget process on a more profound level. SnmpOptions + accepts a hash of options. The following options are currently sup- + ported: timeout => $default_timeout, retries => $default_retries, @@ -260,22 +244,21 @@ lenient_source_port_matching => 0, lenient_source_address_matching => 1 - The values behind the options indicate the current default - value. Note that these settings OVERRIDE the per target - timeout settings. + The values behind the options indicate the current default value. Note + that these settings OVERRIDE the per target timeout settings. - A per-target SnmpOptions[] keyword will override the - global settings. That keyword is primarily for SNMPv3. + A per-target SnmpOptions[] keyword will override the global settings. + That keyword is primarily for SNMPv3. - The 16bit request ids are the only way to query the broken - SNMP implementation of SMC Barricade routers. + The 16bit request ids are the only way to query the broken SNMP imple- + mentation of SMC Barricade routers. Example: SnmpOptions: retries => 2, only_ip_address_matching => 0 - Note that AS/400 snmp seems to be broken in a way which - prevents mrtg from working with it unless + Note that AS/400 snmp seems to be broken in a way which prevents mrtg + from working with it unless SnmpOptions: lenient_source_port_matching => 1 @@ -283,9 +266,9 @@ IIccoonnDDiirr - If you want to keep the mrtg icons in someplace other than - the working (or imagedir) directory, use the _I_c_o_n_D_i_r vari- - able for defining the url of the icons directory. + If you want to keep the mrtg icons in someplace other than the working + (or imagedir) directory, use the _I_c_o_n_D_i_r variable for defining the url + of the icons directory. Example: @@ -293,9 +276,9 @@ LLooaaddMMIIBBss - Load the MIB file(s) specified and make its OIDs available - as symbolic names. For better efficiancy, a cache of MIBs - is maintained in the WorkDir. + Load the MIB file(s) specified and make its OIDs available as symbolic + names. For better efficiancy, a cache of MIBs is maintained in the + WorkDir. Example: @@ -303,19 +286,18 @@ LLaanngguuaaggee - Switch output format to the selected Language (Check the - _t_r_a_n_s_l_a_t_e directory to see which languages are supported - at the moment. In this directory you can also find - instructions on how to create new translations). + Switch output format to the selected Language (Check the _t_r_a_n_s_l_a_t_e + directory to see which languages are supported at the moment. In this + directory you can also find instructions on how to create new transla- + tions). Currently the following laguages are supported: - big5 brazilian bulgarian catalan chinese croatian czech - danish dutch eucjp french galician gb gb2312 german greek - hungarian icelandic indonesia iso2022jp italian korean - lithuanian malay norwegian polish portuguese romanian rus- - sian russian1251 serbian slovak slovenian spanish swedish - turkish ukrainian + big5 brazilian bulgarian catalan chinese croatian czech danish dutch + eucjp french galician gb gb2312 german greek hungarian icelandic + indonesia iso2022jp italian korean lithuanian malay norwegian polish + portuguese romanian russian russian1251 serbian slovak slovenian span- + ish swedish turkish ukrainian Example: @@ -323,9 +305,9 @@ LLooggFFoorrmmaatt - Setting LogFormat to 'rrdtool' in your mrtg.cfg file - enables rrdtool mode. In rrdtool mode, mrtg relies on - rrrrddttooooll to do its logging. See mrtg-rrd. + Setting LogFormat to 'rrdtool' in your mrtg.cfg file enables rrdtool + mode. In rrdtool mode, mrtg relies on rrrrddttooooll to do its logging. See + mrtg-rrd. Example: @@ -333,10 +315,9 @@ LLiibbAAdddd - If you are using rrdtool mode and your rrrrddttooooll Perl module - (RRDs.pm) is not installed in a location where perl can - find it on its own, you can use LibAdd to supply an appro- - priate path. + If you are using rrdtool mode and your rrrrddttooooll Perl module (RRDs.pm) is + not installed in a location where perl can find it on its own, you can + use LibAdd to supply an appropriate path. Example: @@ -344,9 +325,8 @@ PPaatthhAAdddd - If the rrrrddttooooll executable can not be found in the normal - "PATH", you can use this keyword to add a suitable direc- - tory to your path. + If the rrrrddttooooll executable can not be found in the normal "PATH", you + can use this keyword to add a suitable directory to your path. Example: @@ -354,86 +334,77 @@ RRuunnAAssDDaaeemmoonn - The RunAsDaemon keyword enables daemon mode operation. The - purpose of daemon mode is that MRTG is launched once and - not repeatedly (as it is with cron). This behavior saves - computing resourses as loading and parsing of configura- - tion files happens only once. - - Using daemon mode MRTG itself is responible for timing the - measurement intervals. Therfore its important to set the - Interval keyword to an apropiate value. - - Note that when using daemon mode MRTG should no longer be - started from cron as each new process runs forever. - Instead MRTG should be started from the command prompt or - by a system startup script. - - If you want mrtg to run under a particular user and group - (it is not recomended to run MRTG as root) then you can - use the ----uusseerr==_u_s_e_r___n_a_m_e and ----ggrroouupp==_g_r_o_u_p___n_a_m_e options on - the mrtg commandline. + The RunAsDaemon keyword enables daemon mode operation. The purpose of + daemon mode is that MRTG is launched once and not repeatedly (as it is + with cron). This behavior saves computing resourses as loading and + parsing of configuration files happens only once. + + Using daemon mode MRTG itself is responible for timing the measurement + intervals. Therfore its important to set the Interval keyword to an + apropiate value. + + Note that when using daemon mode MRTG should no longer be started from + cron as each new process runs forever. Instead MRTG should be started + from the command prompt or by a system startup script. + + If you want mrtg to run under a particular user and group (it is not + recomended to run MRTG as root) then you can use the ----uusseerr==_u_s_e_r___n_a_m_e + and ----ggrroouupp==_g_r_o_u_p___n_a_m_e options on the mrtg commandline. mrtg --user=mrtg_user --group=mrtg_group mrtg.cfg - Also note that in daemon mode restarting the process is - required in order to activate changes in the config file. + Also note that in daemon mode restarting the process is required in + order to activate changes in the config file. - Under UNIX, the Daemon switch causes mrtg to fork into - background after checking its config file. On Windows NT - the MRTG process will detach from the console, but because - the NT/2000 shell waits for its children you have to use - this special start sequence when you launch the program: + Under UNIX, the Daemon switch causes mrtg to fork into background after + checking its config file. On Windows NT the MRTG process will detach + from the console, but because the NT/2000 shell waits for its children + you have to use this special start sequence when you launch the pro- + gram: start /b perl mrtg mrtg.cfg - You may have to add path information equal to what you add - when you run mrtg from the commandline. + You may have to add path information equal to what you add when you run + mrtg from the commandline. Example RunAsDaemon: Yes Interval: 5 - This makes MRTG run as a daemon beginning data collection - every 5 minutes + This makes MRTG run as a daemon beginning data collection every 5 min- + utes - If you are daemontools and still want to run mrtg as a - daemon you can additionally specify + If you are daemontools and still want to run mrtg as a daemon you can + additionally specify NoDetach: Yes - this will make mrtg run but without detaching it from the - terminal. + this will make mrtg run but without detaching it from the terminal. CCoonnvveerrssiioonnCCooddee - Some devices may produce non-numeric values that would - nevertheless be useful to graph with MRTG if those values - could be converted to numbers. The ConversionCode keyword - specifies the path to a file containing Perl code to per- - form such conversions. The code in this file must consist - of one or more Perl subroutines. Each subroutine must - accept a single string argument and return a single - numeric value. When RRDtool is in use, a decimal value may - be returned. When the name of one of these subroutines is - specified in a target definition (see below), MRTG calls - it twice for that target, once to convert the the input - value being monitored and a second time to convert the - output value. The subroutine must return an undefined - value if the conversion fails. In case of failure, a warn- - ing may be posted to the MRTG log file using Perl's warn - function. MRTG imports the subroutines into a separate - name space (package MRTGConversion), so the user need not - worry about pollution of MRTG's global name space. MRTG - automatically prepends this package declaration to the - user-supplied code. - - Example: Suppose a particular OID returns a character - string whose length is proportional to the value to be - monitored. To convert this string to a number that can be - graphed by MRTG, create a file arbitrarily named "MyCon- - versions.pl" containing the following code: + Some devices may produce non-numeric values that would nevertheless be + useful to graph with MRTG if those values could be converted to num- + bers. The ConversionCode keyword specifies the path to a file contain- + ing Perl code to perform such conversions. The code in this file must + consist of one or more Perl subroutines. Each subroutine must accept a + single string argument and return a single numeric value. When RRDtool + is in use, a decimal value may be returned. When the name of one of + these subroutines is specified in a target definition (see below), MRTG + calls it twice for that target, once to convert the the input value + being monitored and a second time to convert the output value. The + subroutine must return an undefined value if the conversion fails. In + case of failure, a warning may be posted to the MRTG log file using + Perl's warn function. MRTG imports the subroutines into a separate name + space (package MRTGConversion), so the user need not worry about pollu- + tion of MRTG's global name space. MRTG automatically prepends this + package declaration to the user-supplied code. + + Example: Suppose a particular OID returns a character string whose + length is proportional to the value to be monitored. To convert this + string to a number that can be graphed by MRTG, create a file arbitrar- + ily named "MyConversions.pl" containing the following code: # Return the length of the string argument sub Length2Int { @@ -441,123 +412,125 @@ return length( $value ); } - Then include the following global keyword in the MRTG con- - figuration file (assuming that the conversion code file is - saved in the mrtg/bin directory along with mrtg itself): + Then include the following global keyword in the MRTG configuration + file (assuming that the conversion code file is saved in the mrtg/bin + directory along with mrtg itself): ConversionCode: MyConversions.pl - This will cause MRTG to include the definition of the sub- - routine Length2Int in its execution environment. - Length2Int can then be invoked on any target by appending - "|Length2Int" to the target definition as follows: + This will cause MRTG to include the definition of the subroutine + Length2Int in its execution environment. Length2Int can then be invoked + on any target by appending "|Length2Int" to the target definition as + follows: Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.1:public@mydevice|Length2Int - See "Extended Host Name Syntax" below for complete target - definition syntax information. + See "Extended Host Name Syntax" below for complete target definition + syntax information. PPEERR TTAARRGGEETT CCOONNFFIIGGUURRAATTIIOONN - Each monitoring target must be identified by a unique - name. This name must be appended to each parameter - belonging to the same target. The name will also be used - for naming the generated webpages, logfiles and images for - this target. + Each monitoring target must be identified by a unique name. This name + must be appended to each parameter belonging to the same target. The + name will also be used for naming the generated webpages, logfiles and + images for this target. TTaarrggeett - With the _T_a_r_g_e_t keyword you tell mrtg what it should moni- - tor. The _T_a_r_g_e_t keyword takes arguments in a wide range of - formats: + With the _T_a_r_g_e_t keyword you tell mrtg what it should monitor. The _T_a_r_- + _g_e_t keyword takes arguments in a wide range of formats: Basic - The most basic format is "port:community@router" This - will generate a traffic graph for the interface 'port' - of the host 'router' (dns name or IP address) and it - will use the community 'community' (snmp password) for - the snmp query. + The most basic format is "port:community@router" This will generate + a traffic graph for the interface 'port' of the host 'router' (dns + name or IP address) and it will use the community 'community' (snmp + password) for the snmp query. Example: Target[myrouter]: 2:public@wellfleet-fddi.domain - If your community contains a "@" or a " " these char- - acters must be escaped with a "\". + If your community contains a "@" or a " " these characters must be + escaped with a "\". Target[bla]: 2:stu\ pi\@d@router SNMPv2c - If you have a fast router you might want to try to - poll the ifHC* counters. This feature gets activated - by switching to SNMPv2c. Unfortunately not all devices - support SNMPv2c yet. If it works, this will prevent - your counters from wraping within the 5 minute polling - interval, since we now use 64 bit instead of the nor- - mal 32 bit. + If you have a fast router you might want to try to poll the ifHC* + counters. This feature gets activated by switching to SNMPv2c. + Unfortunately not all devices support SNMPv2c yet. If it works, + this will prevent your counters from wraping within the 5 minute + polling interval, since we now use 64 bit instead of the normal 32 + bit. Example: Target[myrouter]: 2:public@router1:::::2 SNMPv3 - As an alternative to SNMPv2c, SNMPv3 provides access - to the ifHC* counters, along with encryption. Not all - devices support SNMPv3, and you will also need the - perl Net::SNMP library in order to use it. It is rec- - ommended that cfgmaker be used to generate configura- - tions involving SNMPv3, as it will check if the - Net::SNMP library is loadable, and will switch to - SNMPv2c if v3 is unavailable. + As an alternative to SNMPv2c, SNMPv3 provides access to the ifHC* + counters, along with encryption. Not all devices support SNMPv3, + and you will also need the perl Net::SNMP library in order to use + it. It is recommended that cfgmaker be used to generate configura- + tions involving SNMPv3, as it will check if the Net::SNMP library + is loadable, and will switch to SNMPv2c if v3 is unavailable. - SNMP v3 requires additional authentication parameters, - passed using the SnmpOptions[] per-target keyword. + SNMP v3 requires additional authentication parameters, passed using + the SnmpOptions[] per-target keyword. Example: Target[myrouter]: 2:router1:::::3 SnmpOptions[myrouter]: username=>'user1' + noHC + Not all routers that support SNMPv2 or SNMPv3 provide the ifHC* + counters on every interface. The noHC[] per-target keyword signals + that the low-speed counters ifInOctets and ifOutOctets should be + queried instead. cfgmaker will automatically insert this tag if + SNMPv2 or SNMPv3 is specified but the ifHC* counters are unavail- + able. + + Example: + Target[myrouter]: #Bri0:router1:::::3 + SnmpOptions[myrouter]: username=>'user1' + noHC[myrouter]: yes + Reversing - Sometimes you are sitting on the wrong side of the - link, and you would like to have mrtg report Incoming - traffic as Outgoing and vice versa. This can be - achieved by adding the '-' sign in front of the "Tar- - get" description. It flips the incoming and outgoing - traffic rates. + Sometimes you are sitting on the wrong side of the link, and you + would like to have mrtg report Incoming traffic as Outgoing and + vice versa. This can be achieved by adding the '-' sign in front of + the "Target" description. It flips the incoming and outgoing traf- + fic rates. Example: Target[ezci]: -1:public@ezci-ether.domain Explicit OIDs - You can also explicitly define which OID to query by - using the following syntax 'OID_1&OID_2:commu- - nity@router' The following example will retrieve error - counts for input and output on interface 1. MRTG - needs to graph two variables, so you need to specify - two OID's such as temperature and humidity or error - input and error output. + You can also explicitly define which OID to query by using the fol- + lowing syntax 'OID_1&OID_2:community@router' The following example + will retrieve error counts for input and output on interface 1. + MRTG needs to graph two variables, so you need to specify two OID's + such as temperature and humidity or error input and error output. Example: Target[myrouter]: 1.3.6.1.2.1.2.2.1.14.1&1.3.6.1.2.1.2.2.1.20.1:public@myrouter MIB Variables - MRTG knows a number of symbolic SNMP variable names. - See the file mibhelp.txt for a list of known names. - One example are the ifInErrors and ifOutErrors. This - means you can specify the above as: + MRTG knows a number of symbolic SNMP variable names. See the file + mibhelp.txt for a list of known names. One example are the ifIn- + Errors and ifOutErrors. This means you can specify the above as: Example: Target[myrouter]: ifInErrors.1&ifOutErrors.1:public@myrouter SnmpWalk - It may be that you want to monitor an snmp object that - is only reachable by 'walking'. You can get mrtg to - walk by prepending the OID with the string WWaaLLKK or if - you want a particular entry from the table returned by - the walk you can use WWaaLLKK_x where _x is a number start- - ing from 0 (!). + It may be that you want to monitor an snmp object that is only + reachable by 'walking'. You can get mrtg to walk by prepending the + OID with the string WWaaLLKK or if you want a particular entry from the + table returned by the walk you can use WWaaLLKK_x where _x is a number + starting from 0 (!). Example: @@ -565,297 +538,327 @@ Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter + SnmpGetNext + A special case of an snmp object that is only reachable by 'walk- + ing' occurs when a single snmpgetnext will return the correct + value, but snmpwalk fails. This may occur with snmp V2 or V3, as + the snmpgetbulk method is used in these versions. You can get mrtg + to use getnext instead of getbulk by prepending the OID with the + string GGeeTTNNEEXXTT. + + Example: + + Target[myrouter]: GeTNEXTstrangeOid&GeTNEXTstrangeOid:public@myrouter + + Counted SNMP Walk + In other situations, an snmpwalk is needed to count rows, but the + actual data is uninteresting. For example, counting the number of + mac-addresses in a CAM table, or the number of simultaneous dialup + sessions. You can get MRTG to count the number of instances by + prepending the OID with the string CCnnTTWWaaLLKK. The following will + retrieve the number of simultaneous VOIP calls on some routers: + + Example: + + Target[myrouter]: CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3&CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3:public@myrouter + Interface by IP - Sometimes SNMP interface index can change, like when - new interfaces are added or removed. This can cause - all Target entries in your config file to become off- - set, causing MRTG to graphs wrong instances etc. MRTG - supports IP address instead of ifindex in target defi- - nition. Then MRTG will query snmp device and try to - map IP address to the current ifindex. You can use IP - addresses in every type of target definition by adding - IP address of the numbered interface after OID and - separation char '/'. - - Make sure that the given IP address is used on your - same target router, especially when graphing two dif- - ferent OIDs and/or interface split by '&' delimiter. + Sometimes SNMP interface index can change, like when new interfaces + are added or removed. This can cause all Target entries in your + config file to become offset, causing MRTG to graphs wrong + instances etc. MRTG supports IP address instead of ifindex in tar- + get definition. Then MRTG will query snmp device and try to map IP + address to the current ifindex. You can use IP addresses in every + type of target definition by adding IP address of the numbered + interface after OID and separation char '/'. + + Make sure that the given IP address is used on your same target + router, especially when graphing two different OIDs and/or inter- + face split by '&' delimiter. - You can tell cfgmaker to generate such references with - the option ----iiffrreeff==iipp. + You can tell cfgmaker to generate such references with the option + ----iiffrreeff==iipp. Example: Target[myrouter]: /1.2.3.4:public@wellfleet-fddi.domain Target[ezci]: -/1.2.3.4:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14/1.2.3.4&1.3.6.1.2.1.2.2.1.14/1.2.3.4:public@myrouter Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter Interface by Description - If you can not use IP addresses you might want to use - the interface names. This works similar to the IP - address aproach except that the prefix to use is a \ - instead of a / + If you can not use IP addresses you might want to use the interface + names. This works similar to the IP address aproach except that the + prefix to use is a \ instead of a / - You can tell cfgmaker to generate such references with - the option ----iiffrreeff==ddeessccrr. + You can tell cfgmaker to generate such references with the option + ----iiffrreeff==ddeessccrr. Example: Target[myrouter]: \My-Interface2:public@wellfleet-fddi.domain Target[ezci]: -\My-Interface2:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14\My-Interface2&1.3.6.1.2.1.2.2.1.14\My-Interface3:public@myrouter - Target[myrouter]: ifInErrors\My-Interface2&ifOutErrors\My-Interface3:public@myrouter + Target[myrouter]: ifInErrors\My-If2&ifOutErrors\My-If3:public@myrouter - If your description contains a "&", a ":", a "@" or a - " " you can include them but you must escape with a - backlash: + If your description contains a "&", a ":", a "@" or a " " you can + include them but you must escape with a backlash: Target[myrouter]: \fun\:\ ney\&ddd:public@hello.router Interface by Name - This is the only sensible way to reference the inter- - faces of your switches. + This is the only sensible way to reference the interfaces of your + switches. - You can tell cfgmaker to generate such references with - the option ----iiffrreeff==nnaammee. + You can tell cfgmaker to generate such references with the option + ----iiffrreeff==nnaammee. Example: Target[myrouter]: #2/11:public@wellfleet-fddi.domain Target[ezci]: -#2/11:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14#3/7&1.3.6.1.2.1.2.2.1.14#3/7:public@myrouter Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter - If your description contains a "&", a ":", a "@" or a - " " you can include them but you must escape with a - backlash: + If your description contains a "&", a ":", a "@" or a " " you can + include them but you must escape with a backlash: Target[myrouter]: #\:\ fun:public@hello.router - Note that the # sign will be interpreted as a comment - character if it is the first non white-space character - on the line. + Note that the # sign will be interpreted as a comment character if + it is the first non white-space character on the line. Interface by Ethernet Address - When the SNMP interface index changes, you can key - that interface by its 'Physical Address', sometimes - called a 'hard address', which is the SNMP variable - 'ifPhysAddress'. Internally, MRTG matches the Physi- - cal Address from the *.cfg file to its current index, - and then uses that index for the rest of the session. - - You can use the Physical Address in every type of tar- - get definition by adding the Physical Address after - the OID and the separation char '!' (analogous to the - IP address option). The Physical address is specified - as '-' delimited octets, such as "0a-0-f1-5-23-18" - (omit the double quotes). Note that some routers use - the same Hardware Ethernet Address for all of their - Interfaces which prevents unique interface identifica- - tion. Mrtg will notice such problems and alert you. - - You can tell cfgmaker to generate configuration files - with hardware ethernet address references by using the - option ----iiffrreeff==eetthh. + When the SNMP interface index changes, you can key that interface + by its 'Physical Address', sometimes called a 'hard address', which + is the SNMP variable 'ifPhysAddress'. Internally, MRTG matches the + Physical Address from the *.cfg file to its current index, and then + uses that index for the rest of the session. + + You can use the Physical Address in every type of target definition + by adding the Physical Address after the OID and the separation + char '!' (analogous to the IP address option). The Physical + address is specified as '-' delimited octets, such as + "0a-0-f1-5-23-18" (omit the double quotes). Note that some routers + use the same Hardware Ethernet Address for all of their Interfaces + which prevents unique interface identification. Mrtg will notice + such problems and alert you. + + You can tell cfgmaker to generate configuration files with hardware + ethernet address references by using the option ----iiffrreeff==eetthh. Example: Target[myrouter]: !0a-0b-0c-0d:public@wellfleet-fddi.domain Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51&!0a-00-10-23-44-51:public@myrouter - Target[myrouter]: ifInErrors!0a-00-10-23-44-51&ifOutErrors!0a-00-10-23-44-51:public@myrouter + Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51& *BREAK* + 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51:public@myrouter + Target[myrouter]: ifInErrors!0a-00-10-23-44-51& *BREAK* + ifOutErrors!0a-00-10-23-44-51:public@myrouter + + Join the lines at *BREAK* ... Interface by Type - It seems that there are devices that try to defy all - monitoring efforts: the interesting interfaces have - neither ifName nor a constant ifDescr not to mention a - persistant ifIndex. The only way to get a constant - mapping is by looking at the interface type, because - the interface you are interested in is unique in the - device you are looking at ... + It seems that there are devices that try to defy all monitoring + efforts: the interesting interfaces have neither ifName nor a con- + stant ifDescr not to mention a persistant ifIndex. The only way to + get a constant mapping is by looking at the interface type, because + the interface you are interested in is unique in the device you are + looking at ... - You can tell cfgmaker to generate such references with - the option ----iiffrreeff==ttyyppee. + You can tell cfgmaker to generate such references with the option + ----iiffrreeff==ttyyppee. Example: Target[myrouter]: %13:public@wellfleet-fddi.domain Target[ezci]: -%13:public@ezci-ether.domain - Target[myrouter]: 1.3.6.1.2.1.2.2.1.14%13&1.3.6.1.2.1.2.2.1.14%14:public@myrouter Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter + Extended positioning of ifIndex + There are OIDs that contain the interface index at some inner posi- + tion within the OID. To use the above mentioned Interface by + IP/Description/Name/Type methods in the target definition the key- + word 'IndexPOS' can be used to indicate the position of ifIndex. If + 'IndexPOS' is not used the ifIndex will be appended at the end of + the OID. + + Example: + + Target[myrouter]: OID.IndexPOS.1/1.2.3.4&OID.IndexPOS.1/1.2.3.4:public@myrouter + + Replace OID by your numeric OID. + Extended Host Name Syntax - In all places where ``community@router'' is accepted, - you can add additional parameters for the SNMP commu- - nication using colon-separated suffixes. You can also - append a pipe symbol ( | ) and the name of a numeric - conversion subroutine as described under the global - keyword "ConversionCode" above. The full syntax is as - follows: + In all places where ``community@router'' is accepted, you can add + additional parameters for the SNMP communication using colon-sepa- + rated suffixes. You can also append a pipe symbol ( | ) and the + name of a numeric conversion subroutine as described under the + global keyword "ConversionCode" above. The full syntax is as fol- + lows: community@router[:[port][:[timeout][:[retries][:[backoff][:[version]][|name]]]]] where the meaning of each parameter is as follows: port - the UDP port under which to contact the SNMP agent - (default: 161) + the UDP port under which to contact the SNMP agent (default: + 161) + + The complete syntax of the port parameter is + + remote_port[!local_address[!local_port]] + + Some machines have additional security features that only allow + SNMP queries to come from certain IP addresses. If the host + doing the query has multiple interface, it may be necessary to + specify the interface the query should come from. + + The port parameter allows the specification of the port of the + machine being queried. In addition, the IP address (or host- + name) and port of the machine doing the query may be specified. + + Examples: + + somehost + somehost:161 + somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source + somehost:!192.168.2.4 use 192.168.2.4 as source + somehost:!!4000 use port 4000 as source timeout - initial timeout for SNMP queries, in seconds - (default: 2.0) + initial timeout for SNMP queries, in seconds (default: 2.0) retries - number of times a timed-out request will be - retried (default: 5) + number of times a timed-out request will be retried (default: + 5) backoff - factor by which the timeout is multiplied on every - retry (default: 1.0). + factor by which the timeout is multiplied on every retry + (default: 1.0). version - for SNMP version. If you have a fast router you - might want to put a '2' here. For authenticated - or encrypted SNMP, you can try to put a '3' here. - This will make mrtg try to poll the 64 bit coun- - ters and thus prevent excessive counter wrapping. - Not all routers support this though. SNMP v3 - requires additional setup, see SnmpOptions[] for - full details. + for SNMP version. If you have a fast router you might want to + put a '2' here. For authenticated or encrypted SNMP, you can + try to put a '3' here. This will make mrtg try to poll the 64 + bit counters and thus prevent excessive counter wrapping. Not + all routers support this though. SNMP v3 requires additional + setup, see SnmpOptions[] for full details. Example: 3:public@router1:::::2 name - the name of the subroutine that MRTG will call to - convert the input and output values to integers. - See the complete example under the global keyword - "ConversionCode" above. + the name of the subroutine that MRTG will call to convert the + input and output values to integers. See the complete example + under the global keyword "ConversionCode" above. Example: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice:161::::2|Length2Int - This would retrieve values from the OID - 1.3.6.1.4.1.999.1 for input and .2 for output on - mydevice using UDP port 161 and SNMP version 2, - and would execute the user-defined numeric conver- - sion subroutine Length2Int to convert those values - to integers. - - A value that equals the default value can be omitted. - Trailing colons can be omitted, too. The pipe symbol - followed by the name parameter, if present, must come - at the end. There must be no spaces around the colons - or pipe symbol. + This would retrieve values from the OID 1.3.6.1.4.1.999.1 for + input and .2 for output on mydevice using UDP port 161 and SNMP + version 2, and would execute the user-defined numeric conver- + sion subroutine Length2Int to convert those values to integers. + + A value that equals the default value can be omitted. Trailing + colons can be omitted, too. The pipe symbol followed by the name + parameter, if present, must come at the end. There must be no + spaces around the colons or pipe symbol. Example: Target[ezci]: 1:public@ezci-ether.domain:9161::4 - This would refer to the input/output octet counters - for the interface with _i_f_I_n_d_e_x _1 on _e_z_c_i_-_e_t_h_e_r_._d_o_m_a_i_n, - as known by the SNMP agent listening on UDP port 9161. - The standard initial timeout (2.0 seconds) is used, - but the number of retries is set to four. The backoff - value is the default. + This would refer to the input/output octet counters for the inter- + face with _i_f_I_n_d_e_x _1 on _e_z_c_i_-_e_t_h_e_r_._d_o_m_a_i_n, as known by the SNMP + agent listening on UDP port 9161. The standard initial timeout + (2.0 seconds) is used, but the number of retries is set to four. + The backoff value is the default. Numeric IPv6 addresses - If IPv6 is enabled you may also specify a target using - its IPv6 address. To avoid ambiguity with the port - number, numeric IPv6 addresses must be placed in - square brackets. + If IPv6 is enabled you may also specify a target using its IPv6 + address. To avoid ambiguity with the port number, numeric IPv6 + addresses must be placed in square brackets. Example: Target[IPv6test]: 2:public@[2001:760:4::]:6161::4 External Monitoring Scripts - If you want to monitor something which does not pro- - vide data via snmp you can use some external program - to do the data gathering. + If you want to monitor something which does not provide data via + snmp you can use some external program to do the data gathering. The external command must return 4 lines of output: Line 1 - current state of the first variable, normally - 'incoming bytes count' + current state of the first variable, normally 'incoming bytes + count' Line 2 - current state of the second variable, normally - 'outgoing bytes count' + current state of the second variable, normally 'outgoing bytes + count' Line 3 - string (in any human readable format), telling the - uptime of the target. + string (in any human readable format), telling the uptime of + the target. Line 4 string, telling the name of the target. - Depending on the type of data your script returns you - might want to use the 'gauge' or 'absolute' arguments - for the _O_p_t_i_o_n_s keyword. + Depending on the type of data your script returns you might want to + use the 'gauge' or 'absolute' arguments for the _O_p_t_i_o_n_s keyword. Example: Target[myrouter]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0` - Note the use of the backticks (`), not apostrophes (') - around the command. + Note the use of the backticks (`), not apostrophes (') around the + command. + + If you want to use a backtick in the command name this can be done + but you must escape it with a backslash ... - If you want to use a backtick in the command name this - can be done but you must escape it with a backslash - ... - - If your script does not have any data to return but - does not want mrtg to complain about invalid data, it - can return 'UNKNOWN' instead of a number. Note though - that only rrdtool is realy equipped to handle unknown - data well. + If your script does not have any data to return but does not want + mrtg to complain about invalid data, it can return 'UNKNOWN' + instead of a number. Note though that only rrdtool is realy + equipped to handle unknown data well. Multi Target Syntax - You can also combine several target definitions in a - mathematical expression. Any syntactically correct - expression that the Perl interpreter can evaluate to - will work. An expression could be used, for example, - to aggregate both B channels in an ISDN connection or - to calculate the percentage hard disk utilization of a - server from the absolute used space and total capac- - ity. + You can also combine several target definitions in a mathematical + expression. Any syntactically correct expression that the Perl + interpreter can evaluate to will work. An expression could be used, + for example, to aggregate both B channels in an ISDN connection or + to calculate the percentage hard disk utilization of a server from + the absolute used space and total capacity. Examples: Target[myrouter]: 2:public@wellfleetA + 1:public@wellfleetA - Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice / - 1.3.6.1.4.1.999.3&1.3.6.1.4.1.999.4:public@mydevice * 100 + Target[myrouter]: .1.3.6.1.4.1.999.1&.1.3.6.1.4.1.999.2:public@mydevice / + .1.3.6.1.4.1.999.3&.1.3.6.1.4.1.999.4:public@mydevice * 100 - Note that whitespace must surround each target defini- - tion in the expression. Target definitions themselves - must not contain whitespace, except in interface - descriptions and interface names, where each whites- - pace character is escaped by a backslash. - - MRTG automatically rounds the result of the expression - to an integer unless RRDTool logging is in use and the - gauge option is in effect for the target. Internally - MRTG uses Perl's Math::BigFloat package to calculate - the result of the expression with 40 digits of preci- - sion. Even in extreme cases, where, for example, you - take the difference of two 64-bit integers, the result - of the expression should be accurate. + Note that whitespace must surround each target definition in the + expression. Target definitions themselves must not contain whites- + pace, except in interface descriptions and interface names, where + each whitespace character is escaped by a backslash. + + MRTG automatically rounds the result of the expression to an inte- + ger unless RRDTool logging is in use and the gauge option is in + effect for the target. Internally MRTG uses Perl's Math::BigFloat + package to calculate the result of the expression with 40 digits of + precision. Even in extreme cases, where, for example, you take the + difference of two 64-bit integers, the result of the expression + should be accurate. SNMP Request Optimization - MRTG is designed to economize on its SNMP requests. - Where a target definition appears more than once in - the configuration file, MRTG requests the data from - the device only once per round of data collection and - uses the collected data for each instance of a partic- - ular target. Recognition of two target definitions as - being identical is based on a simple string match - rather than any kind of deeper semantic analysis. + MRTG is designed to economize on its SNMP requests. Where a target + definition appears more than once in the configuration file, MRTG + requests the data from the device only once per round of data col- + lection and uses the collected data for each instance of a particu- + lar target. Recognition of two target definitions as being identi- + cal is based on a simple string match rather than any kind of + deeper semantic analysis. Example: @@ -864,37 +867,32 @@ Target[Targ3]: 1:public@CiscoA + 2:public@CiscoA Target[Targ4]: 1:public@CISCOA - This results in a total of three SNMP requests. Data - for 1:public@CiscoA and 2:public@CiscoA are requested - only once each, and used for Targ1, Targ2, and Targ3. - Targ4 causes another SNMP request for 1:public@CISCOA, - which is not recognized as being identical to 1:pub- - lic@CiscoA. + This results in a total of three SNMP requests. Data for 1:pub- + lic@CiscoA and 2:public@CiscoA are requested only once each, and + used for Targ1, Targ2, and Targ3. Targ4 causes another SNMP request + for 1:public@CISCOA, which is not recognized as being identical to + 1:public@CiscoA. MMaaxxBByytteess - The maximum value either of the two variables monitored - are allowed to reach. For monitoring router traffic this - is normally the bytes per second this interface port can - carry. - - If a number higher than _M_a_x_B_y_t_e_s is returned, it is - ignored. Also read the section on _A_b_s_M_a_x for further - info. The _M_a_x_B_y_t_e_s value is also used in calculating the - Y range for unscaled graphs (see the section on _U_n_s_c_a_l_e_d). - - Since most links are rated in bits per second, you need to - divide their maximum bandwidth (in bits) by eight (8) in - order to get bytes per second. This is very important to - make your unscaled graphs display realistic information. - T1 = 193000, 56K = 7000, 10 MB Ethernet = 1250000, 100 MB - Ethernet = 12500000. The _M_a_x_B_y_t_e_s value will be used by - mrtg to decide whether it got a valid response from the - router. - - If you need two different MaxBytes values for the two mon- - itored variables, you can use MaxBytes1 and MaxBytes2 - instead of MaxBytes. + The maximum value either of the two variables monitored are allowed to + reach. For monitoring router traffic this is normally the bytes per + second this interface port can carry. + + If a number higher than _M_a_x_B_y_t_e_s is returned, it is ignored. Also read + the section on _A_b_s_M_a_x for further info. The _M_a_x_B_y_t_e_s value is also + used in calculating the Y range for unscaled graphs (see the section on + _U_n_s_c_a_l_e_d). + + Since most links are rated in bits per second, you need to divide their + maximum bandwidth (in bits) by eight (8) in order to get bytes per sec- + ond. This is very important to make your unscaled graphs display real- + istic information. T1 = 193000, 56K = 7000, 10 MB Ethernet = 1250000, + 100 MB Ethernet = 12500000. The _M_a_x_B_y_t_e_s value will be used by mrtg to + decide whether it got a valid response from the router. + + If you need two different MaxBytes values for the two monitored vari- + ables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes. Example: @@ -902,8 +900,7 @@ TTiittllee - Title for the HTML page which gets generated for the - graph. + Title for the HTML page which gets generated for the graph. Example: @@ -912,13 +909,12 @@ OOPPTTIIOONNAALL PPEERR TTAARRGGEETT KKEEYYWWOORRDDSS PPaaggeeTToopp - Things to add to the top of the generated HTML page. Note - that you can have several lines of text as long as the - first column is empty. - - Note that the continuation lines will all end up on the - same line in the html page. If you want linebreaks in the - generated html use the '\n' sequence. + Things to add to the top of the generated HTML page. Note that you can + have several lines of text as long as the first column is empty. + + Note that the continuation lines will all end up on the same line in + the html page. If you want linebreaks in the generated html use the + '\n' sequence. Example: @@ -929,29 +925,33 @@ RRoouutteerrUUppttiimmee - In cases where you calculate the used bandwidth from sev- - eral interfaces you normaly don't get the router uptime - and router name displayed on the web page. - - If these interfaces are on the same router and the uptime - and name should be displayed you have to specify its com- - munity and address again with the _R_o_u_t_e_r_U_p_t_i_m_e keyword. + In cases where you calculate the used bandwidth from several interfaces + you normaly don't get the router uptime and router name displayed on + the web page. + + If these interfaces are on the same router and the uptime and name + should be displayed you have to specify its community and address again + with the _R_o_u_t_e_r_U_p_t_i_m_e keyword. + + If you want to use a special OID for queriing the router uptime, use + prepend the oid. Example: Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250 RouterUptime[kacisco.comp.edu]: public@194.64.66.250 + RouterUptime[kacisco.comp.edu]: hrSystemUptime.0:public@194.64.66.250 + RRoouutteerrNNaammee - If the default name of the router is incorrect/uninforma- - tive, you can use RouterName to specify a different OID on - either the same or a different host. - - A practical example: sysName on BayTech DS72 units always - display "ds72", no matter what you set the Unit ID to be. - Instead, the Unit ID is stored at - 1.3.6.1.4.1.4779.1.1.3.0, so we can have MRTG display this + If the default name of the router is incorrect/uninformative, you can + use RouterName to specify a different OID on either the same or a dif- + ferent host. + + A practical example: sysName on BayTech DS72 units always display + "ds72", no matter what you set the Unit ID to be. Instead, the Unit ID + is stored at 1.3.6.1.4.1.4779.1.1.3.0, so we can have MRTG display this instead of sysName. Example: @@ -972,21 +972,19 @@ IIPPvv44OOnnllyy - Many IPv6 routers do not currently support SNMP over IPv6 - and must be monitored using IPv4. The IPv4Only option - forces mrtg to use IPv4 when communicating with the tar- - get, even if IPv6 is enabled. This is useful if the target - is a hostname with both IPv4 and IPv6 addresses; without - the IPv4Only keyword, monitoring such a router will not - work if IPv6 is enabled. - - If set to no (the default), mrtg will use IPv6 unless the - target has no IPv6 addresses, in which case it will use - IPv4. If set to yes, mrtg will only use IPv4. - - Note that if this option is set to yes and the target does - not have an IPv4 address, communication with the target - will fail. + Many IPv6 routers do not currently support SNMP over IPv6 and must be + monitored using IPv4. The IPv4Only option forces mrtg to use IPv4 when + communicating with the target, even if IPv6 is enabled. This is useful + if the target is a hostname with both IPv4 and IPv6 addresses; without + the IPv4Only keyword, monitoring such a router will not work if IPv6 is + enabled. + + If set to no (the default), mrtg will use IPv6 unless the target has no + IPv6 addresses, in which case it will use IPv4. If set to yes, mrtg + will only use IPv4. + + Note that if this option is set to yes and the target does not have an + IPv4 address, communication with the target will fail. This option has no effect if IPv6 is not enabled. @@ -997,30 +995,28 @@ SSnnmmppOOppttiioonnss ((VV33)) - SNMPv3 requires a fairly rich set of options. This per- - target keyword allows access to the User Security Model of - SNMPv3. Options are listed in the same syntax as a perl - hash. + SNMPv3 requires a fairly rich set of options. This per-target keyword + allows access to the User Security Model of SNMPv3. Options are listed + in the same syntax as a perl hash. _S_e_c_u_r_i_t_y _M_o_d_e_s - SNMPv3 has three security modes, defined on the device - being polled. For example, on Cisco routers the security - mode is defined by the snmp-server group global configura- - tion command. + SNMPv3 has three security modes, defined on the device being polled. + For example, on Cisco routers the security mode is defined by the snmp- + server group global configuration command. NoAuthNoPriv - Neither Authentication nor Privacy is defined. Only - the Username option is specified for this mode. + Neither Authentication nor Privacy is defined. Only the Username + option is specified for this mode. Example: SnmpOptions[myrouter]: username=>'user1' AuthNoPriv - Uses a Username and a password. The password can be - hashed using the snmpkey application, or passed in - plain text along with the ContextEngineID + Uses a Username and a password. The password can be hashed using + the snmpkey application, or passed in plain text along with the + ContextEngineID Example: @@ -1028,14 +1024,13 @@ contextengineid=>'80000001110000004000000' Priv - Both Authentication and Privacy is defined. The - default privacy protocol is des. + Both Authentication and Privacy is defined. The default privacy + protocol is des. Example: SnmpOptions[myrouter]: authkey=>'0x1e93ab5a396e2af234c8920e61cfe2028072c0e2', - authprotocol=>'sha',privprotocol=>'des',user- - name=>'user1', + authprotocol=>'sha',privprotocol=>'des',username=>'user1', privkey=>'0x498d74940c5872ed387201d74b9b25e2' _s_n_m_p _o_p_t_i_o_n_s @@ -1046,49 +1041,45 @@ The user associated with the User Security Model contextname - An SNMP agent can define multiple contexts. This key- - word allows them to be polled. + An SNMP agent can define multiple contexts. This keyword allows + them to be polled. contextengineid A unique 24-byte string identifying the snmp-agent. authpassword - The plaintext password for a user in either AuthNoPriv - or Priv mode. + The plaintext password for a user in either AuthNoPriv or Priv + mode. authkey - A md5 or sha hash of the plain-text password, along - with the engineid. Use the snmpkey commandline pro- - gram to generate this hash, or use Net::SNMP::Secu- - rity::USM in a script. + A md5 or sha hash of the plain-text password, along with the + engineid. Use the snmpkey commandline program to generate this + hash, or use Net::SNMP::Security::USM in a script. authprotocol {sha|md5} - The hashing algorithm defined on the SNMP client. - Defaults to md5. + The hashing algorithm defined on the SNMP client. Defaults to md5. privpassword - A plaintext pre-shared key for encrypting snmp packets - in Priv mode. + A plaintext pre-shared key for encrypting snmp packets in Priv + mode. privkey - A hash of the plain-text pre-shared key, along with - the engineid. Use the snmpkey commandline program to - generate this hash, or use Net::SNMP::Security::USM in - a script. + A hash of the plain-text pre-shared key, along with the engineid. + Use the snmpkey commandline program to generate this hash, or use + Net::SNMP::Security::USM in a script. privprotocol {des|3desede|aescfb128|aescfb192|aescfb256} - Specifies the encryption method defined on the snmp - agent. The default is des. + Specifies the encryption method defined on the snmp agent. The + default is des. PPaaggeeFFoooott - Things to add to the bottom of the generated HTML page. - Note that you can have several lines of text as long as - the first column is empty. - - Note that the continuation lines will all end up on the - same line in the html page. If you want linebreaks in the - generated html use the '\n' sequence. + Things to add to the bottom of the generated HTML page. Note that you + can have several lines of text as long as the first column is empty. + + Note that the continuation lines will all end up on the same line in + the html page. If you want linebreaks in the generated html use the + '\n' sequence. The material will be added just before the tag: @@ -1099,8 +1090,8 @@ AAddddHHeeaadd - Use this tag like the _P_a_g_e_T_o_p header, but its contents - will be added between and . + Use this tag like the _P_a_g_e_T_o_p header, but its contents will be added + between and . Example: @@ -1108,8 +1099,8 @@ BBooddyyTTaagg - BodyTag lets you supply your very own tag for - the generated webpages. + BodyTag lets you supply your very own tag for the generated + webpages. Example: @@ -1118,12 +1109,11 @@ AAbbssMMaaxx - If you are monitoring a link which can handle more traffic - than the _M_a_x_B_y_t_e_s value. Eg, a line which uses compression - or some frame relay link, you can use the _A_b_s_M_a_x keyword - to give the absolute maximum value ever to be reached. We - need to know this in order to sort out unrealistic values - returned by the routers. If you do not set _A_b_s_M_a_x, rateup + If you are monitoring a link which can handle more traffic than the + _M_a_x_B_y_t_e_s value. Eg, a line which uses compression or some frame relay + link, you can use the _A_b_s_M_a_x keyword to give the absolute maximum value + ever to be reached. We need to know this in order to sort out unrealis- + tic values returned by the routers. If you do not set _A_b_s_M_a_x, rateup will ignore values higher than _M_a_x_B_y_t_e_s. Example: @@ -1132,16 +1122,14 @@ UUnnssccaalleedd - By default each graph is scaled vertically to make the - actual data visible even when it is much lower than - _M_a_x_B_y_t_e_s. With the _U_n_s_c_a_l_e_d variable you can suppress - this. It's argument is a string, containing one letter - for each graph you don't want to be scaled: d=day w=week - m=month y=year. There is also a special case to unset the - variable completely: n=none. This could be useful in the - event you need to override a global configuration. In the - example scaling for the yearly and the monthly graph are - suppressed. + By default each graph is scaled vertically to make the actual data vis- + ible even when it is much lower than _M_a_x_B_y_t_e_s. With the _U_n_s_c_a_l_e_d vari- + able you can suppress this. It's argument is a string, containing one + letter for each graph you don't want to be scaled: d=day w=week m=month + y=year. There is also a special case to unset the variable completely: + n=none. This could be useful in the event you need to override a global + configuration. In the example scaling for the yearly and the monthly + graph are suppressed. Example: @@ -1149,13 +1137,12 @@ WWiitthhPPeeaakk - By default the graphs only contain the average values of - the monitored variables - normally the transfer rates for - incoming and outgoing traffic. The following option - instructs mrtg to display the peak 5 minute values in the - [w]eekly, [m]onthly and [y]early graph. In the example we - define the monthly and the yearly graph to contain peak as - well as average values. + By default the graphs only contain the average values of the monitored + variables - normally the transfer rates for incoming and outgoing traf- + fic. The following option instructs mrtg to display the peak 5 minute + values in the [w]eekly, [m]onthly and [y]early graph. In the example we + define the monthly and the yearly graph to contain peak as well as + average values. Examples: @@ -1163,11 +1150,10 @@ SSuupppprreessss - By default mrtg produces 4 graphs. With this option you - can suppress the generation of selected graphs. The - option value syntax is analogous to the above two options. - In this example we suppress the yearly graph as it is - quite empty in the beginning. + By default mrtg produces 4 graphs. With this option you can suppress + the generation of selected graphs. The option value syntax is analo- + gous to the above two options. In this example we suppress the yearly + graph as it is quite empty in the beginning. Example: @@ -1175,29 +1161,24 @@ EExxtteennssiioonn - By default, mrtg creates .html files. Use this option to - tell mrtg to use a different extension. For example you - could set the extension to php3, then you will be able to - enclose PHP tags into the output (useful for getting a - router name out of a database). + By default, mrtg creates .html files. Use this option to tell mrtg to + use a different extension. For example you could set the extension to + php3, then you will be able to enclose PHP tags into the output (useful + for getting a router name out of a database). Example: Extension[myrouter]: phtml - - DDiirreeccttoorryy - By default, mrtg puts all the files that it generates for - each target (the GIFs, the HTML page, the log file, etc.) - in _W_o_r_k_D_i_r. - - If the _D_i_r_e_c_t_o_r_y option is specified, the files are - instead put into a directory under _W_o_r_k_D_i_r or Log-, Image- - and HtmlDir). (For example the _D_i_r_e_c_t_o_r_y option below - would cause all the files for a target myrouter to be put - into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .) + By default, mrtg puts all the files that it generates for each target + (the GIFs, the HTML page, the log file, etc.) in _W_o_r_k_D_i_r. + + If the _D_i_r_e_c_t_o_r_y option is specified, the files are instead put into a + directory under _W_o_r_k_D_i_r or Log-, Image- and HtmlDir). (For example the + _D_i_r_e_c_t_o_r_y option below would cause all the files for a target myrouter + to be put into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .) The directory must already exist; mrtg will not create it. @@ -1206,17 +1187,16 @@ WorkDir: /usr/tardis/pub/www/stats/mrtg Directory[myrouter]: myrouter - NOTE: the Directory option must always be 'relative' or - bad things will happen. + NOTE: the Directory option must always be 'relative' or bad things will + happen. CClloonneeddiirreeccttoorryy - If the _D_i_r_e_c_t_o_r_y option is specified, the _C_l_o_n_e_d_i_r_e_c_t_o_r_y - option will copy all the contents of _D_i_r_e_c_t_o_r_y to the - _C_l_o_n_e_d_i_r_e_c_t_o_r_y. + If the _D_i_r_e_c_t_o_r_y option is specified, the _C_l_o_n_e_d_i_r_e_c_t_o_r_y option will + copy all the contents of _D_i_r_e_c_t_o_r_y to the _C_l_o_n_e_d_i_r_e_c_t_o_r_y. - As well as the _D_i_r_e_c_t_o_r_y option requires, the clone direc- - tory must already exist; mrtg will not create it. + As well as the _D_i_r_e_c_t_o_r_y option requires, the clone directory must + already exist; mrtg will not create it. Example: @@ -1224,17 +1204,15 @@ Directory[myrouter]: myrouter Clonedirectory[myrouter]: myclonedirectory - NOTE: the Clonedirectory option must always be 'relative' - or bad things will happen. + NOTE: the Clonedirectory option must always be 'relative' or bad things + will happen. XXSSiizzee aanndd YYSSiizzee - By default mrtgs graphs are 100 by 400 pixels wide (plus - some more for the labels. In the example we get almost - square graphs ... + By default mrtgs graphs are 100 by 400 pixels wide (plus some more for + the labels. In the example we get almost square graphs ... - Note: XSize must be between 20 and 600; YSize must be - larger than 20 + Note: XSize must be between 20 and 600; YSize must be larger than 20 Example: @@ -1243,22 +1221,18 @@ XXZZoooomm aanndd YYZZoooomm - If you want your graphs to have larger pixels, you can - "Zoom" them. + If you want your graphs to have larger pixels, you can "Zoom" them. Example: XZoom[myrouter]: 2.0 YZoom[myrouter]: 2.0 - - XXSSccaallee aanndd YYSSccaallee - If you want your graphs to be actually scaled use _X_S_c_a_l_e - and _Y_S_c_a_l_e. (Beware: while this works, the results look - ugly (to be frank) so if someone wants to fix this: - patches are welcome. + If you want your graphs to be actually scaled use _X_S_c_a_l_e and _Y_S_c_a_l_e. + (Beware: while this works, the results look ugly (to be frank) so if + someone wants to fix this: patches are welcome. Example: @@ -1267,26 +1241,24 @@ YYTTiiccss aanndd YYTTiiccssFFaaccttoorr - If you want to show more than 4 lines per graph, use - YTics. If you want to scale the value used for the YLe- - gend of these tics, use YTicsFactor. The default value - for YTics is 4 and the default value for YTicsFactor is - 1.0 . + If you want to show more than 4 lines per graph, use YTics. If you + want to scale the value used for the YLegend of these tics, use YTics- + Factor. The default value for YTics is 4 and the default value for + YTicsFactor is 1.0 . Example: - Suppose you get values ranging from 0 to 700. You want to - plot 7 lines and want to show 0, 1, 2, 3, 4, 5, 6, 7 - instead of 0, 100, 200, 300, 400, 500, 600, 700. You - should write then: + Suppose you get values ranging from 0 to 700. You want to plot 7 lines + and want to show 0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200, 300, + 400, 500, 600, 700. You should write then: YTics[myrouter]: 7 YTicsFactor[myrouter]: 0.01 FFaaccttoorr - If you want to multiply all numbers shown below the graph - with a constant factor, use this directive to define it .. + If you want to multiply all numbers shown below the graph with a con- + stant factor, use this directive to define it .. Example: @@ -1294,8 +1266,8 @@ SStteepp - Change the default step from 5 * 60 seconds to something - else (I have not tested this much ...) + Change the default step from 5 * 60 seconds to something else (I have + not tested this much ...) Example: @@ -1303,8 +1275,8 @@ PPNNGGTTiittllee - When using rateup for graph generation, this will print - the given title in the graph it generates. + When using rateup for graph generation, this will print the given title + in the graph it generates. Example: @@ -1312,38 +1284,34 @@ OOppttiioonnss - The _O_p_t_i_o_n_s Keyword allows you to set some boolean - switches: + The _O_p_t_i_o_n_s Keyword allows you to set some boolean switches: growright - The graph grows to the left by default. This option - flips the direction of growth causing the current time - to be at the right edge of the graph and the history - values to the left of it. + The graph grows to the left by default. This option flips the + direction of growth causing the current time to be at the right + edge of the graph and the history values to the left of it. bits - All the monitored variable values are multiplied by 8 - (i.e. shown in bits instead of bytes) ... looks much - more impressive :-) It also affects the 'factory - default' labeling and units for the given target. + All the monitored variable values are multiplied by 8 (i.e. shown + in bits instead of bytes) ... looks much more impressive :-) It + also affects the 'factory default' labeling and units for the given + target. perminute - All the monitored variable values are multiplied by 60 - (i.e. shown in units per minute instead of units per - second) in case of small values more accurate graphs - are displayed. It also affects the 'factory default' - labeling and units for the given target. + All the monitored variable values are multiplied by 60 (i.e. shown + in units per minute instead of units per second) in case of small + values more accurate graphs are displayed. It also affects the + 'factory default' labeling and units for the given target. perhour - All the monitored variable values are multiplied by - 3600 (i.e. shown in units per hour instead of units - per second) in case of small values more accurate - graphs are displayed. It also affects the 'factory - default' labeling and units for the given target. + All the monitored variable values are multiplied by 3600 (i.e. + shown in units per hour instead of units per second) in case of + small values more accurate graphs are displayed. It also affects + the 'factory default' labeling and units for the given target. noinfo - Suppress the information about uptime and device name - in the generated webpage. + Suppress the information about uptime and device name in the gener- + ated webpage. nopercent Don't print usage percentages. @@ -1352,158 +1320,136 @@ Make the background of the generated gifs transparent. integer - Print summary lines below graph as integers without - commas. + Print summary lines below graph as integers without commas. dorelpercent - The relative percentage of IN-traffic to OUT-traffic - is calculated and displayed in the graph as an addi- - tional line. Note: Only a fixed scale is available - (from 0 to 100%). Therefore if IN-traffic is greater - than OUT-traffic then 100% is displayed. If you sus- - pect that your IN-traffic is not always less than or - equal to your OUT-traffic you are urged to not use - this options. Note: If you use this option in combi- - nation with the _C_o_l_o_u_r_s options, a fifth colour-name - colour-value pair is required there. + The relative percentage of IN-traffic to OUT-traffic is calculated + and displayed in the graph as an additional line. Note: Only a + fixed scale is available (from 0 to 100%). Therefore if IN-traffic + is greater than OUT-traffic then 100% is displayed. If you suspect + that your IN-traffic is not always less than or equal to your OUT- + traffic you are urged to not use this options. Note: If you use + this option in combination with the _C_o_l_o_u_r_s options, a fifth + colour-name colour-value pair is required there. avgpeak - There are some ISPs who use the average Peak values to - bill their customers. Using this option MRTG displays - these values for each graph. The value is built by - averaging the max 5 minute traffic average for each - 'step' shown in the graph. For the Weekly graph this - means that it builds the average of all 2 hour inter- - vals 5 minute peak values. (Confused? Thought so!) + There are some ISPs who use the average Peak values to bill their + customers. Using this option MRTG displays these values for each + graph. The value is built by averaging the max 5 minute traffic + average for each 'step' shown in the graph. For the Weekly graph + this means that it builds the average of all 2 hour intervals 5 + minute peak values. (Confused? Thought so!) gauge - Treat the values gathered from target as 'current sta- - tus' measurements and not as ever incrementing coun- - ters. This would be useful to monitor things like - disk space, processor load, temperature, and the like - ... - - In the absence of 'gauge' or 'absolute' options, MRTG - treats variables as a counters and calculates the dif- - ference between the current and the previous value and - divides that by the elapsed time between the last two - readings to get the value to be plotted. + Treat the values gathered from target as 'current status' measure- + ments and not as ever incrementing counters. This would be useful + to monitor things like disk space, processor load, temperature, and + the like ... + + In the absence of 'gauge' or 'absolute' options, MRTG treats vari- + ables as a counters and calculates the difference between the cur- + rent and the previous value and divides that by the elapsed time + between the last two readings to get the value to be plotted. absolute - This is for counter type data sources which reset - their value when they are read. This means that rateup - does not have to build the difference between the cur- - rent and the last value read from the data source. The - value obtained is still divided by the elapsed time - between the current and the last reading, which makes - it different from the 'gauge' option. Useful for - external data gatherers. + This is for counter type data sources which reset their value when + they are read. This means that rateup does not have to build the + difference between the current and the last value read from the + data source. The value obtained is still divided by the elapsed + time between the current and the last reading, which makes it dif- + ferent from the 'gauge' option. Useful for external data gatherers. derive - If you are using rrdtool as logger/grapher you can use - a third type of data source. Derive is like counter, - except that it is not required to go UP all the time. - It is useful for situations where the change of some - value should be graphed. + If you are using rrdtool as logger/grapher you can use a third type + of data source. Derive is like counter, except that it is not + required to go UP all the time. It is useful for situations where + the change of some value should be graphed. unknaszero - Log unknown data as zero instead of the default - behaviour of repeating the last value seen. Be careful - with this, often a flat line in the graph is much more - obvious than a line at 0. + Log unknown data as zero instead of the default behaviour of + repeating the last value seen. Be careful with this, often a flat + line in the graph is much more obvious than a line at 0. withzeroes - Normally we ignore all values which are zero when cal- - culating the average transfer rate on a line. If this - is not desirable use this option. + Normally we ignore all values which are zero when calculating the + average transfer rate on a line. If this is not desirable use this + option. noborder - If you are using rateup to log data, MRTG will create - the graph images. Normally these images have a shaded - border around them. If you do not want the border to - be drawn, enable this option. This option has no - effect if you are not using rateup. + If you are using rateup to log data, MRTG will create the graph + images. Normally these images have a shaded border around them. If + you do not want the border to be drawn, enable this option. This + option has no effect if you are not using rateup. noarrow - As with the option above, this effects rateup graph - generation only. Normally rateup will generate graphs - with a small arrow showing the direction of the data. - If you do not want this arrow to be drawn, enable this - option. This option has no effect if you are not using - rateup. - - noi When using rateup for graph generation, you can use - this option to stop rateup drawing a graph for the 'I' - or first variable. This also removes entries for this - variable in the HTML page MRTG generates, and will - remove the peaks for this variable if they are - enabled. This allows you to hide this data, or can be - very useful if you are only graphing one line of data - rather than two. This option is not destructive - any - data received for the the variable continued to be - logged, it just isn't shown. + As with the option above, this effects rateup graph generation + only. Normally rateup will generate graphs with a small arrow show- + ing the direction of the data. If you do not want this arrow to be + drawn, enable this option. This option has no effect if you are not + using rateup. + + noi When using rateup for graph generation, you can use this option to + stop rateup drawing a graph for the 'I' or first variable. This + also removes entries for this variable in the HTML page MRTG gener- + ates, and will remove the peaks for this variable if they are + enabled. This allows you to hide this data, or can be very useful + if you are only graphing one line of data rather than two. This + option is not destructive - any data received for the the variable + continued to be logged, it just isn't shown. - noo Same as above, except relating to the 'O' or second - variable. + noo Same as above, except relating to the 'O' or second variable. nobanner - When using rateup for graph generation, this option - disables MRTG adding the MRTG banner to the HTML pages - it generates. + When using rateup for graph generation, this option disables MRTG + adding the MRTG banner to the HTML pages it generates. nolegend - When using rateup for graph generation, this option - will stop MRTG from creating a legend at the bottom of - the HTML pages it generates. + When using rateup for graph generation, this option will stop MRTG + from creating a legend at the bottom of the HTML pages it gener- + ates. printrouter - When using rateup for graph generation, this option - will print the router name in the graph it generates. - This option is overridden by the value of PNGTitle if - one is given + When using rateup for graph generation, this option will print the + router name in the graph it generates. This option is overridden + by the value of PNGTitle if one is given pngdate - When using rateup for graph generation, this option - will print a timestamp in the graph it generates, - including a timezone if one is specified by the 'Time- - zone' parameter. + When using rateup for graph generation, this option will print a + timestamp in the graph it generates, including a timezone if one is + specified by the 'Timezone' parameter. logscale - The llooggssccaallee option causes rateup to display the data - with the Y axis scaled logarithmically. Doing so - allows the normal traffic to occupy the majority of - the vertical range, while still showing any spikes at - their full height. - - llooggssccaallee displays all the available data and will - always produce well-behaved graphs. People often con- - sider a logarithmically scaled graph counterintuitive, - however, and thus hard to interpret. + The llooggssccaallee option causes rateup to display the data with the Y + axis scaled logarithmically. Doing so allows the normal traffic to + occupy the majority of the vertical range, while still showing any + spikes at their full height. + + llooggssccaallee displays all the available data and will always produce + well-behaved graphs. People often consider a logarithmically + scaled graph counterintuitive, however, and thus hard to interpret. expscale - The eexxppssccaallee option causes rateup to display the data - with the Y axis scaled exponentially. Doing so empha- - sizes small changes at the top of the scale; this can - be useful when graphing values that fluctuate by a - small amount near the top of the scale, such as line + The eexxppssccaallee option causes rateup to display the data with the Y + axis scaled exponentially. Doing so emphasizes small changes at + the top of the scale; this can be useful when graphing values that + fluctuate by a small amount near the top of the scale, such as line voltage. eexxppssccaallee is essentially the inverse of llooggssccaallee. secondmean - The sseeccoonnddmmeeaann option sets the maximum value on the - graph to the mean of the data greater than the mean of - all data. This produces a graph that focuses more on - the typical data, while clipping large peaks. - - Using sseeccoonnddmmeeaann will give a more intutive linearly - scaled graph, but can result in a uselessly high or - low scale in some rare situations (specifically, when - the data includes a large portion of values far from - the actual mean) + The sseeccoonnddmmeeaann option sets the maximum value on the graph to the + mean of the data greater than the mean of all data. This produces + a graph that focuses more on the typical data, while clipping large + peaks. + + Using sseeccoonnddmmeeaann will give a more intutive linearly scaled graph, + but can result in a uselessly high or low scale in some rare situa- + tions (specifically, when the data includes a large portion of val- + ues far from the actual mean) - If a target includes both llooggssccaallee and sseeccoonnddmmeeaann in - the options, the sseeccoonnddmmeeaann takes precedence. + If a target includes both llooggssccaallee and sseeccoonnddmmeeaann in the options, + the sseeccoonnddmmeeaann takes precedence. Example: @@ -1511,9 +1457,9 @@ kkiilloo - Use this option to change the multiplier value for build- - ing prefixes. Defaultvalue is 1000. This tag is for the - special case that 1kB = 1024B, 1MB = 1024kB and so far. + Use this option to change the multiplier value for building prefixes. + Defaultvalue is 1000. This tag is for the special case that 1kB = + 1024B, 1MB = 1024kB and so far. Example: @@ -1521,16 +1467,14 @@ kkMMGG - Change the default multiplier prefixes (,k,M,G,T,P). In - the tag _S_h_o_r_t_L_e_g_e_n_d define only the basic units. Format: - Comma seperated list of prefixed. Two consecutive commas - or a comma at start or end of the line gives no prefix on - this item. If you do not want prefixes, just put two con- - secutive commas. If you want to skip a magnitude select - '-' as value. + Change the default multiplier prefixes (,k,M,G,T,P). In the tag _S_h_o_r_t_- + _L_e_g_e_n_d define only the basic units. Format: Comma seperated list of + prefixed. Two consecutive commas or a comma at start or end of the line + gives no prefix on this item. If you do not want prefixes, just put + two consecutive commas. If you want to skip a magnitude select '-' as + value. - Example: velocity in nm/s (nanometers per second) dis- - played in nm/h. + Example: velocity in nm/s (nanometers per second) displayed in nm/h. ShortLegend[myrouter]: m/h kMG[myrouter]: n,u,m,,k,M,G,T,P @@ -1538,17 +1482,16 @@ CCoolloouurrss - The _C_o_l_o_u_r_s tag allows you to override the default colour - scheme. Note: All 4 of the required colours must be spec- - ified here. The colour name ('Colourx' below) is the leg- - end name displayed, while the RGB value is the real colour - used for the display, both on the graph and in the html - doc. + The _C_o_l_o_u_r_s tag allows you to override the default colour scheme. + Note: All 4 of the required colours must be specified here. The colour + name ('Colourx' below) is the legend name displayed, while the RGB + value is the real colour used for the display, both on the graph and in + the html doc. Format is: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB - Important: If you use the _d_o_r_e_l_p_e_r_c_e_n_t options tag a fifth - colour name colour value pair is required: + Important: If you use the _d_o_r_e_l_p_e_r_c_e_n_t options tag a fifth colour name + colour value pair is required: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB,Col5#RRGGBB Colour1 @@ -1572,31 +1515,24 @@ BBaacckkggrroouunndd - With the _B_a_c_k_g_r_o_u_n_d tag you can configure the background - colour of the generated HTML page. + With the _B_a_c_k_g_r_o_u_n_d tag you can configure the background colour of the + generated HTML page. Example: Background[myrouter]: #a0a0a0a - - - - YYLLeeggeenndd,, SShhoorrttLLeeggeenndd,, LLeeggeenndd[[11223344]] - The following keywords allow you to override the text dis- - played for the various legends of the graph and in the - HTML document: + The following keywords allow you to override the text displayed for the + various legends of the graph and in the HTML document: YLegend - The Y-axis label of the graph. Note that a text which - is too long to fit in the graph will be silently - ignored. + The Y-axis label of the graph. Note that a text which is too long + to fit in the graph will be silently ignored. ShortLegend - The units string (default 'b/s') used for Max, Average - and Current + The units string (default 'b/s') used for Max, Average and Current Legend[1234IO] The strings for the colour legend. @@ -1612,45 +1548,40 @@ LegendI[myrouter]:  In: LegendO[myrouter]:  Out: - Note, if _L_e_g_e_n_d_I or _L_e_g_e_n_d_O are set to an empty string - with + Note, if _L_e_g_e_n_d_I or _L_e_g_e_n_d_O are set to an empty string with LegendO[myrouter]: - The corresponding line below the graph will not be printed - at all. + The corresponding line below the graph will not be printed at all. TTiimmeezzoonnee - If you live in an international world, you might want to - generate the graphs in different timezones. This is set in - the TZ variable. Under certain operating systems like - Solaris, this will provoke the localtime call to give the - time in the selected timezone. + If you live in an international world, you might want to generate the + graphs in different timezones. This is set in the TZ variable. Under + certain operating systems like Solaris, this will provoke the localtime + call to give the time in the selected timezone. Example: Timezone[myrouter]: Japan - The Timezone is the standard timezone of your system, ie - Japan, Hongkong, GMT, GMT+1 etc etc. + The Timezone is the standard timezone of your system, ie Japan, + Hongkong, GMT, GMT+1 etc etc. WWeeeekkffoorrmmaatt - By default, mrtg (actually rateup) uses the _s_t_r_f_t_i_m_e(3) - '%V' option to format week numbers in the monthly graphs. - The exact semantics of this format option vary between - systems. If you find that the week numbers are wrong, and - your system's _s_t_r_f_t_i_m_e(3) routine supports it, you can try - another format option. The POSIX '%V' option correspond - to the widely used ISO 8601 week numbering standard. The - week format character should be specified as a single let- - ter; either W, V, or U. - - The UNIX version of rateup uses the libc implementation of - strftime. On Windows, the native strftime implementation - does not know about %V. So there we use a different imple- - mentation of strftime that does support %V. + By default, mrtg (actually rateup) uses the _s_t_r_f_t_i_m_e(3) '%V' option to + format week numbers in the monthly graphs. The exact semantics of this + format option vary between systems. If you find that the week numbers + are wrong, and your system's _s_t_r_f_t_i_m_e(3) routine supports it, you can + try another format option. The POSIX '%V' option correspond to the + widely used ISO 8601 week numbering standard. The week format charac- + ter should be specified as a single letter; either W, V, or U. + + The UNIX version of rateup uses the libc implementation of strftime. + On Windows, the native strftime implementation does not know about %V. + So there we use a different implementation of strftime that does sup- + port %V. Example: @@ -1658,25 +1589,37 @@ RRRRDDRRoowwCCoouunntt - This affects the creation of new rrd files. By default - rrds are created to hold about 1 day's worth of high reso- - lution data. (plus 1 week of 30 minute data, 2 months of 2 - hour data and 2 years of 1 day data). With this Keyword - you can change the number of base interval entries config- - ured for new rrds as they get created. Note that you must - take the interval time into account. + This affects the creation of new rrd files. By default rrds are created + to hold about 1 day's worth of high resolution data. (plus 1 week of 30 + minute data, 2 months of 2 hour data and 2 years of 1 day data). With + this Keyword you can change the number of base interval entries config- + ured for new rrds as they get created. Note that you must take the + interval time into account. Example: RRDRowCount[myrouter]: 1600 + RRRRDDHHWWRRRRAAss + + Normally the RRDs created by MRTG will just contain the information + gathered directly from the respective target. With this option you can + tap into rrdtools advanced aberrant behaviour detection module based on + Holt-Winters forecasting. The RRDHWRRAs property specifies the Holt- + Winters RRAs as described in the rrdcreate manual page. + + Note, this setting will only affect newly created RRDs (targets). + + Example: + + RRDHWRRAs[myrouter]: RRA:HWPREDICT:1440:0.1:0.0035:288 + TTiimmeeSSttrrPPooss - This defines placement of the timestamp string on the - image. Possible values are RU, LU, RL, LL (which stand, - respectively, for RightUpper, LeftUpper, RightLower and - LeftLower corner) and NO (for no timestamp). By default, - no timestamp is placed on the image. + This defines placement of the timestamp string on the image. Possible + values are RU, LU, RL, LL (which stand, respectively, for RightUpper, + LeftUpper, RightLower and LeftLower corner) and NO (for no timestamp). + By default, no timestamp is placed on the image. Example: @@ -1684,11 +1627,10 @@ TTiimmeeSSttrrFFmmtt - Using this keyword you may specify format of the timestamp - to be placed on the image (if enabled by the TimeStrPos - keyword). Specified string will be used by the _s_t_r_f_t_i_m_e_(_) - function - see _s_t_r_f_t_i_m_e(3) documentation for conversion - specifiers available on your system. Default format: + Using this keyword you may specify format of the timestamp to be placed + on the image (if enabled by the TimeStrPos keyword). Specified string + will be used by the _s_t_r_f_t_i_m_e_(_) function - see _s_t_r_f_t_i_m_e(3) documentation + for conversion specifiers available on your system. Default format: %Y-%m-%d %H:%M Example: @@ -1696,127 +1638,166 @@ TimeStrFmt[myrouter]: %H:%M:%S TTHHRREESSHHOOLLDD CCHHEECCKKIINNGG - Through its threshold checking functionality mrtg is able - to detect threshold problems for the various targets and - can call external scripts to handle those problems (e.g. - send email or a page to an administrator). + Through its threshold checking functionality mrtg is able to detect + threshold problems for the various targets and can call external + scripts to handle those problems (e.g. send email or a page to an + administrator). - Threshold checking is configured through the following - parameters: + Threshold checking is configured through the following parameters: TThhrreesshhDDiirr ((GGLLOOBBAALL)) - By defining ThreshDir to point to a writable directory, - MRTG will only alert you when a threshold boundery has - been crossed. + By defining ThreshDir to point to a writable directory, MRTG will only + alert you when a threshold boundery has been crossed. Example: ThreshDir: /var/mrtg/thresh + TThhrreesshhHHyysstt ((GGLLOOBBAALL)) + + If a threshold is broken, and you have a threshdir defined, then mrtg + will send mail once the threshold becomes 'unborken' to avoid situa- + tions where broken and un-broken messages get sent in close succession, + we only send an unbroken message once the curent value is 0.1 (10%) + away from the threshold. using the ThreshHyst config variable you can + customize this value. + + Example for 5%: + + ThreshHyst: 0.05 + + TThhrreesshhMMaaiillSSeerrvveerr ((GGLLOOBBAALL)) + + Adderss of an SMTP server which is going to accept mail about Thresh- + olds being broken and unbroken. + + TThhrreesshhMMaaiillSSeennddeerr ((GGLLOOBBAALL)) + + What is the sender address of the threshold mail. + + Example: + + ThreshMailSender: mrtg@example.com + + TThhrreesshhMMaaiillAAddddrreessss ((PPEERR TTAARRGGEETT)) + + Email address for Threshold related Mails. This will only work if a + mailserver has been configured. + + Example: + + ThreshMailAddress[_]: admin@example.com + ThreshMailAddress[router]: + + This would bring threshold releaed mail to all but the target called + 'router'. TThhrreesshhMMiinnII ((PPEERR TTAARRGGEETT)) - This is the minimum acceptable value for the Input (first) - parameter. If the parameter falls below this value, the - program specified in ThreshProgI will be run. If the value - ends in '%' then the threshold is defined relative to - MaxBytes. + This is the minimum acceptable value for the Input (first) parameter. + If the parameter falls below this value, the program specified in + ThreshProgI will be run and a mail will be sent to the ThreshMailAd- + dress if specified. If the value ends in '%' then the threshold is + defined relative to MaxBytes. TThhrreesshhMMaaxxII ((PPEERR TTAARRGGEETT)) - This is the maximum acceptable value for the Input (first) - parameter. If the parameter falls above this value, the - program specified in ThreshProgI will be run. If the value - ends in '%' then the threshold is defined relative to - MaxBytes. + Works the same as TheshMinI but it acts when the value is higher than + ThreshMaxI. TThhrreesshhDDeesscc ((PPEERR TTAARRGGEETT)) - Its value will be assigned to the environment variable - THRESH_DESC before any of the programs mentioned below are - called. The programms can use the value of this variable - to produce more user-friendly output. + Its value will be assigned to the environment variable THRESH_DESC + before any of the programs mentioned below are called. The programms + can use the value of this variable to produce more user-friendly out- + put. TThhrreesshhPPrrooggII ((PPEERR TTAARRGGEETT)) - This defines a program to be run if ThreshMinI or Thresh- - MaxI is broken. MRTG passes 3 arguments: the $router - variable, the threshold value broken, and the current - parameter value. + This defines a program to be run if ThreshMinI or ThreshMaxI is broken. + MRTG passes 3 arguments: the $router variable, the threshold value bro- + ken, and the current parameter value. TThhrreesshhPPrrooggOOKKII ((PPEERR TTAARRGGEETT)) - This defines a program to be run if the parameter is cur- - rently OK (based on ThreshMinI and ThreshMaxI), but wasn't - OK on the previous running -- based on the files found in - ThreshDir. MRTG passes 3 arguments: the $router variable - the unbroken threshold value, and the current parameter - value. + This defines a program to be run if the parameter is currently OK + (based on ThreshMinI and ThreshMaxI), but wasn't OK on the previous + running -- based on the files found in ThreshDir. MRTG passes 3 argu- + ments: the $router variable the unbroken threshold value, and the cur- + rent parameter value. TThhrreesshhMMiinnOO,, TThhrreesshhMMaaxxOO,, TThhrreesshhPPrrooggOO,, aanndd TThhrreesshhPPrrooggOOKKOO - These work the same as their *I counterparts, except on - the Output (second) parameter. - - _N_o_t_e _t_h_a_t _y_o_u _c_a_n _u_s_e _t_h_e _S_e_t_E_n_v _p_a_r_a_m_e_t_e_r _e_x_p_l_a_i_n_e_d _a_b_o_v_e - _t_o _p_a_s_s _a_d_d_i_t_i_o_n_a_l _i_n_f_o_r_m_a_t_i_o_n _t_o _t_h_e _t_h_r_e_s_h_o_l_d _p_r_o_g_r_a_m_s_. + These work the same as their *I counterparts, except on the Output + (second) parameter. SSeettEEnnvv - When calling threshold scripts from within your cfg file - you might want to pass some data on to the script. This - can be done with the SetEnv configuration option which - takes a series of environment variable assignments. Note - that the quotes are mandatory. This does not work for - external scripts. It is not possible to set environment - variables per target. + When calling threshold scripts from within your cfg file you might want + to pass some data on to the script. This can be done with the SetEnv + configuration option which takes a series of environment variable + assignments. Note that the quotes are mandatory. This does not work for + external scripts. It is not possible to set environment variables per + target. Example: SetEnv[myrouter]: EMAIL="contact_email@someplace.net" HOST="www.some_server.net" -PPEERR TTAARRGGEETT DDEEFFAAUULLTT VVAALLUUEESS + HHWW FFaaiilluurree BBaasssseedd TThhrreesshhooll CChheecckkiinngg + When using rrd based logging with HW RRAs defined. You can use the con- + fidence bounds violations stored in the FAILURES RRA for threshold + based alerts. + There the all target specific threshold variables have a Hold-Winters + counterpart: + ThreshMailAddress -> HWThreshMailAddress + ThreshMinI -> HWThreshMinI + ... + + The global variables for threshold checking are shared except for the + + ThreshHyst -> HWThreshHyst + + And HWThreshDesc sets the HWTHRESH_DESC variable. + +PPEERR TTAARRGGEETT DDEEFFAAUULLTT VVAALLUUEESS PPrree-- aanndd PPoossttffiixx - To save yourself some typing you can define a target - called '^'. The text of every Keyword you define for this - target will be PREPENDED to the corresponding Keyword of - all the targets defined below this line. The same goes for - a Target called '$' but its text will be APPENDED. - - Note that a space is inserted between the prepended text - and the Keyword value, as well as between the Keyword - value and the appended text. This works well for text-val- - ued Keywords, but is not very useful for other Keywords. - See the "default" target description below. - - The example will make mrtg use a common header and a com- - mon contact person in all the pages generated from targets - defined later in this file. + To save yourself some typing you can define a target called '^'. The + text of every Keyword you define for this target will be PREPENDED to + the corresponding Keyword of all the targets defined below this line. + The same goes for a Target called '$' but its text will be APPENDED. + + Note that a space is inserted between the prepended text and the Key- + word value, as well as between the Keyword value and the appended text. + This works well for text-valued Keywords, but is not very useful for + other Keywords. See the "default" target description below. + + The example will make mrtg use a common header and a common contact + person in all the pages generated from targets defined later in this + file. Example: PageTop[^]:

NoWhere Unis Traffic Stats


PageTop[$]: Contact Peter Norton if you have any questions
- To remove the prepend/append value, specify an empty - value, e.g.: + To remove the prepend/append value, specify an empty value, e.g.: PageTop[^]: PageTop[$]: NNooSSppaacceeCChhaarr - With PREPEND and APPEND (see below) there is normally a - space inserted between the local value and the PRE- or - APPEND value. Sometimes this is not desirable. You can use - the global option _N_o_S_p_a_c_e_C_h_a_r to define a character which - can be mentioned at the end of a $ or ^ definition in + With PREPEND and APPEND (see below) there is normally a space inserted + between the local value and the PRE- or APPEND value. Sometimes this is + not desirable. You can use the global option _N_o_S_p_a_c_e_C_h_a_r to define a + character which can be mentioned at the end of a $ or ^ definition in order to supress the space. Example: @@ -1830,10 +1811,9 @@ DDeeffaauulltt VVaalluueess - The target name '_' specifies a default value for that - Keyword. In the absence of explicit Keyword value, the - prepended and the appended keyword value, the default - value will be used. + The target name '_' specifies a default value for that Keyword. In the + absence of explicit Keyword value, the prepended and the appended key- + word value, the default value will be used. Example: @@ -1843,17 +1823,16 @@ Suppress[_]: y MaxBytes[_]: 1250000 - To remove the default value and return to the 'factory - default', specify an empty value, e.g.: + To remove the default value and return to the 'factory default', spec- + ify an empty value, e.g.: YLegend[_]: - There can be several instances of setting the - default/prepend/append values in the configuration file. - The later setting replaces the previous one for the rest - of the configuration file. The default/prepend/append - values used for a given keyword/target pair are the ones - that were in effect at the point in the configuration file + There can be several instances of setting the default/prepend/append + values in the configuration file. The later setting replaces the previ- + ous one for the rest of the configuration file. The + default/prepend/append values used for a given keyword/target pair are + the ones that were in effect at the point in the configuration file where the target was mentioned for the first time. Example: @@ -1863,59 +1842,54 @@ MaxBytes[_]: 8000 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2 - The default _M_a_x_B_y_t_e_s for the target myrouter.some- - place.edu.2 in the above example will be 1250000, which - was in effect where the target name myrouter.some- - place.edu.2 first appeared in the config file. + The default _M_a_x_B_y_t_e_s for the target myrouter.someplace.edu.2 in the + above example will be 1250000, which was in effect where the target + name myrouter.someplace.edu.2 first appeared in the config file. CCOOMMMMAANNDD LLIINNEE OOPPTTIIOONNSS ----uusseerr _u_s_e_r_n_a_m_e and ----ggrroouupp _g_r_o_u_p_n_a_m_e Run as the given user and/or group. (Unix Only) ----lloocckk--ffiillee _f_i_l_e_n_a_m_e - Use an alternate lock-file (the default is to use the - configuration-file appended with "_l"). + Use an alternate lock-file (the default is to use the configura- + tion-file appended with "_l"). ----ccoonnffccaacchhee--ffiillee _f_i_l_e_n_a_m_e - Use an alternate confcache-file (the default is to use - the configuration-file appended with ".ok") + Use an alternate confcache-file (the default is to use the configu- + ration-file appended with ".ok") ----llooggggiinngg _f_i_l_e_n_a_m_e|eevveennttlloogg - If this is set to writable filename, all output from - mrtg (warnings, debug messages, errors) will go to - _f_i_l_e_n_a_m_e. If you are running on Win32 you can specify - eevveennttlloogg instead of a filename which will send all - error to the windows event log. - - NNOOTTEE:: Note, there is no Message DLL for mrtg included - with mrtg. This has the side effect that the windows - event logger will display a nice message with every - entry in the event log, complaing about the fact that - mrtg has no message dll. If you go to the mrtg contrib - download area (on the website) you will find the - mrtg-message-dll.zip which does contain such a thing. + If this is set to writable filename, all output from mrtg (warn- + ings, debug messages, errors) will go to _f_i_l_e_n_a_m_e. If you are run- + ning on Win32 you can specify eevveennttlloogg instead of a filename which + will send all error to the windows event log. + + NNOOTTEE:: Note, there is no Message DLL for mrtg included with mrtg. + This has the side effect that the windows event logger will display + a nice message with every entry in the event log, complaing about + the fact that mrtg has no message dll. If you go to the mrtg con- + trib download area (on the website) you will find the mrtg-mes- + sage-dll.zip which does contain such a thing. ----ddaaeemmoonn - Put MRTG into the background, running as a daemon. - This works the same way as the config file option, but - the switch is required for proper FHS operation - (because /var/run is writable only by root) + Put MRTG into the background, running as a daemon. This works the + same way as the config file option, but the switch is required for + proper FHS operation (because /var/run is writable only by root) ----ffhhss - Configure all mrtg paths to conform to the FHS speci- - fication; http://www.pathname.com/fhs/ + Configure all mrtg paths to conform to the FHS specification; + http://www.pathname.com/fhs/ ----cchheecckk - Only check the cfg file for errors. Do not do any- - thing. + Only check the cfg file for errors. Do not do anything. ----ppiidd--ffiillee==ss - Define the name and path of the pid file for mrtg run- - ning as a daemon + Define the name and path of the pid file for mrtg running as a dae- + mon ----ddeebbuugg==ss - Enable debug options. The argument of the debug option - is a comma separated list of debug values: + Enable debug options. The argument of the debug option is a comma + separated list of debug values: cfg - watch the config file reading dir - directory mangeling @@ -1927,18 +1901,18 @@ time - some timing info log - logging of data via rateup or rrdtool eval - print eval strings before evaluting them + prof - add hires timing info the rrd calls Example: --debug="cfg,snpo" EEXXIITT CCOODDEESS - An exit code of 0 indicates that all targets were success- - ful. Generally speaking, most codes greater than 0 indi- - cate that there was an unrecoverable problem. One excep- - tion to this is code 91, which indicates that at least one - of the targets was succesful. A partial listing of the - codes follows: + An exit code of 0 indicates that all targets were successful. Gener- + ally speaking, most codes greater than 0 indicate that there was an + unrecoverable problem. One exception to this is code 91, which indi- + cates that at least one of the targets was succesful. A partial list- + ing of the codes follows: 0: All targets sucessful @@ -1989,4 +1963,4 @@ -2.14.7 2006-09-06 MRTG-REFERENCE(1) +2.16.1 2008-02-17 MRTG-REFERENCE(1) diff -Nru mrtg-2.14.7/doc/mrtg-rrd.1 mrtg-2.16.1/doc/mrtg-rrd.1 --- mrtg-2.14.7/doc/mrtg-rrd.1 2006-09-06 14:42:53.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-rrd.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-RRD 1" -.TH MRTG-RRD 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-RRD 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-rrd \- How to use RRDtool with MRTG .SH "SYNOPSIS" diff -Nru mrtg-2.14.7/doc/mrtg-rrd.txt mrtg-2.16.1/doc/mrtg-rrd.txt --- mrtg-2.14.7/doc/mrtg-rrd.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-rrd.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-RRD(1) mrtg MRTG-RRD(1) +MRTG-RRD(1) mrtg MRTG-RRD(1) @@ -6,29 +6,28 @@ mrtg-rrd - How to use RRDtool with MRTG SSYYNNOOPPSSIISS - After using MRTG for some time you may find some limita- - tions, mostly in the areas of performance and graphing - flexibility. These are exactly the areas addressed by RRD- - tool. To learn more about RRDtool check out its website on + After using MRTG for some time you may find some limitations, mostly in + the areas of performance and graphing flexibility. These are exactly + the areas addressed by RRDtool. To learn more about RRDtool check out + its website on http://oss.oetiker.ch/rrdtool RRRRDDTTOOOOLL IINNTTEEGGRRAATTIIOONN - When using mrtg with RRDtool you are replacing _r_a_t_e_u_p with - the RRDtool perl module _R_R_D_s_._p_m. To enable RRDtool support - in mrtg you have to add the line + When using mrtg with RRDtool you are replacing _r_a_t_e_u_p with the RRDtool + perl module _R_R_D_s_._p_m. To enable RRDtool support in mrtg you have to add + the line LogFormat: rrdtool to your mrtg config file. - MRTG needs access to both the RRDtool perl module RRRRDDss..ppmm - and to the rrrrddttooooll executable. + MRTG needs access to both the RRDtool perl module RRRRDDss..ppmm and to the + rrrrddttooooll executable. - If these two items are not installed in locations where - perl can find them on its own, then you can use the fol- - lowing two parameters to supply the appropriate directo- - ries. + If these two items are not installed in locations where perl can find + them on its own, then you can use the following two parameters to sup- + ply the appropriate directories. For the location of the rrrrddttooooll executable you put @@ -46,79 +45,68 @@ LibAdd: c:\rrdtool\bin\lib\perl - When you have made this modification to the configuration - file, several things will happen when you run mrtg again - with the new config file: - - 1. mrtg will take all your old ".log" files and ccoonnvveerrtt - them to ".rrd" format. (The ".log" files don't get - touched in the process, so if things don't work out - they are still there.) - - 2. mrtg will use rrrrddttooooll to update its databases. These - will have a new format called _r_r_d which is totally - different than the native _l_o_g format of the classic - mrtg. - - 3. mrtg will nnoott create any webpages of graphs anymore. - It will only query the routers for traffic information - and update its _r_r_d databases. - - The advantage of whole thing is that the mrtg will become - mmuucchh faster. Expect the runtime to drop to 20% of the pre- - vious value. (I would like to get some feedback on this - from folks with large installations.) - - Mind you, though, while the logging process of RRDtool is - vveerryy fast, you are also gaining some time by neither cre- - ating graphs nor updating webpages. The idea behind this - is that it is more efficient to create graphs and webpages - on demand by using a cgi script. + When you have made this modification to the configuration file, several + things will happen when you run mrtg again with the new config file: - At the moment there is no ooffffiicciiaall script to do this, but - two contributers have created such scripts: + 1. mrtg will take all your old ".log" files and ccoonnvveerrtt them to ".rrd" + format. (The ".log" files don't get touched in the process, so if + things don't work out they are still there.) + + 2. mrtg will use rrrrddttooooll to update its databases. These will have a + new format called _r_r_d which is totally different than the native + _l_o_g format of the classic mrtg. + + 3. mrtg will nnoott create any webpages of graphs anymore. It will only + query the routers for traffic information and update its _r_r_d + databases. + + The advantage of whole thing is that the mrtg will become mmuucchh faster. + Expect the runtime to drop to 20% of the previous value. (I would like + to get some feedback on this from folks with large installations.) + + Mind you, though, while the logging process of RRDtool is vveerryy fast, + you are also gaining some time by neither creating graphs nor updating + webpages. The idea behind this is that it is more efficient to create + graphs and webpages on demand by using a cgi script. + + At the moment there is no ooffffiicciiaall script to do this, but two con- + tributers have created such scripts: One4All aka 14all.cgi - This was the first program to take over the webpage - creation and graphing task. It has been developed by - Rainer Bawidamann rainer.bawidamann@web.de. You can - find a copy on Rainers website: http://my14all.source- - forge.net/ The program comes with its own documenta- - tion + This was the first program to take over the webpage creation and + graphing task. It has been developed by Rainer Bawidamann + rainer.bawidamann@web.de. You can find a copy on Rainers website: + http://my14all.sourceforge.net/ The program comes with its own doc- + umentation rroouutteerrss..ccggii,, sseerrvveerrss..ccggii aanndd ggeenneerriicc..ccggii - These are other cgi frontends to mrtg running with - rrdtool. The main difference between this and 14all is - that the web pages it creates are much more stylish - than the ones from mrtg. These tools have been written - by Steve Shipway steve@steveshipway.org. You can find - a copy in http://www.steveshipway.org/software/ The - programs come with their own installation instruc- - tions. + These are other cgi frontends to mrtg running with rrdtool. The + main difference between this and 14all is that the web pages it + creates are much more stylish than the ones from mrtg. These tools + have been written by Steve Shipway steve@steveshipway.org. You can + find a copy in http://www.steveshipway.org/software/ The programs + come with their own installation instructions. mmrrttgg--rrrrdd - The mrtg-rrd script is a CGI/FastCGI application by - Jan "Yenya" Kasprzak for displaying MRTG graphs from - data in the RRDtool format. It is an intended replace- - ment for the 14all.cgi script. It can make your moni- - toring system faster because MRTG does not have to - generate all the PNG files with graphs every 5 minutes - or so. Instead of this the graphs are generated on- - demand when the user wants to see them. - http://www.fi.muni.cz/~kas/mrtg-rrd/ - - Paul C. Williamson has written a more in-depth page on how - the whole process works, including some performance fig- - ures. You can find his page on http://www.geoci- - ties.com/paulcwilliamson/mrtg/rateup2rrd.html + The mrtg-rrd script is a CGI/FastCGI application by Jan "Yenya" + Kasprzak for displaying MRTG graphs from data in the RRDtool for- + mat. It is an intended replacement for the 14all.cgi script. It can + make your monitoring system faster because MRTG does not have to + generate all the PNG files with graphs every 5 minutes or so. + Instead of this the graphs are generated on-demand when the user + wants to see them. http://www.fi.muni.cz/~kas/mrtg-rrd/ + + Paul C. Williamson has written a more in-depth page on how the whole + process works, including some performance figures. You can find his + page on http://www.geocities.com/paulcwilliamson/mrtg/rateup2rrd.html FFUUTTUURREE - Just as a side note: MRTG-3 will be based entirely on rrd- - tool technology. But don't wait for it ... get going nnooww! + Just as a side note: MRTG-3 will be based entirely on rrdtool technol- + ogy. But don't wait for it ... get going nnooww! AAUUTTHHOORR Tobias Oetiker -2.14.7 2006-09-06 MRTG-RRD(1) +2.16.1 2008-02-17 MRTG-RRD(1) diff -Nru mrtg-2.14.7/doc/mrtg-squid.1 mrtg-2.16.1/doc/mrtg-squid.1 --- mrtg-2.14.7/doc/mrtg-squid.1 2006-09-06 14:42:53.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-squid.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-SQUID 1" -.TH MRTG-SQUID 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-SQUID 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-squid \- using mrtg to monitor Squid .SH "DESCRIPTION" @@ -182,8 +182,8 @@ correctly with: .PP .Vb 2 -\& kMG[measure-ms]: m,,k,M,G,T -\& short[measure-ms]: s +\& kMG[measure\-ms]: m,,k,M,G,T +\& short[measure\-ms]: s .Ve .PP You can display now MB/s as 1024*1024 B/s with: @@ -195,33 +195,33 @@ A sample config for squid: .PP .Vb 11 -\& Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@proxy -\& Title[proxy-hit]: HTTP Hits -\& PageTop[proxy-hit]:

proxy Cache Statistics: HTTP Hits / Requests

-\& Suppress[proxy-hit]: y -\& LegendI[proxy-hit]: HTTP hits -\& LegendO[proxy-hit]: HTTP requests -\& Legend1[proxy-hit]: HTTP hits -\& Legend2[proxy-hit]: HTTP requests -\& YLegend[proxy-hit]: perminute -\& ShortLegend[proxy-hit]: req/min -\& Options[proxy-hit]: nopercent, perminute, dorelpercent +\& Target[proxy\-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@proxy +\& Title[proxy\-hit]: HTTP Hits +\& PageTop[proxy\-hit]:

proxy Cache Statistics: HTTP Hits / Requests

+\& Suppress[proxy\-hit]: y +\& LegendI[proxy\-hit]: HTTP hits +\& LegendO[proxy\-hit]: HTTP requests +\& Legend1[proxy\-hit]: HTTP hits +\& Legend2[proxy\-hit]: HTTP requests +\& YLegend[proxy\-hit]: perminute +\& ShortLegend[proxy\-hit]: req/min +\& Options[proxy\-hit]: nopercent, perminute, dorelpercent .Ve .PP .Vb 13 -\& Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@proxy -\& Title[proxy-srvkbinout]: Cache Server Traffic In / Out -\& PageTop[proxy-srvkbinout]:

Cache Statistics: Server traffic volume (In/Out)

-\& Suppress[proxy-srvkbinout]: y -\& LegendI[proxy-srvkbinout]: Traffic In -\& LegendO[proxy-srvkbinout]: Traffic Out -\& Legend1[proxy-srvkbinout]: Traffic In -\& Legend2[proxy-srvkbinout]: Traffic Out -\& YLegend[proxy-srvkbinout]: per minute -\& ShortLegend[proxy-srvkbinout]: b/min -\& kMG[proxy-srvkbinout]: k,M,G,T -\& kilo[proxy-srvkbinout]: 1024 -\& Options[proxy-srvkbinout]: nopercent, perminute +\& Target[proxy\-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@proxy +\& Title[proxy\-srvkbinout]: Cache Server Traffic In / Out +\& PageTop[proxy\-srvkbinout]:

Cache Statistics: Server traffic volume (In/Out)

+\& Suppress[proxy\-srvkbinout]: y +\& LegendI[proxy\-srvkbinout]: Traffic In +\& LegendO[proxy\-srvkbinout]: Traffic Out +\& Legend1[proxy\-srvkbinout]: Traffic In +\& Legend2[proxy\-srvkbinout]: Traffic Out +\& YLegend[proxy\-srvkbinout]: per minute +\& ShortLegend[proxy\-srvkbinout]: b/min +\& kMG[proxy\-srvkbinout]: k,M,G,T +\& kilo[proxy\-srvkbinout]: 1024 +\& Options[proxy\-srvkbinout]: nopercent, perminute .Ve .SH "AUTHOR" .IX Header "AUTHOR" diff -Nru mrtg-2.14.7/doc/mrtg-squid.txt mrtg-2.16.1/doc/mrtg-squid.txt --- mrtg-2.14.7/doc/mrtg-squid.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-squid.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-SQUID(1) mrtg MRTG-SQUID(1) +MRTG-SQUID(1) mrtg MRTG-SQUID(1) @@ -6,54 +6,50 @@ mrtg-squid - using mrtg to monitor Squid DDEESSCCRRIIPPTTIIOONN - Squid 2.3 knows SNMP and you can therefore use mrtg to - monitor it quite easily. + Squid 2.3 knows SNMP and you can therefore use mrtg to monitor it quite + easily. - I have made some modifications to mrtg which simplify - this. My work is based on earlier modification made by: - matija.grabnar@arnes.si and kostas@nlanr.net. + I have made some modifications to mrtg which simplify this. My work is + based on earlier modification made by: matija.grabnar@arnes.si and + kostas@nlanr.net. MMOODDIIFFIICCAATTIIOONNSS - I added new code for displaying correct units to the pre- - vious patches "perminute" and "perhour" ("option" tokens), - which allows other measurement in addition to "persecond". - - Then I created a new option token "dorelpercent" which - allows the calculation of the percentage of IN-stream / - OUT-stream on the fly and then displays it on a fixed - scale from 0% to 100%. For my requirements, this does good - work. Maybe someone wants a floating scale. It should not - be a problem to implement it, too (but give me an option - to keep my fixed scale). If IN-stream is always less than - OUT-stream both lines (OUT-stream and relative percent) - are always displayed on top of IN-stream bulk. Otherwise - this option makes no sense. With this option you can dis- - play hitrates, errorrates (for router monitoring: rel. + I added new code for displaying correct units to the previous patches + "perminute" and "perhour" ("option" tokens), which allows other mea- + surement in addition to "persecond". + + Then I created a new option token "dorelpercent" which allows the cal- + culation of the percentage of IN-stream / OUT-stream on the fly and + then displays it on a fixed scale from 0% to 100%. For my requirements, + this does good work. Maybe someone wants a floating scale. It should + not be a problem to implement it, too (but give me an option to keep my + fixed scale). If IN-stream is always less than OUT-stream both lines + (OUT-stream and relative percent) are always displayed on top of IN- + stream bulk. Otherwise this option makes no sense. With this option you + can display hitrates, errorrates (for router monitoring: rel. droprates) easily now. - If you use this options please consider that you need a - 5th colourname/value pair in your Colours statements! + If you use this options please consider that you need a 5th colour- + name/value pair in your Colours statements! - Due to some discussion on this list, I have implemented - two tokens too: + Due to some discussion on this list, I have implemented two tokens too: "kilo" and "kMG" - "kilo" should contain the value of k (1000 or 1024), where - 1000 is the default. + "kilo" should contain the value of k (1000 or 1024), where 1000 is the + default. - "kMG" is a comma separated list of multiplier prefixes, - used instead of "", "k", "M", "G", "T" on the MRTG dis- - play. Leave the place free, if you want no prefix. + "kMG" is a comma separated list of multiplier prefixes, used instead of + "", "k", "M", "G", "T" on the MRTG display. Leave the place free, if + you want no prefix. - Also an incomplete list of OIDs for the new SQUID release - is added. + Also an incomplete list of OIDs for the new SQUID release is added. I hope you enjoy it. CCOONNFFIIGG EEXXAAMMPPLLEE - You can measure responsetimes in ms and display it with - MRTG correctly with: + You can measure responsetimes in ms and display it with MRTG correctly + with: kMG[measure-ms]: m,,k,M,G,T short[measure-ms]: s @@ -96,4 +92,4 @@ -2.14.7 2006-09-06 MRTG-SQUID(1) +2.16.1 2008-02-17 MRTG-SQUID(1) diff -Nru mrtg-2.14.7/doc/mrtg.txt mrtg-2.16.1/doc/mrtg.txt --- mrtg-2.14.7/doc/mrtg.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg.txt 2008-02-17 10:27:39.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG(1) mrtg MRTG(1) +MRTG(1) mrtg MRTG(1) @@ -6,15 +6,13 @@ mrtg - What is MRTG ? DDEESSCCRRIIPPTTIIOONN - The Multi Router Traffic Grapher (MRTG) is a tool to moni- - tor the traffic load on network links. MRTG generates - HTML pages containing PNG images which provide a LIVE - visual representation of this traffic. Check - http://www.stat.ee.ethz.ch/mrtg/ to see what it does. + The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traf- + fic load on network links. MRTG generates HTML pages containing PNG + images which provide a LIVE visual representation of this traffic. + Check http://www.stat.ee.ethz.ch/mrtg/ to see what it does. Go to - http://oss.oetiker.ch/mrtg for all the details about - mrtg. + http://oss.oetiker.ch/mrtg for all the details about mrtg. HHIIGGHHLLIIGGHHTTSS Portable @@ -24,159 +22,142 @@ MRTG is written in Perl and comes with full source. Portable SNMP - MRTG Uses a highly portable SNMP implementation writ- - ten entirely in Perl (thanks to Simon Leinen). There - is no need to install any external SNMP package. + MRTG Uses a highly portable SNMP implementation written entirely in + Perl (thanks to Simon Leinen). There is no need to install any + external SNMP package. SNMPv2c support - MRTG can read the new SNMPv2c 64bit counters. No more - counter wrapping. + MRTG can read the new SNMPv2c 64bit counters. No more counter wrap- + ping. Reliable Interface Identification - Router interfaces can be identified by IP address, - description and ethernet address in addition to the - normal interface number. + Router interfaces can be identified by IP address, description and + ethernet address in addition to the normal interface number. Constant size Logfiles - MRTG's logfiles do NOT grow thanks to the use of a - unique data consolidation algorithm. + MRTG's logfiles do NOT grow thanks to the use of a unique data con- + solidation algorithm. Automatic Configuration - MRTG comes with a set of configuration tools which - make configuration and setup very simple. + MRTG comes with a set of configuration tools which make configura- + tion and setup very simple. Performance - Time critical routines are written in C (thanks to the - initiative of Dave Rand my Co-Author). + Time critical routines are written in C (thanks to the initiative + of Dave Rand my Co-Author). GIF free Graphics - Graphics are generated directly in PNG format using - the GD library by Thomas Boutell. + Graphics are generated directly in PNG format using the GD library + by Thomas Boutell. Customizability - The look of the webpages produced by MRTG is highly - configurable. + The look of the webpages produced by MRTG is highly configurable. RRDtool - MRTG has built-in hooks for using RRDtool. If you are - strapped for performance this may help. + MRTG has built-in hooks for using RRDtool. If you are strapped for + performance this may help. DDEETTAAIILLSS - MRTG consists of a Perl script which uses SNMP to read the - traffic counters of your routers and a fast C program - which logs the traffic data and creates beautiful graphs - representing the traffic on the monitored network connec- - tion. These graphs are embedded into webpages which can be - viewed from any modern Web-browser. - - In addition to a detailed daily view, MRTG also creates - visual representations of the traffic seen during the last - seven days, the last five weeks and the last twelve - months. This is possible because MRTG keeps a log of all - the data it has pulled from the router. This log is auto- - matically consolidated so that it does not grow over time, - but still contains all the relevant data for all the traf- - fic seen over the last two years. This is all performed - in an efficient manner. Therefore you can monitor 200 or - more network links from any halfway decent UNIX box. - - MRTG is not limited to monitoring traffic, though. It is - possible to monitor any SNMP variable you choose. You can - even use an external program to gather the data which - should be monitored via MRTG. People are using MRTG, to - monitor things such as System Load, Login Sessions, Modem - availability and more. MRTG even allows you to accumulate - two or more data sources into a single graph. + MRTG consists of a Perl script which uses SNMP to read the traffic + counters of your routers and a fast C program which logs the traffic + data and creates beautiful graphs representing the traffic on the moni- + tored network connection. These graphs are embedded into webpages which + can be viewed from any modern Web-browser. + + In addition to a detailed daily view, MRTG also creates visual repre- + sentations of the traffic seen during the last seven days, the last + five weeks and the last twelve months. This is possible because MRTG + keeps a log of all the data it has pulled from the router. This log is + automatically consolidated so that it does not grow over time, but + still contains all the relevant data for all the traffic seen over the + last two years. This is all performed in an efficient manner. There- + fore you can monitor 200 or more network links from any halfway decent + UNIX box. + + MRTG is not limited to monitoring traffic, though. It is possible to + monitor any SNMP variable you choose. You can even use an external pro- + gram to gather the data which should be monitored via MRTG. People are + using MRTG, to monitor things such as System Load, Login Sessions, + Modem availability and more. MRTG even allows you to accumulate two or + more data sources into a single graph. HHIISSTTOORRYY - In 1994 I was working at a site where we had one 64kbit - line to the outside world. Obviously, everybody was inter- - ested in knowing how the link was performing. So I wrote a - quick hack which created a constantly updated graph on the - web that showed the traffic load on our Internet link. - This eventually evolved into a rather configurable Perl - script called MRTG-1.0 which I released in spring 1995. - After a few updates, I left my job at DMU to start work at - the Swiss Federal Institute of Technology. Due to lack of - time I had to put MRTG aside. One day in January of 1996, - I received email from Dave Rand asking if I had any ideas - why MRTG was so slow. Actually, I did. MRTG's programming - was not very efficient and it was written entirely in - Perl. After a week or so, Dave wrote back to me and said - he had tried what I had suggested for improving MRTG's - speed. Since the changes did not help much, he had decided - to rewrite the time-critical sections of MRTG in C. The - code was attached to his email. His tool increased the - speed of MRTG by a factor of 40! This got me out of my - 'MRTG ignorance' and I started to spend my spare time - developing of MRTG-2. - - Soon after MRTG-2 development had begun I started to give - beta copies to interested parties. In return I got many - feature patches, a lot of user feedback and bug fixes. The - product you are getting now wouldn't be in this state if - it hadn't been for the great contributions and support I - received from of many people. I would like to take this - opportunity to thank them all. (See the files CHANGES for - a long list of folk people who helped to make MRTG what it - is today.) + In 1994 I was working at a site where we had one 64kbit line to the + outside world. Obviously, everybody was interested in knowing how the + link was performing. So I wrote a quick hack which created a constantly + updated graph on the web that showed the traffic load on our Internet + link. This eventually evolved into a rather configurable Perl script + called MRTG-1.0 which I released in spring 1995. After a few updates, I + left my job at DMU to start work at the Swiss Federal Institute of + Technology. Due to lack of time I had to put MRTG aside. One day in + January of 1996, I received email from Dave Rand asking if I had any + ideas why MRTG was so slow. Actually, I did. MRTG's programming was not + very efficient and it was written entirely in Perl. After a week or so, + Dave wrote back to me and said he had tried what I had suggested for + improving MRTG's speed. Since the changes did not help much, he had + decided to rewrite the time-critical sections of MRTG in C. The code + was attached to his email. His tool increased the speed of MRTG by a + factor of 40! This got me out of my 'MRTG ignorance' and I started to + spend my spare time developing of MRTG-2. + + Soon after MRTG-2 development had begun I started to give beta copies + to interested parties. In return I got many feature patches, a lot of + user feedback and bug fixes. The product you are getting now wouldn't + be in this state if it hadn't been for the great contributions and sup- + port I received from of many people. I would like to take this opportu- + nity to thank them all. (See the files CHANGES for a long list of folk + people who helped to make MRTG what it is today.) CCoommmmaanndd--lliinnee - Mrtg is also the name of the script you have to run to - poll data and generate the graphs. Most configuration is - set through the configuration file; some command-line - options exist all the same. + Mrtg is also the name of the script you have to run to poll data and + generate the graphs. Most configuration is set through the configura- + tion file; some command-line options exist all the same. ----uusseerr _u_s_e_r_n_a_m_e and ----ggrroouupp _g_r_o_u_p_n_a_m_e Run as the given user and/or group. (Unix Only) ----lloocckk--ffiillee _f_i_l_e_n_a_m_e - Use an alternate lock-file (the default is to use the - configuration-file appended with "_l"). + Use an alternate lock-file (the default is to use the configura- + tion-file appended with "_l"). ----ccoonnffccaacchhee--ffiillee _f_i_l_e_n_a_m_e - Use an alternate confcache-file (the default is to use - the configuration-file appended with ".ok") + Use an alternate confcache-file (the default is to use the configu- + ration-file appended with ".ok") ----llooggggiinngg _f_i_l_e_n_a_m_e|eevveennttlloogg - If this is set to writable filename, all output from - mrtg (warnings, debug messages, errors) will go to - _f_i_l_e_n_a_m_e. If you are running on Win32 you can specify - eevveennttlloogg instead of a filename which will send all - error to the windows event log. - - NNOOTTEE::Note, there is no Message DLL for mrtg. This has - the side effect that the windows event logger will - display a nice message with every entry in the event - log, complaing about the fact that mrtg has no message - dll. If any of the Windows folks want to contribute - one, they are welcome. + If this is set to writable filename, all output from mrtg (warn- + ings, debug messages, errors) will go to _f_i_l_e_n_a_m_e. If you are run- + ning on Win32 you can specify eevveennttlloogg instead of a filename which + will send all error to the windows event log. + + NNOOTTEE::Note, there is no Message DLL for mrtg. This has the side + effect that the windows event logger will display a nice message + with every entry in the event log, complaing about the fact that + mrtg has no message dll. If any of the Windows folks want to con- + tribute one, they are welcome. ----ddaaeemmoonn - Put MRTG into the background, running as a daemon. - This works the same way as the config file option, but - the switch is required for proper FHS operation - (because /var/run is writable only by root) + Put MRTG into the background, running as a daemon. This works the + same way as the config file option, but the switch is required for + proper FHS operation (because /var/run is writable only by root) ----ffhhss - Configure all mrtg paths to conform to the FHS speci- - fication; http://www.pathname.com/fhs/ + Configure all mrtg paths to conform to the FHS specification; + http://www.pathname.com/fhs/ ----cchheecckk - Only check the cfg file for errors. Do not do any- - thing. + Only check the cfg file for errors. Do not do anything. ----ppiidd--ffiillee==ss - Define the name and path of the pid file for mrtg run- - ning as a daemon + Define the name and path of the pid file for mrtg running as a dae- + mon ----lloogg--oonnllyy - Only update the logfile, do not produce graphics or - html pages + Only update the logfile, do not produce graphics or html pages ----ddeebbuugg==ss - Enable debug options. The argument of the debug option - is a comma separated list of debug values: + Enable debug options. The argument of the debug option is a comma + separated list of debug values: cfg - watch the config file reading dir - directory mangeling @@ -200,4 +181,4 @@ -2.14.7 2006-09-06 MRTG(1) +2.16.1 2008-02-17 MRTG(1) diff -Nru mrtg-2.14.7/doc/mrtg-unix-guide.1 mrtg-2.16.1/doc/mrtg-unix-guide.1 --- mrtg-2.14.7/doc/mrtg-unix-guide.1 2006-09-06 14:42:51.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-unix-guide.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,9 +129,9 @@ .\" ======================================================================== .\" .IX Title "MRTG-UNIX-GUIDE 1" -.TH MRTG-UNIX-GUIDE 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-UNIX-GUIDE 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" -mrtg\-unix\-guide \- Instructions for running MRTG 2.14.7 on a Unix Box +mrtg\-unix\-guide \- The MRTG 2.16.1 Linux/Unix Installation Guide .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1MRTG\s0 comes to you in Source Code. This means that you have to compile @@ -157,8 +157,10 @@ .IP "Perl" 4 .IX Item "Perl" Large parts of the \s-1MRTG\s0 system are written in the Perl scripting language. -Make sure there is a recent copy of perl on your machine (try perl \-v). -At least version 5.005 is required for mrtg to work well. +Make sure there is a recent copy of perl on your machine (try perl \-v). At +least version 5.005 is required for mrtg to work well. If you use \s-1SNMPV3\s0 and +other new features you should use at least 5.8. +.Sp You can get the latest perl from .Sp .Vb 1 @@ -225,17 +227,17 @@ already exist on your system. No problem, just use it. .PP .Vb 2 -\& mkdir -p /usr/local/src +\& mkdir \-p /usr/local/src \& cd /usr/local/src .Ve .PP If you do not have zlib installed: .PP .Vb 8 -\& wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz -\& gunzip -c zlib-*.tar.gz | tar xf - -\& rm zlib-*.tar.gz -\& mv zlib-* zlib +\& wget http://www.gzip.org/zlib/zlib\-1.1.4.tar.gz +\& gunzip \-c zlib\-*.tar.gz | tar xf \- +\& rm zlib\-*.tar.gz +\& mv zlib\-* zlib \& cd zlib \& ./configure \& make @@ -245,12 +247,12 @@ If you don't have libpng installed .PP .Vb 8 -\& wget http://public.planetmirror.com/pub/sourceforge/l/li/libpng/libpng-1.0.15.tar.gz -\& gunzip -c libpng-*.tar.gz |tar xf - -\& rm libpng-*.tar.gz -\& mv libpng-* libpng +\& wget http://public.planetmirror.com/pub/sourceforge/l/li/libpng/libpng\-1.0.15.tar.gz +\& gunzip \-c libpng\-*.tar.gz |tar xf \- +\& rm libpng\-*.tar.gz +\& mv libpng\-* libpng \& cd libpng -\& make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib +\& make \-f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib \& rm *.so.* *.so \& cd .. .Ve @@ -260,10 +262,10 @@ For versions up to 1.8.4, try: .PP .Vb 5 -\& wget http://www.boutell.com/gd/http/gd-1.8.4.tar.gz -\& gunzip -c gd-*.tar.gz |tar xf - -\& rm gd-*.tar.gz -\& mv gd-* gd +\& wget http://www.boutell.com/gd/http/gd\-1.8.4.tar.gz +\& gunzip \-c gd\-*.tar.gz |tar xf \- +\& rm gd\-*.tar.gz +\& mv gd\-* gd \& cd gd .Ve .PP @@ -271,23 +273,23 @@ following material should actually be written on a single line. .PP .Vb 6 -\& perl -i~ -p -e s/gd_jpeg.o//g Makefile -\& make INCLUDEDIRS="-I. -I../zlib -I../libpng" \e -\& LIBDIRS="-L../zlib -L. -L../libpng" \e -\& LIBS="-lgd -lpng -lz -lm" \e -\& CFLAGS="-O -DHAVE_LIBPNG" +\& perl \-i~ \-p \-e s/gd_jpeg.o//g Makefile +\& make INCLUDEDIRS="\-I. \-I../zlib \-I../libpng" \e +\& LIBDIRS="\-L../zlib \-L. \-L../libpng" \e +\& LIBS="\-lgd \-lpng \-lz \-lm" \e +\& CFLAGS="\-O \-DHAVE_LIBPNG" \& cd .. .Ve .PP -For version starting around 2.0.11, try: +For versions starting around 2.0.11, try: .PP .Vb 8 -\& wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz -\& gunzip -c gd-2.0.11.tar.gz |tar xf - -\& mv gd-2.0.11 gd +\& wget http://www.boutell.com/gd/http/gd\-2.0.11.tar.gz +\& gunzip \-c gd\-2.0.11.tar.gz |tar xf \- +\& mv gd\-2.0.11 gd \& cd gd -\& env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" ./configure --disable-shared \e -\& --without-freetype --without-jpeg +\& env CPPFLAGS="\-I../zlib \-I../libpng" LDFLAGS="\-L../zlib \-L../libpng" \e +\& ./configure \-\-disable\-shared \-\-without\-freetype \-\-without\-jpeg \& make \& cp .libs/* . .Ve @@ -297,25 +299,25 @@ .PP .Vb 3 \& cd /usr/local/src -\& gunzip -c mrtg-2.14.7.tar.gz | tar xvf - -\& cd mrtg-2.14.7 +\& gunzip \-c mrtg\-2.16.1.tar.gz | tar xvf \- +\& cd mrtg\-2.16.1 .Ve .PP If all the libraries have been preinstalled on your system you can configure mrtg by doing a simple: .PP .Vb 1 -\& ./configure --prefix=/usr/local/mrtg-2 +\& ./configure \-\-prefix=/usr/local/mrtg\-2 .Ve .PP Otherwise you may have to give some hints on where to find the various libraries required to compile mrtg: .PP .Vb 4 -\& ./configure --prefix=/usr/local/mrtg-2 \e -\& --with-gd=/usr/local/src/gd \e -\& --with-z=/usr/local/src/zlib \e -\& --with-png=/usr/local/src/libpng +\& ./configure \-\-prefix=/usr/local/mrtg\-2 \e +\& \-\-with\-gd=/usr/local/src/gd \e +\& \-\-with\-z=/usr/local/src/zlib \e +\& \-\-with\-png=/usr/local/src/libpng .Ve .PP If you have RRDtool available you might want to tell mrtg about it @@ -355,9 +357,9 @@ the \fIbin\fR subdirectory. .PP .Vb 4 -\& cfgmaker --global 'WorkDir: /home/httpd/mrtg' \e -\& --global 'Options[_]: bits,growright' \e -\& --output /home/mrtg/cfg/mrtg.cfg \e +\& cfgmaker \-\-global 'WorkDir: /home/httpd/mrtg' \e +\& \-\-global 'Options[_]: bits,growright' \e +\& \-\-output /home/mrtg/cfg/mrtg.cfg \e \& community@router.abc.xyz .Ve .PP @@ -374,7 +376,7 @@ Once you have created a configuration file, try the following: .PP .Vb 1 -\& /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg +\& /usr/local/mrtg\-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg .Ve .PP This will query your router and also create your first mrtg trafic @@ -391,23 +393,23 @@ .PP .Vb 3 \& 0,5,10,15,20,25,30,35,40,45,50,55 * * * * \e -\& /mrtg /mrtg.cfg \e -\& --logging /var/log/mrtg.log +\& /mrtg /mrtg.cfg \e +\& \-\-logging /var/log/mrtg.log .Ve .PP or if you live in Linux Land the line may look like this if you are using \f(CW\*(C`crontab \-e\*(C'\fR .PP .Vb 2 -\& */5 * * * * /mrtg /mrtg.cfg \e -\& --logging /var/log/mrtg.log +\& */5 * * * * /mrtg /mrtg.cfg \e +\& \-\-logging /var/log/mrtg.log .Ve .PP or like this if you use \fI/etc/crontab\fR .PP .Vb 2 -\& */5 * * * * mrtg-user /mrtg /mrtg.cfg \e -\& --logging /var/log/mrtg.log +\& */5 * * * * mrtg\-user /mrtg /mrtg.cfg \e +\& \-\-logging /var/log/mrtg.log .Ve .PP You can also run mrtg as a daemon process by adding the line @@ -431,8 +433,8 @@ .PP .Vb 3 \& #! /bin/sh -\& cd /usr/local/mrtg-2.14.7/bin && ./mrtg --user=mrtg-user \e -\& /home/httpd/mrtg/mrtg.cfg --logging /var/log/mrtg.log +\& cd /usr/local/mrtg\-2.16.1/bin && ./mrtg \-\-user=mrtg\-user \e +\& /home/httpd/mrtg/mrtg.cfg \-\-logging /var/log/mrtg.log .Ve .PP Note that this will only work with \fBRunAsDaemon: Yes\fR in your diff -Nru mrtg-2.14.7/doc/mrtg-unix-guide.pod mrtg-2.16.1/doc/mrtg-unix-guide.pod --- mrtg-2.14.7/doc/mrtg-unix-guide.pod 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-unix-guide.pod 2008-02-17 10:27:36.000000000 +0000 @@ -1,6 +1,6 @@ =head1 NAME -mrtg-unix-guide - Instructions for running MRTG 2.14.7 on a Unix Box +mrtg-unix-guide - The MRTG 2.16.1 Linux/Unix Installation Guide =head1 DESCRIPTION @@ -30,8 +30,10 @@ =item Perl Large parts of the MRTG system are written in the Perl scripting language. -Make sure there is a recent copy of perl on your machine (try perl -v). -At least version 5.005 is required for mrtg to work well. +Make sure there is a recent copy of perl on your machine (try perl -v). At +least version 5.005 is required for mrtg to work well. If you use SNMPV3 and +other new features you should use at least 5.8. + You can get the latest perl from http://www.perl.com/ @@ -142,14 +144,14 @@ CFLAGS="-O -DHAVE_LIBPNG" cd .. -For version starting around 2.0.11, try: +For versions starting around 2.0.11, try: wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz gunzip -c gd-2.0.11.tar.gz |tar xf - mv gd-2.0.11 gd cd gd - env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" ./configure --disable-shared \ - --without-freetype --without-jpeg + env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" \ + ./configure --disable-shared --without-freetype --without-jpeg make cp .libs/* . @@ -158,8 +160,8 @@ Ok, now everything is ready for the mrtg compilation. cd /usr/local/src - gunzip -c mrtg-2.14.7.tar.gz | tar xvf - - cd mrtg-2.14.7 + gunzip -c mrtg-2.16.1.tar.gz | tar xvf - + cd mrtg-2.16.1 If all the libraries have been preinstalled on your system you can configure mrtg by doing a simple: @@ -272,7 +274,7 @@ A B script to put into F might look like this: #! /bin/sh - cd /usr/local/mrtg-2.14.7/bin && ./mrtg --user=mrtg-user \ + cd /usr/local/mrtg-2.16.1/bin && ./mrtg --user=mrtg-user \ /home/httpd/mrtg/mrtg.cfg --logging /var/log/mrtg.log diff -Nru mrtg-2.14.7/doc/mrtg-unix-guide.txt mrtg-2.16.1/doc/mrtg-unix-guide.txt --- mrtg-2.14.7/doc/mrtg-unix-guide.txt 2006-09-06 14:42:56.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-unix-guide.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,98 +1,90 @@ -MRTG-UNIX-GUIDE(1) mrtg MRTG-UNIX-GUIDE(1) +MRTG-UNIX-GUIDE(1) mrtg MRTG-UNIX-GUIDE(1) NNAAMMEE - mrtg-unix-guide - Instructions for running MRTG 2.14.7 on - a Unix Box + mrtg-unix-guide - The MRTG 2.16.1 Linux/Unix Installation Guide DDEESSCCRRIIPPTTIIOONN - MRTG comes to you in Source Code. This means that you have - to compile parts of it before you can use it on a Unix - machine. These instructions help you to do so. + MRTG comes to you in Source Code. This means that you have to compile + parts of it before you can use it on a Unix machine. These instructions + help you to do so. PPRREEPPAARRAATTIIOONN - In order to compile and use mrtg you need a C compiler and - a copy of perl installed on your machine. In most cases - this will already be available. In case it is not, here - are some starting points. Below I'll give you a detailed - run through the whole compilation process. - - GCC The GNU C compiler comes preinstalled on most of the - free Unicies out there. For commercial derivatives - you may have to download and compile it first. If you - have no compiler at all there is a chicken and egg - problem, but there are also precompiled versions of - gcc available for most operating systems. + In order to compile and use mrtg you need a C compiler and a copy of + perl installed on your machine. In most cases this will already be + available. In case it is not, here are some starting points. Below + I'll give you a detailed run through the whole compilation process. + + GCC The GNU C compiler comes preinstalled on most of the free Unicies + out there. For commercial derivatives you may have to download and + compile it first. If you have no compiler at all there is a chicken + and egg problem, but there are also precompiled versions of gcc + available for most operating systems. http://gcc.gnu.org/ Perl - Large parts of the MRTG system are written in the Perl - scripting language. Make sure there is a recent copy - of perl on your machine (try perl -v). At least ver- - sion 5.005 is required for mrtg to work well. You can - get the latest perl from + Large parts of the MRTG system are written in the Perl scripting + language. Make sure there is a recent copy of perl on your machine + (try perl -v). At least version 5.005 is required for mrtg to work + well. If you use SNMPV3 and other new features you should use at + least 5.8. + + You can get the latest perl from http://www.perl.com/ - MRTG generates traffic graphs in the PNG format. To be - able to do this it needs several 3rd party libraries. When - compiling these libraries I urge you to make sure you com- - pile them as ssttaattiicc libraries. There is just much less - trouble ahead if you are doing it like this. See the - Instructions in the next section for inspiration. Note - that many free unices have all the required libraries - already in place so there is no need to install another - copy. To check it is best to skip all the library instruc- - tions below and go straight into the mrtg compile. - - If the first attempt fails and you do not get a working - version of mrtg, try compiling new copies of all libraries - as explained below. Do this BBEEFFOORREE you send email to me - about problems compiling mrtg. - - gd This is a basic graph drawing library created by - Thomas Boutell. Note that all releases after Version - 1.3 only create PNG images. This is because a) Thomas - got into trouble because the GIF format which it used - to produce uses a compression technology patented by - Unisys. b) PNG is more efficient and patent free. MRTG - can work with old and new version of the GD library. - You can get a recent copy of GD from: + MRTG generates traffic graphs in the PNG format. To be able to do this + it needs several 3rd party libraries. When compiling these libraries I + urge you to make sure you compile them as ssttaattiicc libraries. There is + just much less trouble ahead if you are doing it like this. See the + Instructions in the next section for inspiration. Note that many free + unices have all the required libraries already in place so there is no + need to install another copy. To check it is best to skip all the + library instructions below and go straight into the mrtg compile. + + If the first attempt fails and you do not get a working version of + mrtg, try compiling new copies of all libraries as explained below. Do + this BBEEFFOORREE you send email to me about problems compiling mrtg. + + gd This is a basic graph drawing library created by Thomas Boutell. + Note that all releases after Version 1.3 only create PNG images. + This is because a) Thomas got into trouble because the GIF format + which it used to produce uses a compression technology patented by + Unisys. b) PNG is more efficient and patent free. MRTG can work + with old and new version of the GD library. You can get a recent + copy of GD from: http://www.boutell.com/gd/ libpng - Is required by gd in order to produce PNG graphics - files. Get it from: + Is required by gd in order to produce PNG graphics files. Get it + from: http://www.libpng.org/pub/png/libpng.html zlib - Is needed by libpng to compress the graphics files you - create. Get a copy from + Is needed by libpng to compress the graphics files you create. Get + a copy from http://www.gzip.org/zlib - And last but not least you also need mrtg itself. In case - you have not yet downloaded it, you can find a copy on my - website: + And last but not least you also need mrtg itself. In case you have not + yet downloaded it, you can find a copy on my website: http://oss.oetiker.ch/mrtg/pub LLIIBBRRAARRYY CCOOMMPPIILLAATTIIOONN - In this section I will give you step by step instructions - on how to compile the various libraries required for the - compilation of mrtg. Note that these libaries may already - be installed if you have a _*_B_S_D or _L_i_n_u_x system so you can - skip recompiling them. The wwggeett program used below is a - simple web downloader. You can also enter the address into + In this section I will give you step by step instructions on how to + compile the various libraries required for the compilation of mrtg. + Note that these libaries may already be installed if you have a _*_B_S_D or + _L_i_n_u_x system so you can skip recompiling them. The wwggeett program used + below is a simple web downloader. You can also enter the address into your nneettssccaappee if you don't have wwggeett available. - First let's create a directory for the compilation. Note - that this may already exist on your system. No problem, - just use it. + First let's create a directory for the compilation. Note that this may + already exist on your system. No problem, just use it. mkdir -p /usr/local/src cd /usr/local/src @@ -129,9 +121,8 @@ mv gd-* gd cd gd - The \ characters at the end of the following lines mean - that all the following material should actually be written - on a single line. + The \ characters at the end of the following lines mean that all the + following material should actually be written on a single line. perl -i~ -p -e s/gd_jpeg.o//g Makefile make INCLUDEDIRS="-I. -I../zlib -I../libpng" \ @@ -140,14 +131,14 @@ CFLAGS="-O -DHAVE_LIBPNG" cd .. - For version starting around 2.0.11, try: + For versions starting around 2.0.11, try: wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz gunzip -c gd-2.0.11.tar.gz |tar xf - mv gd-2.0.11 gd cd gd - env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" ./configure --disable-shared \ - --without-freetype --without-jpeg + env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" \ + ./configure --disable-shared --without-freetype --without-jpeg make cp .libs/* . @@ -155,101 +146,91 @@ Ok, now everything is ready for the mrtg compilation. cd /usr/local/src - gunzip -c mrtg-2.14.7.tar.gz | tar xvf - - cd mrtg-2.14.7 + gunzip -c mrtg-2.16.1.tar.gz | tar xvf - + cd mrtg-2.16.1 - If all the libraries have been preinstalled on your system - you can configure mrtg by doing a simple: + If all the libraries have been preinstalled on your system you can con- + figure mrtg by doing a simple: ./configure --prefix=/usr/local/mrtg-2 - Otherwise you may have to give some hints on where to find - the various libraries required to compile mrtg: + Otherwise you may have to give some hints on where to find the various + libraries required to compile mrtg: ./configure --prefix=/usr/local/mrtg-2 \ --with-gd=/usr/local/src/gd \ --with-z=/usr/local/src/zlib \ --with-png=/usr/local/src/libpng - If you have RRDtool available you might want to tell mrtg - about it so that you can opt to use rrdtool with mrtg. - Check mrtg-rrd. - - Configure will make sure your environment is fit for - building mrtg. If it finds a problem, it will tell you so - and it will also tell you what to do about it. If every- - thing is OK, you will end up with a custom Makefile for - your system. Now type: + If you have RRDtool available you might want to tell mrtg about it so + that you can opt to use rrdtool with mrtg. Check mrtg-rrd. + + Configure will make sure your environment is fit for building mrtg. If + it finds a problem, it will tell you so and it will also tell you what + to do about it. If everything is OK, you will end up with a custom + Makefile for your system. Now type: make - This builds the rateup binary and edits all the perl path- - names in the scripts. You can now install mrtg by typing + This builds the rateup binary and edits all the perl pathnames in the + scripts. You can now install mrtg by typing make install (requires gnu install) - All the software required by MRTG is now installed under - the _/_u_s_r_/_l_o_c_a_l_/_m_r_t_g_-_2 subdirectory. + All the software required by MRTG is now installed under the + _/_u_s_r_/_l_o_c_a_l_/_m_r_t_g_-_2 subdirectory. - You can now safely delete the libraries we compiled above. - Then again, you might want to keep them around so that you - have them available when compiling the next version of - mrtg. + You can now safely delete the libraries we compiled above. Then again, + you might want to keep them around so that you have them available when + compiling the next version of mrtg. CCOONNFFIIGGUURRAATTIIOONN - The next step is to configure mrtg for monitoring a net- - work device. This is done by creating an _m_r_t_g_._c_f_g file - which defines what you want to monitor. Luckily, you don't - have to dive straight in and start writing your own con- - figuration file all by yourself. Together with mrtg you - also got a copy of ccffggmmaakkeerr. This is a script you can - point at a router of your choice; it will create a mrtg - configuration file for you. You can find the script in the - _b_i_n subdirectory. + The next step is to configure mrtg for monitoring a network device. + This is done by creating an _m_r_t_g_._c_f_g file which defines what you want + to monitor. Luckily, you don't have to dive straight in and start writ- + ing your own configuration file all by yourself. Together with mrtg you + also got a copy of ccffggmmaakkeerr. This is a script you can point at a router + of your choice; it will create a mrtg configuration file for you. You + can find the script in the _b_i_n subdirectory. cfgmaker --global 'WorkDir: /home/httpd/mrtg' \ --global 'Options[_]: bits,growright' \ --output /home/mrtg/cfg/mrtg.cfg \ community@router.abc.xyz - This example above will create an mrtg config file in - _/_h_o_m_e_/_m_r_t_g_/_c_f_g assuming this is a directory visible on - your webserver. You can read all about cfgmaker in cfg- - maker. One area you might want to look at is the possibil- - ity of using ----iiffrreeff==iipp to prevent interface renumbering + This example above will create an mrtg config file in _/_h_o_m_e_/_m_r_t_g_/_c_f_g + assuming this is a directory visible on your webserver. You can read + all about cfgmaker in cfgmaker. One area you might want to look at is + the possibility of using ----iiffrreeff==iipp to prevent interface renumbering troubles from catching you. - If you want to start rolling your own mrtg configuration - files, make sure you read mrtg-reference to learn all - about the possible configuration options. + If you want to start rolling your own mrtg configuration files, make + sure you read mrtg-reference to learn all about the possible configura- + tion options. RRUUNNNNIINNGG MMRRTTGG - Once you have created a configuration file, try the fol- - lowing: + Once you have created a configuration file, try the following: /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg - This will query your router and also create your first - mrtg trafic graphs and webpages. When you run mrtg for the - first time there will be a lot of complaints about missing - log files. Don't worry, this is normal for the first 2 - times you start mrtg. If it keeps complaining after this - time you might want to look into the problem. - - Starting mrtg by hand is not ideal in the long run. So - when you are satisfied with the results you can automate - the process of running mrtg in regular intervals (this - means every 5 minutes by default). + This will query your router and also create your first mrtg trafic + graphs and webpages. When you run mrtg for the first time there will be + a lot of complaints about missing log files. Don't worry, this is nor- + mal for the first 2 times you start mrtg. If it keeps complaining after + this time you might want to look into the problem. + + Starting mrtg by hand is not ideal in the long run. So when you are + satisfied with the results you can automate the process of running mrtg + in regular intervals (this means every 5 minutes by default). - You can either add mrtg to your crontab with a line like - this: + You can either add mrtg to your crontab with a line like this: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * \ /mrtg /mrtg.cfg \ --logging /var/log/mrtg.log - or if you live in Linux Land the line may look like this - if you are using "crontab -e" + or if you live in Linux Land the line may look like this if you are + using "crontab -e" */5 * * * * /mrtg /mrtg.cfg \ --logging /var/log/mrtg.log @@ -259,36 +240,33 @@ */5 * * * * mrtg-user /mrtg /mrtg.cfg \ --logging /var/log/mrtg.log - You can also run mrtg as a daemon process by adding the - line + You can also run mrtg as a daemon process by adding the line RunAsDaemon: Yes - to your mrtg configuration file and then creating a - startup script in your system startup sequence. Unfortu- - nately, adding startup scripts differs widely amongst dif- - ferent unix systems. The modern ones normally have a - directory called _/_e_t_c_/_i_n_i_t_._d or _/_e_t_c_/_r_c_._d_/_i_n_i_t_._d where you - put scripts which starts the process you want to run when - the system boots. Further you must create a symbolic link - in _/_e_t_c_/_r_c_3_._d or _/_e_t_c_/_r_c_._d_/_r_c_?_._d called _S_6_5_m_r_t_g (this is - just a sample name ... it is just important that it starts - with S followed by a two digit number). If you are not - sure about this, make sure you consult the documentation + to your mrtg configuration file and then creating a startup script in + your system startup sequence. Unfortunately, adding startup scripts + differs widely amongst different unix systems. The modern ones normally + have a directory called _/_e_t_c_/_i_n_i_t_._d or _/_e_t_c_/_r_c_._d_/_i_n_i_t_._d where you put + scripts which starts the process you want to run when the system boots. + Further you must create a symbolic link in _/_e_t_c_/_r_c_3_._d or + _/_e_t_c_/_r_c_._d_/_r_c_?_._d called _S_6_5_m_r_t_g (this is just a sample name ... it is + just important that it starts with S followed by a two digit number). + If you are not sure about this, make sure you consult the documentation of your system to make sure you get this right. A mmiinniimmaall script to put into _i_n_i_t_._d might look like this: #! /bin/sh - cd /usr/local/mrtg-2.14.7/bin && ./mrtg --user=mrtg-user \ + cd /usr/local/mrtg-2.16.1/bin && ./mrtg --user=mrtg-user \ /home/httpd/mrtg/mrtg.cfg --logging /var/log/mrtg.log - Note that this will only work with RRuunnAAssDDaaeemmoonn:: YYeess in - your mrtg.cfg file. + Note that this will only work with RRuunnAAssDDaaeemmoonn:: YYeess in your mrtg.cfg + file. AAUUTTHHOORR Tobias Oetiker -2.14.7 2006-09-06 MRTG-UNIX-GUIDE(1) +2.16.1 2008-02-17 MRTG-UNIX-GUIDE(1) diff -Nru mrtg-2.14.7/doc/mrtg-webserver.1 mrtg-2.16.1/doc/mrtg-webserver.1 --- mrtg-2.14.7/doc/mrtg-webserver.1 2006-09-06 14:42:53.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-webserver.1 2008-02-17 10:27:37.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "MRTG-WEBSERVER 1" -.TH MRTG-WEBSERVER 1 "2006-09-06" "2.14.7" "mrtg" +.TH MRTG-WEBSERVER 1 "2008-02-17" "2.16.1" "mrtg" .SH "NAME" mrtg\-webserver \- hints for web server configuration .SH "SYNOPSIS" @@ -157,12 +157,12 @@ .PP .Vb 11 \& ############################################################ -\& # Example .htaccess for use with apache-1.2 and mod_expire. -\& # (mod_expire come with apache-1.2 but you have to explicitly +\& # Example .htaccess for use with apache\-1.2 and mod_expire. +\& # (mod_expire come with apache\-1.2 but you have to explicitly \& # activate it when compiling the httpd ...) \& ############################################################# \& # -\& +\& \& ExpiresActive On # enable expirations \& # five minutes \& ExpiresDefault M300 @@ -170,21 +170,21 @@ .Ve .PP .Vb 4 -\& +\& \& ExpiresActive On \& ExpiresDefault M1800 \& .Ve .PP .Vb 4 -\& +\& \& ExpiresActive On \& ExpiresDefault M7200 \& .Ve .PP .Vb 4 -\& +\& \& ExpiresActive On \& ExpiresDefault M86400 \& diff -Nru mrtg-2.14.7/doc/mrtg-webserver.txt mrtg-2.16.1/doc/mrtg-webserver.txt --- mrtg-2.14.7/doc/mrtg-webserver.txt 2006-09-06 14:42:57.000000000 +0100 +++ mrtg-2.16.1/doc/mrtg-webserver.txt 2008-02-17 10:27:38.000000000 +0000 @@ -1,4 +1,4 @@ -MRTG-WEBSERVER(1) mrtg MRTG-WEBSERVER(1) +MRTG-WEBSERVER(1) mrtg MRTG-WEBSERVER(1) @@ -6,27 +6,25 @@ mrtg-webserver - hints for web server configuration SSYYNNOOPPSSIISS - If you want people to actually see the results of your - network monitoring efforts you will need a webserver. + If you want people to actually see the results of your network monitor- + ing efforts you will need a webserver. - This document lists some configuration hints for web- - servers. Contributions welcome. + This document lists some configuration hints for webservers. Contribu- + tions welcome. AAPPAACCHHEE CCoonnffiigguurriinngg mmoodd__eexxppiirree - A big issue with mrtg monitoring data is the expiry time. - All these nice graphs you can create are only valid for a - short time. If you do not take special action some web- - browsers will not notice this and you may end up with peo- - ple seeing old data because of caching issues. - - The apache module mod_expire allows you to setup special - expiry properties for individual file. - - Here is an example for how this may look for an mrtg web - directory. The configuration directives can be stored - into a _._h_t_a_c_c_e_s_s file. + A big issue with mrtg monitoring data is the expiry time. All these + nice graphs you can create are only valid for a short time. If you do + not take special action some webbrowsers will not notice this and you + may end up with people seeing old data because of caching issues. + + The apache module mod_expire allows you to setup special expiry proper- + ties for individual file. + + Here is an example for how this may look for an mrtg web directory. + The configuration directives can be stored into a _._h_t_a_c_c_e_s_s file. ############################################################ # Example .htaccess for use with apache-1.2 and mod_expire. @@ -70,4 +68,4 @@ -2.14.7 2006-09-06 MRTG-WEBSERVER(1) +2.16.1 2008-02-17 MRTG-WEBSERVER(1) diff -Nru mrtg-2.14.7/lib/mrtg2/BER.pm mrtg-2.16.1/lib/mrtg2/BER.pm --- mrtg-2.14.7/lib/mrtg2/BER.pm 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/lib/mrtg2/BER.pm 2008-02-17 10:27:36.000000000 +0000 @@ -2,7 +2,7 @@ ###################################################################### ### BER (Basic Encoding Rules) encoding and decoding. ###################################################################### -### Copyright (c) 1995-2002, Simon Leinen. +### Copyright (c) 1995-2004, Simon Leinen. ### ### This program is free software; you can redistribute it under the ### "Artistic License" included in this distribution (file "Artistic"). diff -Nru mrtg-2.14.7/lib/mrtg2/MRTG_lib.pm mrtg-2.16.1/lib/mrtg2/MRTG_lib.pm --- mrtg-2.14.7/lib/mrtg2/MRTG_lib.pm 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/lib/mrtg2/MRTG_lib.pm 2008-02-17 10:27:36.000000000 +0000 @@ -1,7 +1,7 @@ # -*- mode: Perl -*- package MRTG_lib; ################################################################### -# MRTG 2.14.7 Support library MRTG_lib.pm +# MRTG 2.16.1 Support library MRTG_lib.pm ################################################################### # Created by Tobias Oetiker # and Dave Rand @@ -99,7 +99,9 @@ [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], 'interval' => - [sub{int($_[0]) >= 1 and int($_[0]) <= 60}, sub{"$_[0] should be at least 1 Minute and no more than 60 Minutes"}], + [sub{$_[0] =~ /(\d+)(?::(\d+))?/ ; + my $int = $1*60; $int += $2 if $2; + $int >= 1 and $int <= 60*60}, sub{"$_[0] should be at least 1 Second (0:01) and no more than 60 Minutes (60)"}], 'writeexpires' => [sub{1}, sub{"Internal Error"}], @@ -168,6 +170,9 @@ 'routername[]' => [sub{1}, sub{"Internal Error"}], #will test this later + 'nohc[]' => + [sub{((lc($_[0])) eq 'yes' or (lc($_[0])) eq 'no')}, sub{"$_[0] must be yes or no"}], + 'maxbytes[]' => [sub{(($_[0] =~ /^[0-9]+$/) && ($_[0] > 0)) }, sub{"$_[0] must be a Number bigger than 0"}], @@ -210,6 +215,10 @@ 'rrdrowcount[]' => [sub{1}, sub{"Internal Error"}], #what ever the user chooses. + 'rrdhwrras[]' => + [sub{$_[0] =~ /^RRA:(HWPREDICT|SEASONAL|DEVPREDICT|DEVSEASONAL|FAILURES):\S+(\s+RRA:(HWPREDICT|SEASONAL|DEVPREDICT|DEVSEASONAL|FAILURES):\S+)*$/}, + sub{"This does not look like rrdtool HW RRAs. Check the rrdcreate manual page for inspiration. ($_[0])"}], + 'extension[]' => [sub{1}, sub{"Internal Error"}], #what ever the user chooses. @@ -296,6 +305,7 @@ [sub{$_[0] =~ /^(?:[-\w]+=\"[^"]*"(?:\s+|$))+$/}, sub{"$_[0] must be XY=\"dddd\" AASD=\"kjlkj\" ... "}], + 'xzoom[]' => [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, sub{"$_[0] must be a Number xxx.xxx"}], @@ -314,6 +324,20 @@ 'threshdir' => [sub{$_[0] && (-d $_[0])}, sub{"Threshold directory $_[0] does not exist"}], + + 'threshhyst' => + [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, + sub{"$_[0] must be a Number xxx.xxx"}], + + 'hwthreshhyst' => + [sub{($_[0] =~ /^[0-9]+(?:\.[0-9]+)?$/)}, + sub{"$_[0] must be a Number xxx.xxx"}], + + 'threshmailserver' => + [sub{$_[0] && gethostbyname($_[0])}, sub{"Unknown mailserver hostname $_[0]"}], + + 'threshmailsender' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], 'threshmini[]' => [sub{1}, sub{"Internal Threshold Config Error"}], @@ -342,6 +366,39 @@ 'threshprogoko[]' => [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + 'threshmailaddress[]' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], + + 'hwthreshmini[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmino[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmaxi[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshmaxo[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshdesc[]' => + [sub{1}, sub{"Internal Threshold Config Error"}], + + 'hwthreshprogi[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogo[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogoki[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshprogoko[]' => + [sub{$_[0] && (-e $_[0])}, sub{"Threshold program $_[0] cannot be executed"}], + + 'hwthreshmailaddress[]' => + [sub{$_[0] && ($_[0] =~ /\S+\@\S+/)}, sub{"ThreshMailAddress $_[0] does not look like an email address at all"}], + 'timestrpos[]' => [sub{$_[0] =~ /^(no|[lr][ul])$/i}, sub{"Must be a string of NO, LU, RU, LL, RL"}], @@ -657,6 +714,16 @@ mkdirhier $$cfg{imagedir} unless $opts->{check}; } } + if ($cfg->{threshmailserver} and not $cfg->{threshmailsender}){ + warn ("WARNING: If \"ThreshMailServer\" is defined, then \"ThreshMailSender\" must be defined too.\n"); + $error = "yes"; + } + if ($cfg->{threshmailsender} and not $cfg->{threshmailserver}){ + warn ("WARNING: If \"ThreshMailSender\" is defined, then \"ThreshMailServer\" must be defined too.\n"); + $error = "yes"; + } + + $cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst}; # build relativ path from htmldir to image dir. my @htmldir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{htmldir}; my @imagedir = split /\Q${MRTG_lib::SL}\E+/, $$cfg{imagedir}; @@ -735,10 +802,15 @@ } # default interval is 5 minutes - $$cfg{interval} = 5 unless defined $$cfg{interval}; + if ($cfg->{interval} and $cfg->{interval} =~ /(\d+)(?::(\d+))?/){ + $cfg->{interval} = $1; + $cfg->{interval} += $2/60.0 if $2; + } else { + $cfg->{interval} = 5; + } unless ($$cfg{logformat} eq 'rrdtool') { # interval has to be 5 minutes at least without userrdtool - if ($$cfg{interval} < 5) { + if ($$cfg{interval} < 5.0) { die "ERROR: CFG Error in \"Interval\": should be at least 5 Minutes (unless you use rrdtool)"; } } @@ -755,10 +827,18 @@ die "ERROR: File $cfg->{ conversioncode } conversion code evaluation failed\n$@\n" unless eval $code; } + my $thresh_error; foreach $rou (@$routers) { # and now for the testing - + if (defined $rcfg->{threshmailaddress}{$rou}){ + if (not defined $cfg->{threshmailserver} and not $thresh_error){ + warn (qq{ERROR: ThreshMailAddress[$rou]: specified without "ThreshMailServer:"}); + $error = "yes"; + $thresh_error = "yes"; + } + # the dependency between sender and server is taken care of already + } if (! defined $rcfg->{snmpoptions}{$rou}) { $rcfg->{snmpoptions}{$rou} = {%{$cfg->{snmpoptions}}} if defined $cfg->{snmpoptions}; @@ -881,8 +961,14 @@ $ipv4only = 0 unless (defined $$rcfg{ipv4only}{$rou}) && (lc($$rcfg{ipv4only}{$rou}) eq 'yes'); } + # Check if nohc has been set, designating a low-speed interface + # without working HC counters. Default is that high-speed + # counters exist. + my $nohc = 0; + $nohc = 1 if (defined $$rcfg{nohc}{$rou}) && (lc($$rcfg{nohc}{$rou}) eq 'yes'); + ( $$rcfg{target}{$rou}, $$rcfg{uniqueTarget}{$rou} ) = - targparser( $$rcfg{target}{$rou}, $target, $targIndex, $ipv4only, $rcfg->{snmpoptions}{$rou} ); + targparser( $$rcfg{target}{$rou}, $target, $targIndex, $ipv4only, $rcfg->{snmpoptions}{$rou}, $nohc ); } else { warn ("WARNING: I can't find a \"target[$rou]\" definition\n"); $error = "yes"; @@ -997,7 +1083,7 @@ sub ensureSL($) { # return; my $ref = shift; - return if $$ref eq ""; + return if not $$ref; debug('dir',"ensure path IN: '$$ref'"); if (${MRTG_lib::SL} eq '\\'){ # two slashes at the start of the string are OK @@ -1030,7 +1116,7 @@ # create expire date for expiery in ARG Minutes sub expistr ($) { - my ($time) = time+$_[0]*60+5; + my ($time) = time+int($_[0]*60)+5; my ($wday) = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat')[(gmtime($time))[6]]; my ($month) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep', 'Oct','Nov','Dec')[(gmtime($time))[4]]; @@ -1114,6 +1200,7 @@ require 'POSIX.pm'; POSIX::setsid() or die "Can't start a new session: $!"; open STDOUT,'>/dev/null' or die "ERROR: Redirecting STDOUT to /dev/null: $!"; + open STDERR,'>/dev/null' or die "ERROR: Redirecting STDERR to /dev/null: $!"; open STDIN, '{OID}) + '((?:\.\d+)*?\.?[-a-zA-Z0-9]*(?:\.\d+)*?)' . # OID possibly starting with a MIB name ($if->{OID}) '(' . # Interface specification alternatives: ($if->{Alt}) '\.' . # separator $ifSimple . # simple alternatives (6 variables) @@ -1395,7 +1484,7 @@ my $d2 = 1 - $d1; # Set the OIDs depending on whether SNMPv2 has been specified # and on the direction - if( $if->{SnmpInfo} =~ m/(?::[^:]*){4}:[32][Cc]?/ ) { + if( $if->{SnmpInfo} =~ m/(?::[^:]*){4}:[32][Cc]?/ and $nohc == 0 ) { $if->{OID}[$d1] = 'ifHCInOctets'; $if->{OID}[$d2] = 'ifHCOutOctets'; } else { @@ -1567,7 +1656,9 @@ my $hostkey = cleanhostkey $host; return if defined $$confcache{$hostkey} and not $reread; my $snmp_errlevel = $SNMP_Session::suppress_warnings; - $SNMP_Session::suppress_warnings = 3; + my $net_snmp_errlevel = $Net_SNMP_util::suppress_warnings; + $SNMP_Session::suppress_warnings = 3; + $Net_SNMP_util::suppress_warnings = 3; debug('coca',"populate confcache $host"); # clear confcache for host; @@ -1584,8 +1675,9 @@ foreach my $node (@nodes) { next if $confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300; $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, $node); - unless ( $SNMP_Session::errmsg){ + unless ( $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ foreach my $ret (@ret) { my ($oid, $desc) = split(':', $ret, 2); @@ -1599,17 +1691,21 @@ }; } else { $confcache->{___deadhosts}{$hostkey} = time - if $SNMP_Session::errmsg =~ /no response received/; + if defined($SNMP_Session::errmsg) and $SNMP_Session::errmsg =~ /no response received/; + $confcache->{___deadhosts}{$hostkey} = time + if defined($Net_SNMP_util::ErrorMessage) and $Net_SNMP_util::ErrorMessage =~ /No response from remote/; debug('coca',"Skipping $node scanning because $host does not seem to support it"); } } if ($confcache->{___deadhosts}{$hostkey} and time - $confcache->{___deadhosts}{$hostkey} < 300){ $SNMP_Session::suppress_warnings = $snmp_errlevel; + $Net_SNMP_util::suppress_warnings = $snmp_errlevel; return; } $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; @ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, "ifPhysAddress"); - unless ( $SNMP_Session::errmsg){ + unless ( $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ foreach my $ret (@ret) { my ($oid, $bin) = split(':', $ret, 2); @@ -1631,6 +1727,7 @@ push @{$$confcache{___updated}}, $hostkey; $SNMP_Session::suppress_warnings = $snmp_errlevel; + $Net_SNMP_util::supress_warnings = $net_snmp_errlevel; } sub log2rrd ($$$) { @@ -1736,7 +1833,7 @@ $DST = 'COUNTER' } - my $MHB = $$cfg{interval} * 60 * 2; + my $MHB = int($$cfg{interval} * 60 * 2); my $MAX1 = $$rcfg{'absmax'}{$router} @@ -1864,7 +1961,7 @@ my $tag = shift; my $msg = shift; return unless grep {$_ eq $tag} @main::DEBUG; - warn "--",$tag,": ",$msg,"\n"; + warn "--".$tag.": ".$msg."\n"; return; } diff -Nru mrtg-2.14.7/lib/mrtg2/Net_SNMP_util.pm mrtg-2.16.1/lib/mrtg2/Net_SNMP_util.pm --- mrtg-2.14.7/lib/mrtg2/Net_SNMP_util.pm 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/lib/mrtg2/Net_SNMP_util.pm 2008-02-17 10:27:36.000000000 +0000 @@ -2,7 +2,7 @@ ###################################################################### ### Net_SNMP_util -- SNMP utilities using Net::SNMP ###################################################################### -### Copyright (c) 2005, Mike Mitchell. +### Copyright (c) 2005-2007 Mike Mitchell. ### ### This program is free software; you can redistribute it under the ### "Artistic License" included in this distribution (file "Artistic"). @@ -13,6 +13,12 @@ ### ### Laszlo Herczeg ### ignore unimplemented SNMP_Session.pm options +### +### Daniel McDonald +### make sure snmpwalk_flg stops when last instance in table is fetched +### +### Alexander Kozlov +### Leave snmpwalk_flg early if no OIDs are returned ###################################################################### package Net_SNMP_util; @@ -50,7 +56,7 @@ ## Handle importing/exporting of symbols -use vars qw( @ISA @EXPORT $VERSION ); +use vars qw( @ISA @EXPORT $VERSION $ErrorMessage); use Exporter; our @ISA = qw( Exporter ); @@ -58,12 +64,12 @@ our @EXPORT = qw( snmpget snmpgetnext snmpwalk snmpset snmptrap snmpgetbulk snmpmaptable snmpmaptable4 snmpwalkhash snmpmapOID snmpMIB_to_OID snmpLoad_OID_Cache - snmpQueue_MIB_File + snmpQueue_MIB_File ErrorMessage ); ## Version of the Net_SNMP_util module -our $VERSION = v1.0.9; +our $VERSION = v1.0.15; use Carp; @@ -382,6 +388,8 @@ sub snmpLoad_OID_Cache ($); sub snmpQueue_MIB_File (@); sub ASNtype ($); +sub error_msg ($); +sub MIB_fill_OID ($); sub version () { $VERSION; } @@ -567,9 +575,7 @@ return wantarray ? @retvals : $retvals[0]; } $ret = join(' ', @vars); - $oid = $session->error(); - carp "SNMPGET Problem for $ret on $host : $oid" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPGET Problem for $ret on ${host}: " . $session->error()); return undef; } @@ -628,9 +634,7 @@ return wantarray ? @retvals : $retvals[0]; } $ret = join(' ', @vars); - $oid = $session->error(); - carp "SNMPGETNEXT Problem for $ret on $host : $oid" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPGETNEXT Problem for $ret on ${host}: " . $session->error()); return undef; } @@ -688,7 +692,7 @@ $session = &snmpopen($host, 0, \@vars); if (!defined($session)) { - carp "SNMPGETBULK Problem for $host\n" + carp "SNMPGETBULK Problem for $host" unless ($Net_SNMP_util::SuppressWarnings > 1); return undef; } @@ -724,9 +728,7 @@ return (@retvals); } else { $ret = join(' ', @vars); - $oid = $session->error(); - carp "SNMPGETBULK Problem for $ret on $host : $oid\n" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPGETBULK Problem for $ret on ${host}: " . $session->error()); return undef; } } @@ -824,7 +826,7 @@ $value = shift @vars; $type = ASNtype($ret); if (!defined($type)) { - carp "unknown SNMP type: $type\n" + carp "Unknown SNMP type: $type\n" unless ($Net_SNMP_util::SuppressWarnings > 1); } push @vals, $oid, $type, $value; @@ -842,9 +844,7 @@ return wantarray ? @retvals : $retvals[0]; } $ret = join(' ', @enoid); - $oid = $session->error(); - carp "SNMPSET Problem for $ret on $host : $oid" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPSET Problem for $ret on ${host}: " . $session->error()); return undef; } @@ -913,16 +913,16 @@ $session = &snmpopen($host, 1, \@vars); if (!defined($session)) { - carp "SNMPTRAP Problem for $host\n" + carp "SNMPTRAP Problem for $host" unless ($Net_SNMP_util::SuppressWarnings > 1); return undef; } if ($Net_SNMP_util::Version == 1) { - $args{'-enterprise'} = $ent if (defined($ent) && (length($ent) > 0)); - $args{'-agentaddr'} = $agent if (defined($agent) && (length($agent) > 0)); - $args{'-generictrap'} = $gen if (defined($gen) && (length($gen) > 0)); - $args{'-specifictrap'} = $spec if (defined($spec) && (length($spec) > 0)); + $args{'-enterprise'} = $ent if (defined($ent) and (length($ent) > 0)); + $args{'-agentaddr'} = $agent if (defined($agent) and (length($agent) > 0)); + $args{'-generictrap'} = $gen if (defined($gen) and (length($gen) > 0)); + $args{'-specifictrap'} = $spec if (defined($spec) and (length($spec) > 0)); } elsif ($Net_SNMP_util::Version > 2) { carp "SNMPTRAP Problem for $host : must use SNMP version 1 or 2" unless ($Net_SNMP_util::SuppressWarnings > 1); @@ -934,7 +934,7 @@ $value = shift @vars; $type = ASNtype($ret); if (!defined($type)) { - carp "unknown SNMP type: $type\n" + carp "unknown SNMP type: $type" unless ($Net_SNMP_util::SuppressWarnings > 1); } push @vals, $oid, $type, $value; @@ -952,9 +952,7 @@ if (!$ret) { $ret = join(' ', @enoid); - $oid = $session->error(); - carp "SNMPTRAP Problem for $ret on $host : $oid" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPTRAP Problem for $ret on ${host}: " . $session->error()); } return $ret; } @@ -1052,7 +1050,7 @@ $session = &snmpopen($host, 0, \@vars); if (!defined($session)) { - carp "SNMPMAPTABLE Problem for $host\n" + carp "SNMPMAPTABLE Problem for $host" unless ($Net_SNMP_util::SuppressWarnings > 1); return undef; } @@ -1094,9 +1092,7 @@ return($nr); } else { $ret = join(' ', @vars); - $oid = $session->error(); - carp "SNMPMAPTABLE Problem for $ret on $host : $oid\n" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPMAPTABLE Problem for $ret on ${host}: " . $session->error()); return undef; } } @@ -1179,6 +1175,7 @@ my(@vars) = @_; my($oid, $txt); + $Net_SNMP_util::ErrorMessage = ''; while($#vars >= 0) { $txt = shift @vars; $oid = shift @vars; @@ -1222,9 +1219,9 @@ my($arg) = @_; my($txt, $oid); + $Net_SNMP_util::ErrorMessage = ''; if (!open(CACHE, $arg)) { - carp "snmpLoad_OID_Cache: Can't open $arg: $!" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("snmpLoad_OID_Cache: Can't open ${arg}: $!"); return -1; } @@ -1239,7 +1236,7 @@ $txt = $1 if ($txt =~ /^[\'\"](.*)[\'\"]/); $oid = $1 if ($oid =~ /^[\'\"](.*)[\'\"]/); if (($txt =~ /^\.?\d+(\.\d+)*\.?$/) - && ($oid !~ /^\.?\d+(\.\d+)*\.?$/)) { + and ($oid !~ /^\.?\d+(\.\d+)*\.?$/)) { my($a) = $oid; $oid = $txt; $txt = $a; @@ -1275,169 +1272,95 @@ # sub snmpMIB_to_OID ($) { my($arg) = @_; - my($quote, $buf, $var, $code, $val, $tmp, $tmpv, $strt); - my($ret, $pass, $pos, $need2pass, $cnt, %prev); - my(%Link) = ( - 'org' => 'iso', - 'dod' => 'org', - 'internet' => 'dod', - 'directory' => 'internet', - 'mgmt' => 'internet', - 'mib-2' => 'mgmt', - 'experimental' => 'internet', - 'private' => 'internet', - 'enterprises' => 'private', - ); + my($cnt, $quote, $buf, %tOIDs, $tgot); + my($var, @parts, $strt, $indx, $ind, $val); + $Net_SNMP_util::ErrorMessage = ''; if (!open(MIB, $arg)) { - carp "snmpMIB_to_OID: Can't open $arg: $!" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("snmpMIB_to_OID: Can't open ${arg}: $!"); return -1; } print "snmpMIB_to_OID: loading $arg\n" if $Net_SNMP_util::Debug; - $ret = 0; - $pass = 0; - $need2pass = 1; $cnt = 0; - $pos = tell(MIB); - while($need2pass) { - while() { - s/--.*--//g; # throw away comments (-- anything --) - s/--.*//; # throw away comments (-- anything EOL) - if ($quote) { - next unless /"/; - $quote = 0; - } - chomp; -# -# $buf = "$buf $_"; -# Previous line removed (and following replacement) -# suggested by Brian Reichert, reichert@numachi.com -# - $buf .= ' ' . $_; - $buf =~ s/\s+/ /g; - - if ($buf =~ / DEFINITIONS ::= BEGIN/) { - if ($pass == 0 && $need2pass) { - seek(MIB, $pos, 0); - $buf = ""; - $pass = 1; - $need2pass = 0; - $cnt = 0; - next; - } - $need2pass = 0; - $pass = 0; - $pos = tell(MIB); - undef %Link; - undef %prev; - %Link = ( - 'org' => 'iso', - 'dod' => 'org', - 'internet' => 'dod', - 'directory' => 'internet', - 'mgmt' => 'internet', - 'mib-2' => 'mgmt', - 'experimental' => 'internet', - 'private' => 'internet', - 'enterprises' => 'private', - ); - $buf = ""; - next; - } - - $buf =~ s/OBJECT-TYPE/OBJECT IDENTIFIER/; - $buf =~ s/OBJECT-IDENTITY/OBJECT IDENTIFIER/; - $buf =~ s/OBJECT-GROUP/OBJECT IDENTIFIER/; - $buf =~ s/MODULE-IDENTITY/OBJECT IDENTIFIER/; - $buf =~ s/ IMPORTS .*\;//; - $buf =~ s/ SEQUENCE {.*}//; - $buf =~ s/ SYNTAX .*//; - $buf =~ s/ [\w\-]+ ::= OBJECT IDENTIFIER//; - $buf =~ s/ OBJECT IDENTIFIER .* ::= {/ OBJECT IDENTIFIER ::= {/; - $buf =~ s/".*"//; - if ($buf =~ /"/) { - $quote = 1; - } - - if ($buf =~ / ([\w\-]+) OBJECT IDENTIFIER ::= {([^}]+)}/) { - $var = $1; - $buf = $2; - undef $val; - $buf =~ s/ +$//; - ($code, $val) = split(' ', $buf, 2); + $quote = 0; + $tgot = 0; + $buf = ''; + while() { + if ($quote) { + next unless /"/; + $quote = 0; + } else { + s/--.*--//g; # throw away comments (-- anything --) + s/^\s*--.*//; # throw away comments at start of line + } + chomp; - if (!defined($val) || (length($val) <= 0)) { - $Net_SNMP_util::OIDS{$var} = $code; - $cnt++; - print "'$var' => '$code'\n" if $Net_SNMP_util::Debug; - } else { - $strt = $code; - while($val =~ / /) { - ($tmp, $val) = split(' ', $val, 2); - if ($tmp =~ /([\w\-]+)\((\d+)\)/) { - $tmp = $1; - if (exists($Net_SNMP_util::OIDS{$strt})) { - $tmpv = "$Net_SNMP_util::OIDS{$strt}.$2"; - } else { - $tmpv = $2; - } - $Link{$tmp} = $strt; - if (!exists($prev{$tmp}) && exists($Net_SNMP_util::OIDS{$tmp})) { - if ($tmpv ne $Net_SNMP_util::OIDS{$tmp}) { - $strt = "$strt.$tmp"; - $Net_SNMP_util::OIDS{$strt} = $tmpv; - $cnt++; - } - } else { - $prev{$tmp} = 1; - $Net_SNMP_util::OIDS{$tmp} = $tmpv; - $cnt++; - $strt = $tmp; - } - } - } + $buf .= ' ' . $_; - if (!exists($Net_SNMP_util::OIDS{$strt})) { - if ($pass) { - carp "snmpMIB_to_OID: $arg: \"$strt\" prefix unknown, load the parent MIB first.\n" - unless ($Net_SNMP_util::SuppressWarnings > 1); - } else { - $need2pass = 1; - } - } - $Link{$var} = $strt; - if (exists($Net_SNMP_util::OIDS{$strt})) { - $val = "$Net_SNMP_util::OIDS{$strt}.$val"; + $buf =~ s/"[^"]*"//g; + if ($buf =~ /"/) { + $quote = 1; + next; + } + $buf =~ s/--.*--//g; # throw away comments (-- anything --) + $buf =~ s/--.*//; # throw away comments (-- anything EOL) + $buf =~ s/\s+/ /g; + if ($buf =~ /DEFINITIONS *::= *BEGIN/) { + $cnt += MIB_fill_OID(\%tOIDs) if ($tgot); + $buf = ''; + %tOIDs = (); + $tgot = 0; + next; + } + $buf =~ s/OBJECT-TYPE/OBJECT IDENTIFIER/; + $buf =~ s/OBJECT-IDENTITY/OBJECT IDENTIFIER/; + $buf =~ s/OBJECT-GROUP/OBJECT IDENTIFIER/; + $buf =~ s/MODULE-IDENTITY/OBJECT IDENTIFIER/; + $buf =~ s/ IMPORTS .*\;//; + $buf =~ s/ SEQUENCE *{.*}//; + $buf =~ s/ SYNTAX .*//; + $buf =~ s/ [\w\-]+ *::= *OBJECT IDENTIFIER//; + $buf =~ s/ OBJECT IDENTIFIER.*::= *{/ OBJECT IDENTIFIER ::= {/; + + if ($buf =~ / ([\w\-]+) OBJECT IDENTIFIER *::= *{([^}]+)}/) { + $var = $1; + $buf = $2; + $buf =~ s/ +$//; + $buf =~ s/\s+\(/\(/g; # remove spacing around '(' + $buf =~ s/\(\s+/\(/g; + $buf =~ s/\s+\)/\)/g; # remove spacing before ')' + @parts = split(' ', $buf); + $strt = ''; + foreach $indx (@parts) { + if ($indx =~ /([\w\-]+)\((\d+)\)/) { + $ind = $1; + $val = $2; + if (exists($tOIDs{$strt})) { + $tOIDs{$ind} = $tOIDs{$strt} . '.' . $val; + } elsif ($strt ne '') { + $tOIDs{$ind} = "${strt}.${val}"; + } else { + $tOIDs{$ind} = $val; } - if (!exists($prev{$var}) && exists($Net_SNMP_util::OIDS{$var})) { - if ($val ne $Net_SNMP_util::OIDS{$var}) { - $var = "$strt.$var"; - } + $strt = $ind; + $tgot = 1; + } elsif ($indx =~ /^\d+$/) { + if (exists($tOIDs{$strt})) { + $tOIDs{$var} = $tOIDs{$strt} . '.' . $indx; + } else { + $tOIDs{$var} = "${strt}.${indx}"; } - - $Net_SNMP_util::OIDS{$var} = $val; - $prev{$var} = 1; - $cnt++; - - print "'$var' => '$val'\n" if $Net_SNMP_util::Debug; + $tgot = 1; + } else { + $strt = $indx; } - undef $buf; } - } - if ($pass == 0 && $need2pass) { - seek(MIB, $pos, 0); - $buf = ""; - $pass = 1; - $cnt = 0; - } else { - $ret += $cnt; - $need2pass = 0; + $buf = ''; } } - close(MIB); - $RevNeeded = 1; - return $ret; + $cnt += MIB_fill_OID(\%tOIDs) if ($tgot); + $RevNeeded = 1 if ($cnt > 0); + return $cnt; } =head2 snmpQueue_MIB_File() - queue a MIB file for reading "on demand" @@ -1468,6 +1391,7 @@ my(@files) = @_; my($file); + $Net_SNMP_util::ErrorMessage = ''; foreach $file (@files) { push(@Net_SNMP_util::MIB_Files, $file); } @@ -1493,7 +1417,7 @@ # We can't split on the : character because a numeric IPv6 # address contains a variable number of :'s - if( ($host =~ /^(\[.*\]):(.*)$/) || ($host =~ /^(\[.*\])$/) ) { + if( ($host =~ /^(\[.*\]):(.*)$/) or ($host =~ /^(\[.*\])$/) ) { # Numeric IPv6 address between [] ($host, $opts) = ($1, $2); } else { @@ -1501,22 +1425,22 @@ ($host, $opts) = split(':', $host, 2); } ($port, $timeout, $retries, $backoff, $version, $v4onlystr) - = split(':', $opts, 6) if(defined($opts) && (length $opts > 0) ); + = split(':', $opts, 6) if(defined($opts) and (length $opts > 0) ); - undef($timeout) if (defined($timeout) && length($timeout) <= 0); - undef($retries) if (defined($retries) && length($retries) <= 0); - undef($backoff) if (defined($backoff) && length($backoff) <= 0); - undef($version) if (defined($version) && length($version) <= 0); + undef($timeout) if (defined($timeout) and length($timeout) <= 0); + undef($retries) if (defined($retries) and length($retries) <= 0); + undef($backoff) if (defined($backoff) and length($backoff) <= 0); + undef($version) if (defined($version) and length($version) <= 0); $v4onlystr = "" unless defined $v4onlystr; - if (defined($port) && ($port =~ /^([^!]*)!(.*)$/)) { + if (defined($port) and ($port =~ /^([^!]*)!(.*)$/)) { ($port, $lhost) = ($1, $2); $nlhost = $lhost; ($lhost, $lport) = ($1, $2) if ($lhost =~ /^(.*)!(.*)$/); - undef($lport) if (defined($lport) && (length($lport) <= 0)); + undef($lport) if (defined($lport) and (length($lport) <= 0)); } - undef($port) if (defined($port) && length($port) <= 0); + undef($port) if (defined($port) and length($port) <= 0); if (ref $vars->[0] eq 'HASH') { undef($debug); @@ -1571,10 +1495,10 @@ } } - $port = 162 if ($type == 1 && !defined($port)); + $port = 162 if ($type == 1 and !defined($port)); $nhost = "$community\@$host"; $nhost .= ":" . $port if (defined($port)); - undef($lhost) if (defined($lhost) && (length($lhost) <= 0)); + undef($lhost) if (defined($lhost) and (length($lhost) <= 0)); $version = '1' unless defined $version; if ($version =~ /1/) { @@ -1584,11 +1508,12 @@ } elsif ($version =~ /3/) { $version = 3; } + $Net_SNMP_util::ErrorMessage = ''; if ((!defined($Net_SNMP_util::Session)) - || ($Net_SNMP_util::Host ne $nhost) - || ($Net_SNMP_util::Version ne $version) - || ($Net_SNMP_util::LHost ne $nlhost) - || ($Net_SNMP_util::IPv4only ne $v4onlystr)) { + or ($Net_SNMP_util::Host ne $nhost) + or ($Net_SNMP_util::Version ne $version) + or ($Net_SNMP_util::LHost ne $nlhost) + or ($Net_SNMP_util::IPv4only ne $v4onlystr)) { if (defined($Net_SNMP_util::Session)) { $Net_SNMP_util::Session->close(); undef $Net_SNMP_util::Session; @@ -1620,20 +1545,19 @@ $Net_SNMP_util::LHost = $nlhost; $Net_SNMP_util::IPv4only = $v4onlystr; } else { - carp "SNMPopen failed: $tmp" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPopen failed: $tmp\n"); return(undef); } return $Net_SNMP_util::Session; } else { $Net_SNMP_util::Session->timeout($timeout) - if (defined($timeout) && (length($timeout) > 0)); + if (defined($timeout) and (length($timeout) > 0)); $Net_SNMP_util::Session->retries($retries) - if (defined($retries) && (length($retries) > 0)); + if (defined($retries) and (length($retries) > 0)); $Net_SNMP_util::Session->maxmsgsize($maxmsgsize) - if (defined($maxmsgsize) && (length($maxmsgsize) > 0)); + if (defined($maxmsgsize) and (length($maxmsgsize) > 0)); $Net_SNMP_util::Session->debug($debug) - if (defined($debug) && (length($debug) > 0)); + if (defined($debug) and (length($debug) > 0)); $Net_SNMP_util::Session->{_context_engine_id} = undef if (!defined($Net_SNMP_util::ContextEngineID)); $Net_SNMP_util::Session->{_context_name} = undef @@ -1652,7 +1576,7 @@ undef @retvar; foreach $var (@vars) { ($oid, $tmp) = &Check_OID($var); - if (!$oid && $Net_SNMP_util::CacheLoaded == 0) { + if (!$oid and $Net_SNMP_util::CacheLoaded == 0) { $tmp = $Net_SNMP_util::SuppressWarnings; $Net_SNMP_util::SuppressWarnings = 1000; @@ -1663,7 +1587,7 @@ ($oid, $tmp) = &Check_OID($var); } - while (!$oid && $#Net_SNMP_util::MIB_Files >= 0) { + while (!$oid and $#Net_SNMP_util::MIB_Files >= 0) { $tmp = $Net_SNMP_util::SuppressWarnings; $Net_SNMP_util::SuppressWarnings = 1000; @@ -1681,8 +1605,8 @@ if ($oid) { $var =~ s/^$tmp/$oid/; } else { - carp "Unknown SNMP var $var" - unless ($Net_SNMP_util::SuppressWarnings > 1); + carp("Unknown SNMP var $var\n") + unless ($Net_SNMP_util::SuppressWarnings > 1); next; } while ($var =~ /\"([^\"]*)\"/) { @@ -1704,7 +1628,7 @@ my($var) = @_; my($tmp, $tmpv, $oid); - if ($var =~ /^[a-zA-Z][\w\-]*(\.[a-zA-Z][\w\-])*/) + if ($var =~ /^[a-zA-Z][\w\-]*(\.[a-zA-Z][\w\-]*)*/) { $tmp = $&; $tmpv = $tmp; @@ -1725,12 +1649,13 @@ sub snmpwalk_flg ($$@) { my($host, $hash_sub, @vars) = @_; my($session, %args, @enoid, @poid, $toid, $oid, $got); - my($val, $ret, %soid, @retvals, $tmp); + my($val, $ret, %soid, %nsoid, @retvals, $tmp); my(%rethash, $h_ref, @tmprefs); + my($stop); $session = &snmpopen($host, 0, \@vars); if (!defined($session)) { - carp "SNMPWALK Problem for $host\n" + carp "SNMPWALK Problem for $host" unless ($Net_SNMP_util::SuppressWarnings > 1); return undef; } @@ -1743,7 +1668,7 @@ # # Create/Refresh a reversed hash with oid -> name # - if (defined($hash_sub) && ($RevNeeded)) { + if (defined($hash_sub) and ($RevNeeded)) { %revOIDS = reverse %Net_SNMP_util::OIDS; $RevNeeded = 0; } @@ -1754,6 +1679,7 @@ foreach $oid (0..$#enoid) { my $tmparray = []; $tmprefs[$oid] = $tmparray; + $nsoid{$oid} = $oid; } $got = 0; @@ -1769,24 +1695,27 @@ if (defined($Net_SNMP_util::ContextName)); } - do { + while($#poid >= 0) { $args{'-varbindlist'} = \@poid; if (($Net_SNMP_util::Version > 1) - && ($Net_SNMP_util::MaxRepetitions > 1)) { + and ($Net_SNMP_util::MaxRepetitions > 1)) { $ret = $session->get_bulk_request(%args); } else { $ret = $session->get_next_request(%args); } last if (!defined($ret)); - undef %soid; + %soid = %nsoid; + undef %nsoid; + $stop = 0; foreach $oid (&Net::SNMP::oid_lex_sort(keys %$ret)) { $got = 1; $tmp = -1; foreach $toid (@enoid) { $tmp++; - if (&Net::SNMP::oid_base_match($toid, $oid)) { - $soid{$toid} = $oid; + if (&Net::SNMP::oid_base_match($toid, $oid) + and (!exists($soid{$toid}) or ($oid ne $soid{$toid}))) { + $nsoid{$toid} = $oid; if (defined($hash_sub)) { # # extract name of the oid, if possible, the rest becomes the @@ -1794,16 +1723,16 @@ # my $inst = ""; my $upo = $toid; - while (!exists($revOIDS{$upo}) && length($upo)) { + while (!exists($revOIDS{$upo}) and length($upo)) { $upo =~ s/(\.\d+?)$//; - if (defined($1) && length($1)) { + if (defined($1) and length($1)) { $inst = $1 . $inst; } else { $upo = ""; last; } } - if (length($upo) && exists($revOIDS{$upo})) { + if (length($upo) and exists($revOIDS{$upo})) { $upo = $revOIDS{$upo} . $inst; } else { $upo = $toid; @@ -1812,16 +1741,16 @@ my $qoid = $oid; my $tmpo; $inst = ""; - while (!exists($revOIDS{$qoid}) && length($qoid)) { + while (!exists($revOIDS{$qoid}) and length($qoid)) { $qoid =~ s/(\.\d+?)$//; - if (defined($1) && length($1)) { + if (defined($1) and length($1)) { $inst = $1 . $inst; } else { $qoid = ""; last; } } - if (length($qoid) && exists($revOIDS{$qoid})) { + if (length($qoid) and exists($revOIDS{$qoid})) { $tmpo = $qoid; $qoid = $revOIDS{$qoid}; } else { @@ -1839,12 +1768,14 @@ $tmpo = substr($oid, length($toid)+1); push @{$tmprefs[$tmp]}, "$tmpo:$tmpv"; } + } else { + $stop = 1 if ($#enoid == 0); } } } undef @poid; - @poid = values %soid; - } while($#poid >= 0); + @poid = values %nsoid if (!$stop); + } if ($got) { if (defined($hash_sub)) { return ($h_ref) if ($Net_SNMP_util::ReturnHashRefs); @@ -1871,9 +1802,7 @@ } } else { $ret = join(' ', @vars); - $oid = $session->error(); - carp "SNMPWALK Problem for $ret on $host : $oid\n" - unless ($Net_SNMP_util::SuppressWarnings > 1); + error_msg("SNMPWALK Problem for $ret on ${host}: " . $session->error()); return undef; } } @@ -1930,12 +1859,87 @@ $type = 0x42; } elsif ($type eq "gauge32") { $type = 0x42; - } elsif (($type <= 0) || ($type > 255)) { + } elsif (($type <= 0) or ($type > 255)) { return undef; } return $type; } +# +# set the ErrorMessage global and print an error message +# +sub error_msg($) +{ + my($msg) = @_; + $Net_SNMP_util::ErrorMessage = $msg; + if ($Net_SNMP_util::SuppressWarnings <= 1) { + $Carp::CarpLevel++; + carp($msg); + $Carp::CarpLevel--; + } +} + +# +# Fill the OIDS hash with results from the MIB parsing +# +sub MIB_fill_OID($) +{ + my($href) = @_; + my($cnt, $changed, @del, $var, $val, @parts, $indx); + my(%seen); + + $cnt = 0; + do { + $changed = 0; + @del = (); + foreach $var (keys %$href) { + $val = $href->{$var}; + @parts = split('\.', $val); + $val = ''; + foreach $indx (@parts) { + if ($indx =~ /^\d+$/) { + $val .= '.' . $indx; + } else { + if (exists($Net_SNMP_util::OIDS{$indx})) { + $val = $Net_SNMP_util::OIDS{$indx}; + } else { + $val .= '.' . $indx; + } + } + } + if ($val =~ /^[\d\.]+$/) { + $val =~ s/^\.//; + if (!exists($Net_SNMP_util::OIDS{$var}) + || (length($val) > length($Net_SNMP_util::OIDS{$var}))) { + $Net_SNMP_util::OIDS{$var} = $val; + print "'$var' => '$val'\n" if $Net_SNMP_util::Debug; + $changed = 1; + $cnt++; + } + push @del, $var; + } + } + foreach $var (@del) { + delete $href->{$var}; + } + } while($changed); + + $Carp::CarpLevel++; + foreach $var (sort keys %$href) { + $val = $href->{$var}; + $val =~ s/\..*//; + next if (exists($seen{$val})); + $seen{$val} = 1; + $seen{$var} = 1; + error_msg( + "snmpMIB_to_OID: prefix \"$val\" unknown, load the parent MIB first.\n" + ); + } + $Carp::CarpLevel--; + return $cnt; +} + + # [documentation] ------------------------------------------------------------ =head1 EXPORTS @@ -1950,7 +1954,7 @@ &snmpget, &snmpgetnext, &snmpgetbulk, &snmpwalk, &snmpset, &snmptrap, &snmpmaptable, &snmpmaptable4, &snmpwalkhash, &snmpmapOID, &snmpMIB_to_OID, -&snmpLoad_OID_Cache, &snmpQueue_MIB_File +&snmpLoad_OID_Cache, &snmpQueue_MIB_File, ErrorMessage =back @@ -2064,7 +2068,7 @@ =head1 COPYRIGHT -Copyright (c) 2005 Mike Mitchell. All rights reserved. This program +Copyright (c) 2007 Mike Mitchell. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff -Nru mrtg-2.14.7/lib/mrtg2/SNMP_Session.pm mrtg-2.16.1/lib/mrtg2/SNMP_Session.pm --- mrtg-2.14.7/lib/mrtg2/SNMP_Session.pm 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/lib/mrtg2/SNMP_Session.pm 2008-02-17 10:27:36.000000000 +0000 @@ -2,7 +2,7 @@ ###################################################################### ### SNMP Request/Response Handling ###################################################################### -### Copyright (c) 1995-2002, Simon Leinen. +### Copyright (c) 1995-2006, Simon Leinen. ### ### This program is free software; you can redistribute it under the ### "Artistic License" included in this distribution (file "Artistic"). @@ -38,6 +38,7 @@ ### Luc Pauwels : use_16bit_request_ids ### Andrew Cornford-Matheson : inform ### Gerry Dalton : strict subs bug +### Mike Fischer : pass MSG_DONTWAIT to recv() ###################################################################### package SNMP_Session; @@ -60,7 +61,7 @@ sub index_compare ($$); sub oid_diff ($$); -$VERSION = '1.08'; +$VERSION = '1.10'; @ISA = qw(Exporter); @@ -136,7 +137,7 @@ $SNMP_Session::ipv6available = 0; if (eval {local $SIG{__DIE__};require Socket6;} && - eval {local $SIG{__DIE__};require IO::Socket::INET6; IO::Socket::INET6->VERSION("1.26");}) { + eval {local $SIG{__DIE__};require IO::Socket::INET6; IO::Socket::INET6->VERSION("1.26");}) { import Socket6; $ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1"))); $SNMP_Session::ipv6available = 1; @@ -389,7 +390,7 @@ my($response_length); $response_length - = $this->receive_response_3 ($response_tag, $oids, $errorp); + = $this->receive_response_3 ($response_tag, $oids, $errorp, 1); if ($response_length) { # IlvJa # Add response pdu to capture_buffer @@ -827,9 +828,11 @@ } sub receive_response_3 { - my ($this, $response_tag, $oids, $errorp) = @_; + my ($this, $response_tag, $oids, $errorp, $dont_block_p) = @_; my ($remote_addr); - $remote_addr = recv ($this->sock,$this->{'pdu_buffer'},$this->max_pdu_len,0); + my $flags = 0; + eval '$flags = MSG_DONTWAIT;' if defined $dont_block_p and $dont_block_p; + $remote_addr = recv ($this->sock,$this->{'pdu_buffer'},$this->max_pdu_len,$flags); return $this->error ("receiving response PDU: $!") unless defined $remote_addr; return $this->error ("short (".length $this->{'pdu_buffer'} diff -Nru mrtg-2.14.7/lib/mrtg2/SNMP_util.pm mrtg-2.16.1/lib/mrtg2/SNMP_util.pm --- mrtg-2.14.7/lib/mrtg2/SNMP_util.pm 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/lib/mrtg2/SNMP_util.pm 2008-02-17 10:27:36.000000000 +0000 @@ -2,7 +2,7 @@ ###################################################################### ### SNMP_util -- SNMP utilities using SNMP_Session.pm and BER.pm ###################################################################### -### Copyright (c) 1998-2005, Mike Mitchell. +### Copyright (c) 1998-2007, Mike Mitchell. ### ### This program is free software; you can redistribute it under the ### "Artistic License" included in this distribution (file "Artistic"). @@ -43,7 +43,7 @@ use SNMP_Session "1.00"; use Socket; -$VERSION = '1.08'; +$VERSION = '1.12'; @ISA = qw(Exporter); @@ -364,6 +364,7 @@ sub Check_OID ($); sub snmpLoad_OID_Cache ($); sub snmpQueue_MIB_File (@); +sub MIB_fill_OID ($); sub version () { $VERSION; } @@ -385,7 +386,7 @@ # We can't split on the : character because a numeric IPv6 # address contains a variable number of :'s my $opts; - if( ($host =~ /^(\[.*\]):(.*)$/) || ($host =~ /^(\[.*\])$/) ) { + if( ($host =~ /^(\[.*\]):(.*)$/) or ($host =~ /^(\[.*\])$/) ) { # Numeric IPv6 address between [] ($host, $opts) = ($1, $2); } else { @@ -393,28 +394,28 @@ ($host, $opts) = split(':', $host, 2); } ($port, $timeout, $retries, $backoff, $version, $v4onlystr) = split(':', $opts, 6) - if(defined($opts) && (length $opts > 0) ); + if(defined($opts) and (length $opts > 0) ); - undef($version) if (defined($version) && length($version) <= 0); + undef($version) if (defined($version) and length($version) <= 0); $v4onlystr = "" unless defined $v4onlystr; $version = '1' unless defined $version; - if (defined($port) && ($port =~ /^([^!]*)!(.*)$/)) { + if (defined($port) and ($port =~ /^([^!]*)!(.*)$/)) { ($port, $lhost) = ($1, $2); $nlhost = $lhost; ($lhost, $lport) = ($1, $2) if ($lhost =~ /^(.*)!(.*)$/); - undef($lhost) if (defined($lhost) && (length($lhost) <= 0)); - undef($lport) if (defined($lport) && (length($lport) <= 0)); + undef($lhost) if (defined($lhost) and (length($lhost) <= 0)); + undef($lport) if (defined($lport) and (length($lport) <= 0)); } - undef($port) if (defined($port) && length($port) <= 0); - $port = 162 if ($type == 1 && !defined($port)); + undef($port) if (defined($port) and length($port) <= 0); + $port = 162 if ($type == 1 and !defined($port)); $nhost = "$community\@$host"; $nhost .= ":" . $port if (defined($port)); if ((!defined($SNMP_util::Session)) - || ($SNMP_util::Host ne $nhost) - || ($SNMP_util::Version ne $version) - || ($SNMP_util::LHost ne $nlhost) - || ($SNMP_util::IPv4only ne $v4onlystr)) { + or ($SNMP_util::Host ne $nhost) + or ($SNMP_util::Version ne $version) + or ($SNMP_util::LHost ne $nlhost) + or ($SNMP_util::IPv4only ne $v4onlystr)) { if (defined($SNMP_util::Session)) { $SNMP_util::Session->close(); undef $SNMP_util::Session; @@ -459,11 +460,11 @@ } } $SNMP_util::Session->set_timeout($timeout) - if (defined($timeout) && (length($timeout) > 0)); + if (defined($timeout) and (length($timeout) > 0)); $SNMP_util::Session->set_retries($retries) - if (defined($retries) && (length($retries) > 0)); + if (defined($retries) and (length($retries) > 0)); $SNMP_util::Session->set_backoff($backoff) - if (defined($backoff) && (length($backoff) > 0)); + if (defined($backoff) and (length($backoff) > 0)); } return $SNMP_util::Session; } @@ -590,7 +591,7 @@ # # Create/Refresh a reversed hash with oid -> name # - if (defined($hash_sub) && ($RevNeeded)) { + if (defined($hash_sub) and ($RevNeeded)) { %revOIDS = reverse %SNMP_util::OIDS; $RevNeeded = 0; } @@ -624,7 +625,7 @@ } - while(($SNMP_util::Version ne '1' && $session->{'use_getbulk'}) + while(($SNMP_util::Version ne '1' and $session->{'use_getbulk'}) ? $session->getbulk_request_response(0, $session->default_max_repetitions(), @nnoid) @@ -644,7 +645,7 @@ $ok = 0; my $tempo = pretty_print($oid); $noid = $avars[$ix]; # IlvJa - if ($tempo =~ /^$noid\./ || $tempo eq $noid ) { + if ($tempo =~ /^$noid\./ or $tempo eq $noid ) { $ok = 1; $upoid = $noid; } else { @@ -661,7 +662,16 @@ if ($ok) { my $tmp = encode_oid_with_errmsg ($tempo); return undef unless defined $tmp; - next if (exists($done{$tmp})); # GIL + if (exists($done{$tmp})) { # GIL, Ilvja + # + # We've detected a loop for $nnoid[$ix], so mark it as finished. + # Exclude this variable from further requests. + # + $avars[$ix] = ""; + $nnoid[$ix] = ""; + $retvaltmprefs[$ix] = undef if $SNMP_util::Return_array_refs; + next; + } $nnoid[$ix] = $tmp; # Keep on walking. (IlvJa) my $tempv = pretty_print($value); if (defined($hash_sub)) { @@ -670,32 +680,32 @@ # my $inst = ""; my $upo = $upoid; - while (!exists($revOIDS{$upo}) && length($upo)) { + while (!exists($revOIDS{$upo}) and length($upo)) { $upo =~ s/(\.\d+?)$//; - if (defined($1) && length($1)) { + if (defined($1) and length($1)) { $inst = $1 . $inst; } else { $upo = ""; last; } } - if (length($upo) && exists($revOIDS{$upo})) { + if (length($upo) and exists($revOIDS{$upo})) { $upo = $revOIDS{$upo} . $inst; } else { $upo = $upoid; } $inst = ""; - while (!exists($revOIDS{$tempo}) && length($tempo)) { + while (!exists($revOIDS{$tempo}) and length($tempo)) { $tempo =~ s/(\.\d+?)$//; - if (defined($1) && length($1)) { + if (defined($1) and length($1)) { $inst = $1 . $inst; } else { $tempo = ""; last; } } - if (length($tempo) && exists($revOIDS{$tempo})) { + if (length($tempo) and exists($revOIDS{$tempo})) { $var = $revOIDS{$tempo}; } else { $var = pretty_print($oid); @@ -987,7 +997,7 @@ undef @retvar; foreach $var (@vars) { ($oid, $tmp) = &Check_OID($var); - if (!$oid && $SNMP_util::CacheLoaded == 0) { + if (!$oid and $SNMP_util::CacheLoaded == 0) { $tmp = $SNMP_Session::suppress_warnings; $SNMP_Session::suppress_warnings = 1000; @@ -998,7 +1008,7 @@ ($oid, $tmp) = &Check_OID($var); } - while (!$oid && $#SNMP_util::MIB_Files >= 0) { + while (!$oid and $#SNMP_util::MIB_Files >= 0) { $tmp = $SNMP_Session::suppress_warnings; $SNMP_Session::suppress_warnings = 1000; @@ -1084,7 +1094,7 @@ $txt = $1 if ($txt =~ /^[\'\"](.*)[\'\"]/); $oid = $1 if ($oid =~ /^[\'\"](.*)[\'\"]/); if (($txt =~ /^\.?\d+(\.\d+)*\.?$/) - && ($oid !~ /^\.?\d+(\.\d+)*\.?$/)) { + and ($oid !~ /^\.?\d+(\.\d+)*\.?$/)) { my($a) = $oid; $oid = $txt; $txt = $a; @@ -1106,7 +1116,7 @@ my($var) = @_; my($tmp, $tmpv, $oid); - if ($var =~ /^[a-zA-Z][\w\-]*(\.[a-zA-Z][\w\-])*/) + if ($var =~ /^[a-zA-Z][\w\-]*(\.[a-zA-Z][\w\-]*)*/) { $tmp = $&; $tmpv = $tmp; @@ -1144,19 +1154,8 @@ # sub snmpMIB_to_OID ($) { my($arg) = @_; - my($quote, $buf, $var, $code, $val, $tmp, $tmpv, $strt); - my($ret, $pass, $pos, $need2pass, $cnt, %prev); - my(%Link) = ( - 'org' => 'iso', - 'dod' => 'org', - 'internet' => 'dod', - 'directory' => 'internet', - 'mgmt' => 'internet', - 'mib-2' => 'mgmt', - 'experimental' => 'internet', - 'private' => 'internet', - 'enterprises' => 'private', - ); + my($cnt, $quote, $buf, %tOIDs, $tgot); + my($var, @parts, $strt, $indx, $ind, $val); if (!open(MIB, $arg)) { carp "snmpMIB_to_OID: Can't open $arg: $!" @@ -1164,151 +1163,148 @@ return -1; } print "snmpMIB_to_OID: loading $arg\n" if $SNMP_util::Debug; - $ret = 0; - $pass = 0; - $need2pass = 1; $cnt = 0; - $pos = tell(MIB); - while($need2pass) { - while() { - s/--.*--//g; # throw away comments (-- anything --) - s/--.*//; # throw away comments (-- anything EOL) - if ($quote) { - next unless /"/; - $quote = 0; - } - chomp; -# -# $buf = "$buf $_"; -# Previous line removed (and following replacement) -# suggested by Brian Reichert, reichert@numachi.com -# - $buf .= ' ' . $_; - $buf =~ s/\s+/ /g; - - if ($buf =~ / DEFINITIONS ::= BEGIN/) { - if ($pass == 0 && $need2pass) { - seek(MIB, $pos, 0); - $buf = ""; - $pass = 1; - $need2pass = 0; - $cnt = 0; - next; - } - $need2pass = 0; - $pass = 0; - $pos = tell(MIB); - undef %Link; - undef %prev; - %Link = ( - 'org' => 'iso', - 'dod' => 'org', - 'internet' => 'dod', - 'directory' => 'internet', - 'mgmt' => 'internet', - 'mib-2' => 'mgmt', - 'experimental' => 'internet', - 'private' => 'internet', - 'enterprises' => 'private', - ); - $buf = ""; - next; - } + $quote = 0; + $tgot = 0; + $buf = ''; + while() { + if ($quote) { + next unless /"/; + $quote = 0; + } else { + s/--.*--//g; # throw away comments (-- anything --) + s/^\s*--.*//; # throw away comments at start of line + } + chomp; + + $buf .= ' ' . $_; - $buf =~ s/OBJECT-TYPE/OBJECT IDENTIFIER/; - $buf =~ s/OBJECT-IDENTITY/OBJECT IDENTIFIER/; - $buf =~ s/OBJECT-GROUP/OBJECT IDENTIFIER/; - $buf =~ s/MODULE-IDENTITY/OBJECT IDENTIFIER/; - $buf =~ s/ IMPORTS .*\;//; - $buf =~ s/ SEQUENCE {.*}//; - $buf =~ s/ SYNTAX .*//; - $buf =~ s/ [\w\-]+ ::= OBJECT IDENTIFIER//; - $buf =~ s/ OBJECT IDENTIFIER .* ::= {/ OBJECT IDENTIFIER ::= {/; - $buf =~ s/".*"//; - if ($buf =~ /"/) { - $quote = 1; + $buf =~ s/"[^"]*"//g; + if ($buf =~ /"/) { + $quote = 1; + next; + } + $buf =~ s/--.*--//g; # throw away comments (-- anything --) + $buf =~ s/--.*//; # throw away comments (-- anything EOL) + $buf =~ s/\s+/ /g; + if ($buf =~ /DEFINITIONS *::= *BEGIN/) { + $cnt += MIB_fill_OID(\%tOIDs) if ($tgot); + $buf = ''; + %tOIDs = (); + $tgot = 0; + next; + } + $buf =~ s/OBJECT-TYPE/OBJECT IDENTIFIER/; + $buf =~ s/OBJECT-IDENTITY/OBJECT IDENTIFIER/; + $buf =~ s/OBJECT-GROUP/OBJECT IDENTIFIER/; + $buf =~ s/MODULE-IDENTITY/OBJECT IDENTIFIER/; + $buf =~ s/ IMPORTS .*\;//; + $buf =~ s/ SEQUENCE *{.*}//; + $buf =~ s/ SYNTAX .*//; + $buf =~ s/ [\w\-]+ *::= *OBJECT IDENTIFIER//; + $buf =~ s/ OBJECT IDENTIFIER.*::= *{/ OBJECT IDENTIFIER ::= {/; + + if ($buf =~ / ([\w\-]+) OBJECT IDENTIFIER *::= *{([^}]+)}/) { + $var = $1; + $buf = $2; + $buf =~ s/ +$//; + $buf =~ s/\s+\(/\(/g; # remove spacing around '(' + $buf =~ s/\(\s+/\(/g; + $buf =~ s/\s+\)/\)/g; # remove spacing before ')' + @parts = split(' ', $buf); + $strt = ''; + foreach $indx (@parts) { + if ($indx =~ /([\w\-]+)\((\d+)\)/) { + $ind = $1; + $val = $2; + if (exists($tOIDs{$strt})) { + $tOIDs{$ind} = $tOIDs{$strt} . '.' . $val; + } elsif ($strt ne '') { + $tOIDs{$ind} = "${strt}.${val}"; + } else { + $tOIDs{$ind} = $val; + } + $strt = $ind; + $tgot = 1; + } elsif ($indx =~ /^\d+$/) { + if (exists($tOIDs{$strt})) { + $tOIDs{$var} = $tOIDs{$strt} . '.' . $indx; + } else { + $tOIDs{$var} = "${strt}.${indx}"; + } + $tgot = 1; + } else { + $strt = $indx; + } } + $buf = ''; + } + } + $cnt += MIB_fill_OID(\%tOIDs) if ($tgot); + $RevNeeded = 1 if ($cnt > 0); + return $cnt; +} - if ($buf =~ / ([\w\-]+) OBJECT IDENTIFIER ::= {([^}]+)}/) { - $var = $1; - $buf = $2; - undef $val; - $buf =~ s/ +$//; - ($code, $val) = split(' ', $buf, 2); +# +# Fill the OIDS hash with results from the MIB parsing +# +sub MIB_fill_OID ($) +{ + my($href) = @_; + my($cnt, $changed, @del, $var, $val, @parts, $indx); + my(%seen); - if (!defined($val) || (length($val) <= 0)) { - $SNMP_util::OIDS{$var} = $code; - $cnt++; - print "'$var' => '$code'\n" if $SNMP_util::Debug; + $cnt = 0; + do { + $changed = 0; + @del = (); + foreach $var (keys %$href) { + $val = $href->{$var}; + @parts = split('\.', $val); + $val = ''; + foreach $indx (@parts) { + if ($indx =~ /^\d+$/) { + $val .= '.' . $indx; } else { - $strt = $code; - while($val =~ / /) { - ($tmp, $val) = split(' ', $val, 2); - if ($tmp =~ /([\w\-]+)\((\d+)\)/) { - $tmp = $1; - if (exists($SNMP_util::OIDS{$strt})) { - $tmpv = "$SNMP_util::OIDS{$strt}.$2"; - } else { - $tmpv = $2; - } - $Link{$tmp} = $strt; - if (!exists($prev{$tmp}) && exists($SNMP_util::OIDS{$tmp})) { - if ($tmpv ne $SNMP_util::OIDS{$tmp}) { - $strt = "$strt.$tmp"; - $SNMP_util::OIDS{$strt} = $tmpv; - $cnt++; - } - } else { - $prev{$tmp} = 1; - $SNMP_util::OIDS{$tmp} = $tmpv; - $cnt++; - $strt = $tmp; - } - } - } - - if (!exists($SNMP_util::OIDS{$strt})) { - if ($pass) { - carp "snmpMIB_to_OID: $arg: \"$strt\" prefix unknown, load the parent MIB first.\n" - unless ($SNMP_Session::suppress_warnings > 1); - } else { - $need2pass = 1; - } - } - $Link{$var} = $strt; - if (exists($SNMP_util::OIDS{$strt})) { - $val = "$SNMP_util::OIDS{$strt}.$val"; - } - if (!exists($prev{$var}) && exists($SNMP_util::OIDS{$var})) { - if ($val ne $SNMP_util::OIDS{$var}) { - $var = "$strt.$var"; - } + if (exists($SNMP_util::OIDS{$indx})) { + $val = $SNMP_util::OIDS{$indx}; + } else { + $val .= '.' . $indx; } - + } + } + if ($val =~ /^[\d\.]+$/) { + $val =~ s/^\.//; + if (!exists($SNMP_util::OIDS{$var}) + || (length($val) > length($SNMP_util::OIDS{$var}))) { $SNMP_util::OIDS{$var} = $val; - $prev{$var} = 1; - $cnt++; - print "'$var' => '$val'\n" if $SNMP_util::Debug; + $changed = 1; + $cnt++; } - undef $buf; + push @del, $var; } } - if ($pass == 0 && $need2pass) { - seek(MIB, $pos, 0); - $buf = ""; - $pass = 1; - $cnt = 0; - } else { - $ret += $cnt; - $need2pass = 0; + foreach $var (@del) { + delete $href->{$var}; } + } while($changed); + + $Carp::CarpLevel++; + foreach $var (sort keys %$href) { + $val = $href->{$var}; + $val =~ s/\..*//; + next if (exists($seen{$val})); + $seen{$val} = 1; + $seen{$var} = 1; + carp "snmpMIB_to_OID: prefix \"$val\" unknown, load the parent MIB first.\n" + unless ($SNMP_Session::suppress_warnings > 1); } - close(MIB); - $RevNeeded = 1; - return $ret; + $Carp::CarpLevel--; + return $cnt; } + sub encode_oid_with_errmsg ($) { my ($oid) = @_; my $tmp = encode_oid(split(/\./, $oid)); diff -Nru mrtg-2.14.7/Makefile.in mrtg-2.16.1/Makefile.in --- mrtg-2.14.7/Makefile.in 2006-09-06 14:34:00.000000000 +0100 +++ mrtg-2.16.1/Makefile.in 2008-02-17 10:27:15.000000000 +0000 @@ -1,7 +1,7 @@ # things that the GNU standards document suggests all makefiles # should have. SHELL=/bin/sh -VER=2.14.7 +VER=2.16.1 .SUFFIXES: .SUFFIXES: .c .o .pl .pm .pod .man .1 .txt @@ -46,7 +46,7 @@ install: all $(MKINSTALLDIRS) $(DESTDIR)$(bindir) - for x in $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker; do \ + for x in $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg-traffic-sum; do \ $(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done for x in bin/rateup; do \ $(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done @@ -78,15 +78,15 @@ doc/mrtg-unix-guide.pod \ doc/mrtg-forum.pod doc/mrtg-mibhelp.pod doc/mrtg-reference.pod doc/mrtg-webserver.pod \ doc/mrtg-rrd.pod doc/mrtg-squid.pod doc/mrtg.pod doc/mrtg-contrib.pod \ - doc/cfgmaker.pod doc/indexmaker.pod doc/mrtglib.pod doc/mrtg-ipv6.pod + doc/cfgmaker.pod doc/indexmaker.pod doc/mrtglib.pod doc/mrtg-ipv6.pod doc/mrtg-traffic-sum.pod \ MAN = $(POD:.pod=.1) TXT = $(POD:.pod=.txt) getpod: -rm $(MAN) $(TXT) - -rm doc/cfgmaker.pod; ln -s ../bin/cfgmaker doc/cfgmaker.pod - -rm doc/indexmaker.pod;ln -s ../bin/indexmaker doc/indexmaker.pod + -for x in cfgmaker indexmaker mrtg-mailer mrtg-traffic-sum; do \ + rm doc/$$x.pod; ln -s ../bin/$$x doc/$$x.pod; done -rm doc/mrtglib.pod;ln -s ../lib/mrtg2/MRTG_lib.pm doc/mrtglib.pod .pod.1: @@ -115,7 +115,7 @@ autoconf gchmod -R u=rwX,go=rX . (cd .. ; ln -s src $(DIRNAME)) - (cd .. ; sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | gtar -czv --files-from=- -f $(DIRNAME)/$(ARCHIVE).tar.gz --exclude='*~' --exclude=".svn") + (cd .. ; sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | tar -czv --files-from=- -f $(DIRNAME)/$(ARCHIVE).tar.gz --exclude='*~' --exclude=".svn") $(PERL) -0777 -pi -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' bin/mrtg bin/indexmaker # build rateup for windows ... (cd .. ; touch $(DIRNAME)/contrib/a~;sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | xargs zip -r $(DIRNAME)/$(ARCHIVE).zip; zip $(DIRNAME)/$(ARCHIVE).zip $(DIRNAME)/bin/rateup.exe $(DIRNAME)/bin/rateup.nlm $(DIRNAME)/bin/rateup.nlm; zip -d $(DIRNAME)/$(ARCHIVE).zip '*~' '*.svn*') @@ -123,9 +123,9 @@ dist: tar svn commit -m 'released version $(VER)' - svn copy -m "tagging version $(VER)" svn://svn.ee.ethz.ch/mrtg/trunk/src svn://svn.ee.ethz.ch/mrtg/tags/$(VER) + svn copy -m "tagging version $(VER)" svn://svn.oetiker.ch/mrtg/trunk/src svn://svn.oetiker.ch/mrtg/tags/$(VER) md5sum $(ARCHIVE).tar.gz >$(ARCHIVE).tar.gz.md5 - pgps $(ARCHIVE).tar.gz.md5 + gpg -s $(ARCHIVE).tar.gz.md5 chmod 644 $(ARCHIVE).tar.gz.md5* scp CHANGES $(ARCHIVE).* oposs@james.oetiker.ch:public_html/mrtg/pub/ ssh oposs@james.oetiker.ch "cd public_html/mrtg/pub; rm mrtg.tar.gz;ln -s $(ARCHIVE).tar.gz mrtg.tar.gz" diff -Nru mrtg-2.14.7/Makefile.NetWare mrtg-2.16.1/Makefile.NetWare --- mrtg-2.14.7/Makefile.NetWare 2006-08-27 22:14:50.000000000 +0100 +++ mrtg-2.16.1/Makefile.NetWare 2007-03-11 12:49:18.000000000 +0000 @@ -1,6 +1,6 @@ -# Gnu Makefile for NetWare rateup.nlm target * 05-Feb-2006 +# Gnu Makefile for NetWare rateup.nlm target * 17-Feb-2007 # for use with gcc/nlmconv or Metrowerks CodeWarrior compiler -# use with: make -f Makefile.NetWare [all|clean|dist] +# use with: make -f Makefile.NetWare [all|clean|dist|distclean|help] TARGET = rateup DESCR = MRTG Rateup Command Utility $(RATEUP_VERSION_STR) @@ -30,11 +30,11 @@ # All library code is statically linked to avoid problems with other lib NLMs. # Edit the path below to point to your libgd sources or set environment var. ifndef LIBGD - LIBGD = $(LIBBASE)/gd-2.0.33 + LIBGD = $(LIBBASE)/gd-2.0.34 endif # Edit the path below to point to your libpng sources or set environment var. ifndef LIBPNG - LIBPNG = $(LIBBASE)/libpng-1.2.8 + LIBPNG = $(LIBBASE)/libpng-1.2.16 endif # Edit the path below to point to your zlib sources or set environment var. ifndef ZLIBSDK @@ -54,6 +54,7 @@ CC = gcc endif +AWK = awk #RM = rm -f CP = cp -afv MV = mv -f @@ -87,11 +88,11 @@ ifeq ($(CC),mwccnlm) LD = mwldnlm - LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(OBJDIR)/$(TARGET).nlm -commandfile - CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586 + LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $@ -commandfile + CFLAGS += -gccinc -msgstyle gcc -inline off -opt nointrinsics -proc 586 CFLAGS += -relax_pointers -# CFLAGS += -w on -ansi strict -# CFLAGS += -w on,nounused,nounusedexpr -ansi strict + #CFLAGS += -w on,nounused,nounusedexpr + #CFLAGS += -ansi strict ifeq ($(LIBARCH),LIBC) PRELUDE = $(SDK_LIBC)/imports/libcpre.o CFLAGS += -align 4 @@ -103,8 +104,8 @@ else LD = nlmconv LDFLAGS = -T - CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return - CFLAGS += -Wall -Wno-return-type -Wno-unused # -pedantic + CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing + CFLAGS += -Wall # -Wno-unused # -pedantic ifeq ($(LIBARCH),LIBC) PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o else @@ -113,12 +114,9 @@ endif endif -LDLIBS = - ifeq ($(findstring linux,$(OSTYPE)),linux) DL = ' DS = / -#-include $(NDKBASE)/nlmconv/ncpfs.inc else DS = \\ endif @@ -133,7 +131,7 @@ XDCDATA = $(OBJDIR)/$(TARGET).xdc endif ifndef COPYR - COPYR = Copyright (c) 2005 The Open Source Community. + COPYR = Copyright (c) 2007 The Open Source Community. endif ifndef DESCR DESCR = $(TARGET) Command Extension @@ -235,21 +233,21 @@ clean: -$(RM) -r $(OBJDIR) -cleandist: clean +distclean: clean -$(RM) $(ARCHIVE) $(OBJDIR): - @mkdir $(OBJDIR) + @mkdir $@ $(OBJDIR)/version.inc: $(TARGET).c $(OBJDIR) get_ver.awk @echo Creating $@ - @awk -f get_ver.awk $< > $@ + @$(AWK) -f get_ver.awk $< > $@ $(OBJDIR)/%.o: %.c @echo Compiling $< @$(CC) $(CFLAGS) -c $< -o $@ -$(OBJDIR)/$(TARGET).nlm: $(OBJDIR) $(OBJS) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).def $(XDCDATA) +$(OBJDIR)/$(TARGET).nlm: $(OBJDIR) $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA) @echo Linking $@ @-$(RM) $@ @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def @@ -261,7 +259,7 @@ @echo Creating $@ @$(MPKXDC) $(XDCOPT) $@ -$(OBJDIR)/%.def: Makefile.NetWare +$(OBJDIR)/%.def: Makefile.NetWare $(OBJDIR)/version.inc @echo $(DL)# DEF Linker File for use with gcc and nlmconv$(DL) > $@ @echo $(DL)# or with Codewarrior command line compiler.$(DL) >> $@ @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ @@ -320,12 +318,29 @@ @echo $(DL)output $(TARGET).nlm$(DL) >> $@ endif -$(OBJDIR)/readme.txt: Makefile.NetWare +$(OBJDIR)/readme.txt: Makefile.NetWare $(OBJDIR)/version.inc @echo Creating $@ @echo $(DL)This is a binary distribution for NetWare platform.$(DL) > $@ @echo $(DL)MRTG rateup version $(RATEUP_VERSION_STR)$(DL) >> $@ + @echo $(DL)This binary was built with these libs:$(DL) >> $@ + @echo $(DL)libpng Version : $(notdir $(LIBPNG))$(DL) >> $@ + @echo $(DL)libGD Version : $(notdir $(LIBGD))$(DL) >> $@ + @echo $(DL)Zlib Version : $(notdir $(ZLIBSDK))$(DL) >> $@ @echo $(DL)Please download the complete MRTG package for$(DL) >> $@ @echo $(DL)any further documentation:$(DL) >> $@ @echo $(DL)http://www.mrtg.org/$(DL) >> $@ +help: $(OBJDIR)/version.inc + @echo $(DL)===========================================================$(DL) + @echo $(DL)libpng Source = $(LIBPNG)$(DL) + @echo $(DL)libGD Source = $(LIBGD)$(DL) + @echo $(DL)Zlib SDK = $(ZLIBSDK)$(DL) + @echo $(DL)===========================================================$(DL) + @echo $(DL)RRDTool $(RATEUP_VERSION_STR) - available targets are:$(DL) + @echo $(DL)$(MAKE) all$(DL) + @echo $(DL)$(MAKE) clean$(DL) + @echo $(DL)$(MAKE) dist$(DL) + @echo $(DL)$(MAKE) distclean$(DL) + @echo $(DL)===========================================================$(DL) + diff -Nru mrtg-2.14.7/Makefile.Win32 mrtg-2.16.1/Makefile.Win32 --- mrtg-2.14.7/Makefile.Win32 2006-08-27 22:14:51.000000000 +0100 +++ mrtg-2.16.1/Makefile.Win32 2007-03-11 12:49:18.000000000 +0000 @@ -1,6 +1,6 @@ -# GNU Makefile for Win32 rateup.exe target * 05-Feb-2006 +# GNU Makefile for Win32 rateup.exe target * 17-Feb-2007 # for use with MingW32 gcc or Metrowerks CodeWarrior compiler -# use with: make -f Makefile.Win32 [all|clean|dist] +# use with: make -f Makefile.Win32 [all|clean|dist|distclean|help] TARGET = rateup DESCR = MRTG Rateup Command Utility $(RATEUP_VERSION_STR) @@ -23,11 +23,11 @@ # All library code is statically linked to avoid problems with other lib DLLs. # Edit the path below to point to your libgd sources or set environment var. ifndef LIBGD - LIBGD = $(LIBBASE)/gd-2.0.33 + LIBGD = $(LIBBASE)/gd-2.0.34 endif # Edit the path below to point to your libpng sources or set environment var. ifndef LIBPNG - LIBPNG = $(LIBBASE)/libpng-1.2.8 + LIBPNG = $(LIBBASE)/libpng-1.2.16 endif # Edit the path below to point to your zlib sources or set environment var. ifndef ZLIBSDK @@ -40,6 +40,8 @@ else CC = gcc endif + +AWK = awk # RM = rm -f CP = cp -fav # MV = mv -f @@ -66,32 +68,37 @@ CFLAGS = $(OPT) -D$(DB) -DHAVE_LIBPNG -DNONDLL ifeq ($(CC),mwcc) -LD = mwld -CFLAGS += -nostdinc -gccinc -msgstyle gcc -inline off -opt nointrinsics -inst mmx -proc 586 -CFLAGS += -relax_pointers -#CFLAGS += -w on,nounused,nounusedexpr -#CFLAGS += -ansi strict -CFLAGS += -ir "$(METROWERKS)/MSL" -ir "$(METROWERKS)/Win32-x86 Support" -LD = mwld -RC = mwwinrc -LDFLAGS = -nostdlib -LIBPATH += -lr "$(METROWERKS)/MSL" -lr "$(METROWERKS)/Win32-x86 Support" -LDLIBS += -lkernel32.lib -luser32.lib -LDLIBS += -lMSL_Runtime_x86.lib -lMSL_C_x86.lib -lMSL_Extras_x86.lib -LIBFILES= $(LDLIBS) -RCFLAGS = + LD = mwld + CFLAGS += -nostdinc -gccinc -msgstyle gcc -inline off -opt nointrinsics -proc 586 + CFLAGS += -relax_pointers + #CFLAGS += -w on,nounused,nounusedexpr + #CFLAGS += -ansi strict + CFLAGS += -ir "$(METROWERKS)/MSL" -ir "$(METROWERKS)/Win32-x86 Support" + LD = mwld + RC = mwwinrc + LDFLAGS = -nostdlib + LIBPATH += -lr "$(METROWERKS)/MSL" -lr "$(METROWERKS)/Win32-x86 Support" + LDLIBS += -lkernel32.lib -luser32.lib + LDLIBS += -lMSL_Runtime_x86.lib -lMSL_C_x86.lib -lMSL_Extras_x86.lib + RCFLAGS = else -LD = gcc -RC = windres -LDFLAGS = -s -RCFLAGS = -I rc -O coff -i -CFLAGS += -Wall -Wno-format -Wno-unused # -pedantic + LD = gcc + RC = windres + LDFLAGS = -s + RCFLAGS = -O coff -i + CFLAGS += -fno-strict-aliasing + CFLAGS += -Wall -Wno-format # -Wno-unused # -pedantic endif -LDLIBS = +ifeq ($(findstring msys,$(OSTYPE)),msys) +DL = ' +DS = / +else +DS = \\ +endif ifndef COPYR - COPYR = Copyright (c) 2005 The Open Source Community. + COPYR = Copyright (c) 2007 The Open Source Community. endif ifndef DESCR DESCR = $(TARGET) Command Extension @@ -186,15 +193,15 @@ clean: -$(RM) -r $(OBJDIR) -cleandist: clean +distclean: clean -$(RM) $(ARCHIVE) $(OBJDIR): - @mkdir $(OBJDIR) + @mkdir $@ $(OBJDIR)/version.inc: $(TARGET).c $(OBJDIR) @echo Creating $@ - @awk -f get_ver.awk $< > $@ + @$(AWK) -f get_ver.awk $< > $@ $(OBJDIR)/$(TARGET).o: $(TARGET).c @echo Compiling $< @@ -207,55 +214,74 @@ $(OBJDIR)/$(TARGET).exe: $(OBJS) $(OBJDIR)/$(TARGET).res @echo Linking $@ @-$(RM) $@ - @$(LD) $(LDFLAGS) $^ -o $@ $(LIBPATH) $(LIBFILES) + @$(LD) $(LDFLAGS) $^ -o $@ $(LIBPATH) $(LDLIBS) $(OBJDIR)/%.res: $(OBJDIR)/%.rc @echo Creating $@ @$(RC) $(RCFLAGS) $< -o $@ $(OBJDIR)/%.rc: Makefile.Win32 $(OBJDIR)/version.inc - @echo 1 VERSIONINFO > $@ - @echo FILEVERSION $(RATEUP_VERSION),0 >> $@ - @echo PRODUCTVERSION $(RATEUP_VERSION),0 >> $@ - @echo FILEFLAGSMASK 0x3fL >> $@ - @echo FILEOS 0x40004L >> $@ - @echo FILEFLAGS 0x0L >> $@ - @echo FILETYPE 0x1L >> $@ - @echo FILESUBTYPE 0x0L >> $@ - @echo BEGIN >> $@ - @echo BLOCK "StringFileInfo" >> $@ - @echo BEGIN >> $@ - @echo BLOCK "040904E4" >> $@ - @echo BEGIN >> $@ - @echo VALUE "LegalCopyright","$(COPYR)\0" >> $@ -# @echo VALUE "CompanyName","$(COMPANY)\0" >> $@ - @echo VALUE "ProductName","$(TARGET).exe\0" >> $@ - @echo VALUE "ProductVersion","$(RATEUP_VERSION_STR)\0" >> $@ - @echo VALUE "License","Released under GPL.\0" >> $@ - @echo VALUE "FileDescription","$(DESCR)\0" >> $@ - @echo VALUE "FileVersion","$(RATEUP_VERSION_STR)\0" >> $@ - @echo VALUE "InternalName","$(TARGET)\0" >> $@ - @echo VALUE "OriginalFilename","$(TARGET).exe\0" >> $@ + @echo $(DL)1 VERSIONINFO$(DL) > $@ + @echo $(DL) FILEVERSION $(RATEUP_VERSION),0$(DL) >> $@ + @echo $(DL) PRODUCTVERSION $(RATEUP_VERSION),0$(DL) >> $@ + @echo $(DL) FILEFLAGSMASK 0x3fL$(DL) >> $@ + @echo $(DL) FILEOS 0x40004L$(DL) >> $@ + @echo $(DL) FILEFLAGS 0x0L$(DL) >> $@ + @echo $(DL) FILETYPE 0x1L$(DL) >> $@ + @echo $(DL) FILESUBTYPE 0x0L$(DL) >> $@ + @echo $(DL)BEGIN$(DL) >> $@ + @echo $(DL) BLOCK "StringFileInfo"$(DL) >> $@ + @echo $(DL) BEGIN$(DL) >> $@ + @echo $(DL) BLOCK "040904E4"$(DL) >> $@ + @echo $(DL) BEGIN$(DL) >> $@ + @echo $(DL) VALUE "LegalCopyright","$(COPYR)\0"$(DL) >> $@ +ifdef COMPANY + @echo $(DL) VALUE "CompanyName","$(COMPANY)\0"$(DL) >> $@ +endif + @echo $(DL) VALUE "ProductName","$(notdir $(@:.rc=.exe))\0"$(DL) >> $@ + @echo $(DL) VALUE "ProductVersion","$(RATEUP_VERSION_STR)\0"$(DL) >> $@ + @echo $(DL) VALUE "License","Released under GPL.\0"$(DL) >> $@ + @echo $(DL) VALUE "FileDescription","$(DESCR)\0"$(DL) >> $@ + @echo $(DL) VALUE "FileVersion","$(RATEUP_VERSION_STR)\0"$(DL) >> $@ + @echo $(DL) VALUE "InternalName","$(notdir $(@:.rc=))\0"$(DL) >> $@ + @echo $(DL) VALUE "OriginalFilename","$(notdir $(@:.rc=.exe))\0"$(DL) >> $@ ifdef WWWURL - @echo VALUE "WWW","$(WWWURL)\0" >> $@ + @echo $(DL) VALUE "WWW","$(WWWURL)\0"$(DL) >> $@ endif - @echo END >> $@ - @echo END >> $@ - @echo BLOCK "VarFileInfo" >> $@ - @echo BEGIN >> $@ - @echo VALUE "Translation", 0x409, 1252 >> $@ - @echo END >> $@ - @echo END >> $@ + @echo $(DL) END$(DL) >> $@ + @echo $(DL) END$(DL) >> $@ + @echo $(DL) BLOCK "VarFileInfo"$(DL) >> $@ + @echo $(DL) BEGIN$(DL) >> $@ + @echo $(DL) VALUE "Translation", 0x409, 1252$(DL) >> $@ + @echo $(DL) END$(DL) >> $@ + @echo $(DL)END$(DL) >> $@ ifdef LNKICON - @echo 10 ICON DISCARDABLE "$(LNKICON)" >> $@ + @echo $(DL)10 ICON DISCARDABLE "$(LNKICON)"$(DL) >> $@ endif -$(OBJDIR)/readme.txt: Makefile.Win32 +$(OBJDIR)/readme.txt: Makefile.Win32 $(OBJDIR)/version.inc @echo Creating $@ @echo $(DL)This is a binary distribution for Win32 platform.$(DL) > $@ @echo $(DL)MRTG rateup version $(RATEUP_VERSION_STR)$(DL) >> $@ + @echo $(DL)This binary was built with these libs:$(DL) >> $@ + @echo $(DL)libpng Version : $(notdir $(LIBPNG))$(DL) >> $@ + @echo $(DL)libGD Version : $(notdir $(LIBGD))$(DL) >> $@ + @echo $(DL)Zlib Version : $(notdir $(ZLIBSDK))$(DL) >> $@ @echo $(DL)Please download the complete MRTG package for$(DL) >> $@ @echo $(DL)any further documentation:$(DL) >> $@ @echo $(DL)http://www.mrtg.org/$(DL) >> $@ +help: $(OBJDIR)/version.inc + @echo $(DL)===========================================================$(DL) + @echo $(DL)libpng Source = $(LIBPNG)$(DL) + @echo $(DL)libGD Source = $(LIBGD)$(DL) + @echo $(DL)Zlib SDK = $(ZLIBSDK)$(DL) + @echo $(DL)===========================================================$(DL) + @echo $(DL)RRDTool $(RATEUP_VERSION_STR) - available targets are:$(DL) + @echo $(DL)$(MAKE) all$(DL) + @echo $(DL)$(MAKE) clean$(DL) + @echo $(DL)$(MAKE) dist$(DL) + @echo $(DL)$(MAKE) distclean$(DL) + @echo $(DL)===========================================================$(DL) + diff -Nru mrtg-2.14.7/MANIFEST mrtg-2.16.1/MANIFEST --- mrtg-2.14.7/MANIFEST 2006-08-27 22:14:51.000000000 +0100 +++ mrtg-2.16.1/MANIFEST 2006-09-13 13:44:24.000000000 +0100 @@ -24,6 +24,7 @@ bin/cfgmaker bin/indexmaker bin/mrtg +bin/mrtg-traffic-sum lib/mrtg2/Pod/InputObjects.pm lib/mrtg2/Pod/Parser.pm lib/mrtg2/Pod/PlainText.pm diff -Nru mrtg-2.14.7/src/rateup.c mrtg-2.16.1/src/rateup.c --- mrtg-2.14.7/src/rateup.c 2006-09-06 14:42:50.000000000 +0100 +++ mrtg-2.16.1/src/rateup.c 2008-02-17 10:27:36.000000000 +0000 @@ -1,5 +1,5 @@ /* - MRTG 2.14.7 -- Rateup + MRTG 2.16.1 -- Rateup ********************* Rateup is a fast add-on to the great MRTG Traffic monitor. It makes @@ -83,7 +83,7 @@ #include #include -char *VERSION = "2.14.7"; +char *VERSION = "2.16.1"; char *program, *router, *routerpath; int histvalid; diff -Nru mrtg-2.14.7/translate/locales_mrtg.pm.rej mrtg-2.16.1/translate/locales_mrtg.pm.rej --- mrtg-2.14.7/translate/locales_mrtg.pm.rej 1970-01-01 01:00:00.000000000 +0100 +++ mrtg-2.16.1/translate/locales_mrtg.pm.rej 2004-07-29 12:43:55.000000000 +0100 @@ -0,0 +1,17 @@ +*************** +*** 3819,3825 **** + 'Jan' => 'Sty', 'Feb' => 'Lut', 'Mar' => 'Mar', + 'April' => 'Kwietnia', 'May' => 'Maja', 'June' => 'Czerwca', + 'Apr' => 'Kwi', 'May' => 'Maj', 'Jun' => 'Cze', +- 'July' => 'Lipica', 'August' => 'Sierpnia', 'September' => 'Wrzesnia', + 'Jul' => 'Lip', 'Aug' => 'Sie', 'Sep' => 'Wrz', + 'October' => 'Października', 'November' => 'Listopada', 'December' => 'Grudnia', + 'Oct' => 'Paź', 'Nov' => 'Lis', 'Dec' => 'Gru' +--- 3819,3825 ---- + 'Jan' => 'Sty', 'Feb' => 'Lut', 'Mar' => 'Mar', + 'April' => 'Kwietnia', 'May' => 'Maja', 'June' => 'Czerwca', + 'Apr' => 'Kwi', 'May' => 'Maj', 'Jun' => 'Cze', ++ 'July' => 'Lipca', 'August' => 'Sierpnia', 'September' => 'Września', + 'Jul' => 'Lip', 'Aug' => 'Sie', 'Sep' => 'Wrz', + 'October' => 'Października', 'November' => 'Listopada', 'December' => 'Grudnia', + 'Oct' => 'Paź', 'Nov' => 'Lis', 'Dec' => 'Gru'
System:LC-Bridge inAndover