X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_Common.pm;h=fbab64d49def4b29ef624f63ebe6eaa54f0354f3;hb=72a62c9de1168b21adbed376ac090c61c14a1018;hp=02e159bfa27c7a0a6c57cbf6eff4ee288da8d526;hpb=bf3dbb0c455af0fdafbb0e699ed2db343ab40320;p=freeside.git diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 02e159bfa..fbab64d49 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -5,6 +5,7 @@ use vars qw( @ISA $noexport_hack $DEBUG $me $overlimit_missing_cust_svc_nonfatal_kludge ); use Carp qw( cluck carp croak confess ); #specify cluck have to specify them all use Scalar::Util qw( blessed ); +use FS::Conf; use FS::Record qw( qsearch qsearchs fields dbh ); use FS::cust_main_Mixin; use FS::cust_svc; @@ -13,6 +14,7 @@ use FS::queue; use FS::cust_main; use FS::inventory_item; use FS::inventory_class; +use FS::NetworkMonitoringSystem; @ISA = qw( FS::cust_main_Mixin FS::Record ); @@ -316,6 +318,8 @@ sub insert { } + $self->nms_ip_insert; + if ( exists $options{'jobnums'} ) { push @{ $options{'jobnums'} }, @jobnums; } @@ -1160,6 +1164,32 @@ sub getstatus_html { } +=item nms_ip_insert + +=cut + +sub nms_ip_insert { + my $self = shift; + my $conf = new FS::Conf; + return '' unless grep { $self->table eq $_ } + $conf->config('nms-auto_add-svc_ips'); + my $ip_field = $self->table_info->{'ip_field'}; + + #XXX perhaps i should be job-queued, i take awhile, right? + my $nms = new FS::NetworkMonitoringSystem; + $nms->add_router( $self->$ip_field(), + $conf->config('nms-auto_add-community') + ); +} + +=item nms_delip + +=cut + +sub nms_ip_delete { +#XXX not yet implemented +} + =back =head1 BUGS