X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FNetworkMonitoringSystem%2FTorrus_Internal.pm;fp=FS%2FFS%2FNetworkMonitoringSystem%2FTorrus_Internal.pm;h=63a93268c4f0b931037844e7484ea23b6b747624;hp=f436e3bb90e0d930b29b174c9262d6b3fc1704bd;hb=acdcfc79977617610989a3a5eee39c63e373a546;hpb=09c2892518ff1ad120af230b7a695ef1b7637ac8 diff --git a/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm b/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm index f436e3bb9..63a93268c 100644 --- a/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm +++ b/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm @@ -11,7 +11,7 @@ use FS::Record qw(qsearch qsearchs dbh); use FS::svc_port; use FS::torrus_srvderive; use FS::torrus_srvderive_component; -use Torrus::ConfigTree; +#use Torrus::ConfigTree; #$DEBUG = 0; #$me = '[FS::NetworkMonitoringSystem::Torrus_Internal]'; @@ -108,6 +108,11 @@ sub port_graphs_link { my @keys = keys %$hash; # yeah this is weird... my $host = $keys[0]; my $iface = $hash->{$keys[0]}; + + #Torrus::ConfigTree is only available when running under the web UI + eval 'use Torrus::ConfigTree;'; + die $@ if $@; + my $config_tree = new Torrus::ConfigTree( -TreeName => 'main' ); my $token = $config_tree->token("/Routers/$host/Interface_Counters/$iface/InOut_bps"); return $Torrus::Freeside::FSURL."/torrus/main?token=$token";