}
sub add_router {
- my($self, $ip) = @_;
+ my($self, $ip, $community) = @_;
+
+ $community = qq!<param name="snmp-community" value="$community"/>\n !
+ if length($community) > 1;
my $newhost =
qq( <host>\n).
- qq( <param name="snmp-host" value="$ip"/>\n).
+ qq( <param name="snmp-host" value="$ip"/>\n).$community.
qq( </host>\n);
my $ddx = $self->_torrus_loadddx;
sub add_interface {
my($self, $router_ip, $interface, $serviceid ) = @_;
+ #false laziness w/torrus/perllib/Torrus/Renderer.pm iface_underscore, update both
$interface =~ s(\/)(_)g; #slashes become underscores
$interface =~ s(\.)(_)g; #periods too, huh
+ $interface =~ s(\-)(_)g; #yup, and dashes
#should just use a proper XML parser huh