mirror of
https://git.freebsd.org/ports.git
synced 2025-06-23 13:40:34 -04:00
Fix configuration paths in CGIs and reports to include /usr/local/etc/rtg. Affects common.php, reports.pl, and 95.pl. This will fix the CGIs to almost work out of the box. Improve rtgtargmkr.pl to skip unresponsive routers rather than dying. Add USES=ssl PR: 217108 Submitted by: andrew.fengler@scaleengine.com Approved by: maintainer timeout (15 days)
29 lines
1.4 KiB
Perl
29 lines
1.4 KiB
Perl
--- etc/rtgtargmkr.pl.in.orig 2016-11-04 16:36:53 UTC
|
|
+++ etc/rtgtargmkr.pl.in
|
|
@@ -126,7 +126,7 @@ sub find_router_id {
|
|
&sql_insert($sql);
|
|
$rid = &find_router_id($router);
|
|
foreach $mib ( keys %mibs_of_interest ) {
|
|
- $sql = "CREATE TABLE $mib"."_$rid (id INT NOT NULL, dtime DATETIME NOT NULL, counter BIGINT NOT NULL, KEY $mib"."_$rid". "_idx (dtime))";
|
|
+ $sql = "CREATE TABLE $mib"."_$rid (id INT NOT NULL, dtime DATETIME NOT NULL, counter BIGINT NOT NULL, KEY $mib"."_$rid". "_idx (dtime), KEY id_dtime_idx (id,dtime))";
|
|
&sql_insert($sql);
|
|
}
|
|
}
|
|
@@ -289,7 +289,7 @@ sub main {
|
|
$year + 1900, $hour, $min;
|
|
print CFG "# Host\tOID\tBits\tCommunity\tTable\tID\tDescription\n";
|
|
|
|
- foreach $router (@routers) {
|
|
+ POKE: foreach $router (@routers) {
|
|
$bits = $counterBits{$router};
|
|
# Sanity check bits
|
|
$bits = $defbits if ( ( $bits != 32 ) && ( $bits != 64 ) );
|
|
@@ -304,7 +304,7 @@ sub main {
|
|
$system = join ( ' ', @result );
|
|
print "System: $system\n" if $DEBUG;
|
|
$session = SNMP_Session->open( $router, $communities{$router}, 161 )
|
|
- || die "Error opening SNMP session to $router";
|
|
+ || ( print "Error opening SNMP session to $router" and next POKE );
|
|
if ( $system =~ /.*Cisco.*WS-.*/ ) {
|
|
$system = "Catalyst";
|
|
$session->map_table( $catalyst, \&process );
|