aboutsummaryrefslogtreecommitdiffstats
path: root/config/bandwidthd/bandwidthd.inc
diff options
context:
space:
mode:
authorIndividual IT Services <ict.projects@nepal.inf.org>2013-08-13 00:12:58 -0700
committerIndividual IT Services <ict.projects@nepal.inf.org>2013-08-13 00:12:58 -0700
commit3c1cb43e2a0fa3aa85256744b0e45d06c98204eb (patch)
treee63e573251c87bea55fe8f62ec5bc8eb002c2834 /config/bandwidthd/bandwidthd.inc
parentd63a1616cb40dc1db3c8d78101c4a45fdb1c8caf (diff)
downloadpfsense-packages-3c1cb43e2a0fa3aa85256744b0e45d06c98204eb.tar.gz
pfsense-packages-3c1cb43e2a0fa3aa85256744b0e45d06c98204eb.tar.bz2
pfsense-packages-3c1cb43e2a0fa3aa85256744b0e45d06c98204eb.zip
added posibility to use postgreSQL database to store results
Diffstat (limited to 'config/bandwidthd/bandwidthd.inc')
-rw-r--r--config/bandwidthd/bandwidthd.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index 829cdf59..b33dd48f 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -85,6 +85,27 @@ function bandwidthd_install_config() {
$output_cdf_string = "output_cdf true\n";
else
$output_cdf_string = "";
+
+ $output_postgresql = $bandwidthd_config['outputpostgresql'];
+ $postgresql_host = $bandwidthd_config['postgresqlhost'];
+ $postgresql_database = $bandwidthd_config['postgresqldatabase'];
+ $postgresql_username = $bandwidthd_config['postgresqlusername'];
+ $postgresql_password = $bandwidthd_config['postgresqlpassword'];
+ $postgresql_string = "";
+ if($output_postgresql) {
+ if ($postgresql_host && $postgresql_username && $postgresql_database && $postgresql_password)
+ $postgresql_string = "pgsql_connect_string \"user = $postgresql_username dbname = $postgresql_database password = $postgresql_password host = $postgresql_host\"\n";
+ else
+ log_error("You have specify the postgress Host, Database, Username and Password. Exiting.");
+ }
+
+ $sensor_id = $bandwidthd_config['sensorid'];
+
+ if($sensor_id)
+ $sensor_id_string = "sensor_id \"$sensor_id\"";
+ else
+ $sensor_id_string = "";
+
$promiscuous = $bandwidthd_config['promiscuous'];
if($promiscuous)
$promiscuous = "promiscuous true\n";
@@ -190,6 +211,14 @@ $output_cdf_string
#Read back the cdf file on startup
$recover_cdf
+# Standard postgres connect string, just like php, see postgres docs for
+# details
+$postgresql_string
+
+# Arbitrary sensor name, I recommend the sensors fully qualified domain
+# name
+$sensor_id_string
+
#Libpcap format filter string used to control what bandwidthd sees
#Please always include "ip" in the string to avoid strange problems
$filter_text