1#!/usr/bin/perl
2
3use DBI;
4use POSIX;
5use warnings;
6use strict;
7
8require "%NMLIBDIR%/libmetro.pl";
9
10# Read configuration file
11our $conf_file = "%CONFFILE%";
12our %global_conf = read_global_conf_file($conf_file);
13
14# Set log parameters
15set_process_name("plugin-portmac");
16set_log_facility($global_conf{pollerlogfacility});
17
18# Parameters
19my $table = "mac.portmac";
20
21# Open mac database
22my $db =  db_connect($global_conf{'macdbname'}, $global_conf{'macdbhost'},
23		$global_conf{'macdbuser'}, $global_conf{'macdbpassword'});
24
25my $sensortype = "portmac";
26my $dir = $global_conf{'metrodatadir'}. "/report/";
27
28# Process all session files
29process_sessions($db, $table, $dir, $sensortype);
30