--- /dev/null
+packages FS::Cron::nms_report;
+
+use strict;
+use base 'Exporter';
+use FS::Conf;
+use FS::NetworkMonitoringSystem;
+
+our @EXPORT_OK = qw( nms_report );
+
+sub nms_report {
+ #my %opt = @_;
+
+ my $conf = new FS::Conf;
+ return unless $conf->config('network_monitoring_system');
+
+ my $nms = new FS::NetworkMonitoringSystem;
+ $nms->report; #(%opt);
+
+}
+
+1;
return $svc_port[0];
}
+sub report {
+ my $self = shift;
+
+ my @lt = localtime(time);
+ my ($d,$m,$y) = ($ls[3], $ls[4]+1, $ls[5]+1900);
+ if ( $ls[3] == 1 ) {
+ $m--;
+ if ($m == 0) { $m=12; $y-- }
+ #i should have better error checking
+ system('torrus', 'report', '--report=MonthlyUsage', "--date=$y-$m-01");
+ system('torrus', 'report', '--genhtml', '--tree=main');
+ }
+
+}
+
sub add_router {
my($self, $ip) = @_;
my $user = shift or die &usage;
adminsuidsetup $user;
+#you can skip this by not having a NetworkMonitoringSystem configured
+use FS::Cron::nms qw(nms_report);
+nms_report(%opt);
+
#you can skip this by setting the disable_cron_billing config
use FS::Cron::bill qw(bill);
bill(%opt);