[freeside-commits] freeside/FS/FS/NetworkMonitoringSystem Torrus_Internal.pm, 1.9, 1.10
Ivan,,,
ivan at wavetail.420.am
Sat Feb 26 16:51:45 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/NetworkMonitoringSystem
In directory wavetail.420.am:/tmp/cvs-serv20006/FS/FS/NetworkMonitoringSystem
Modified Files:
Torrus_Internal.pm
Log Message:
torrus virtual ports, RT#10574
Index: Torrus_Internal.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -d -r1.9 -r1.10
--- Torrus_Internal.pm 26 Feb 2011 02:13:20 -0000 1.9
+++ Torrus_Internal.pm 27 Feb 2011 00:51:43 -0000 1.10
@@ -8,7 +8,7 @@
use Date::Format;
use XML::Simple;
use FS::svc_port;
-use FS::Record qw(qsearch);
+use FS::Record qw(qsearch dbh);
use Torrus::ConfigTree;
#$DEBUG = 0;
@@ -226,4 +226,23 @@
}
+sub torrus_serviceids {
+ my $self = shift;
+
+ #is this going to get too slow or will the index make it okay?
+ my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport")
+ or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ my %serviceid = ();
+ while ( my $row = $sth->fetchrow_arrayref ) {
+ my $serviceid = $row->[0];
+ $serviceid =~ s/_(IN|OUT)$//;
+ $serviceid{$serviceid}=1;
+ }
+ my @serviceids = sort keys %serviceid;
+
+ @serviceids;
+
+}
+
1;
More information about the freeside-commits
mailing list