summaryrefslogtreecommitdiff
path: root/FS/FS/NetworkMonitoringSystem.pm
blob: fcfa264c2a8badf9d1d6e72a81cb4874803db569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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(@_);
}

1;