summaryrefslogtreecommitdiff
path: root/FS/FS/NetworkMonitoringSystem.pm
diff options
context:
space:
mode:
authorivan <ivan>2011-01-25 03:14:42 +0000
committerivan <ivan>2011-01-25 03:14:42 +0000
commit40d1e71653e1a0021021d9d3f7f7705cf9df4d61 (patch)
tree6bfc15c30b93704e389ee939f800a1b0b8ee1c2c /FS/FS/NetworkMonitoringSystem.pm
parent2c53505237b44980a578c9df707b6708402ead1b (diff)
torrus, 10574
Diffstat (limited to 'FS/FS/NetworkMonitoringSystem.pm')
-rw-r--r--FS/FS/NetworkMonitoringSystem.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/FS/FS/NetworkMonitoringSystem.pm b/FS/FS/NetworkMonitoringSystem.pm
new file mode 100644
index 0000000..c16d5fe
--- /dev/null
+++ b/FS/FS/NetworkMonitoringSystem.pm
@@ -0,0 +1,28 @@
+package FS::NetworkMonitoringSystem;
+
+use strict;
+use vars qw( $conf $system $AUTOLOAD );
+use FS::Conf;
+use FS::UID;
+
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+ $system = $conf->config('network_monitoring_system');
+} );
+
+sub AUTOLOAD {
+ my $self = shift;
+
+ my($sub)=$AUTOLOAD;
+ $sub =~ s/.*://;
+
+ my $conf = new FS::Conf;
+ die "FS::NetworkMonitoringSystem::$AUTOLOAD called, but none configured\n"
+ unless $system;
+
+ eval "use FS::NetworkMonitoringSystem::$system;";
+ die $@ if $@;
+
+ $self .= "::$system";
+ $self->$sub(@_);
+}