From 3c1cb43e2a0fa3aa85256744b0e45d06c98204eb Mon Sep 17 00:00:00 2001 From: Individual IT Services Date: Tue, 13 Aug 2013 00:12:58 -0700 Subject: added posibility to use postgreSQL database to store results --- config/bandwidthd/bandwidthd.inc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'config/bandwidthd') 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 -- cgit v1.2.3 From cf0ccb55e33c5e38cfdf8bb5ce366c118e6749b0 Mon Sep 17 00:00:00 2001 From: Individual IT Services Date: Tue, 13 Aug 2013 00:48:52 -0700 Subject: added posibility to use postgreSQL database to store results --- config/bandwidthd/bandwidthd.xml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'config/bandwidthd') diff --git a/config/bandwidthd/bandwidthd.xml b/config/bandwidthd/bandwidthd.xml index f306546a..8b4a1d8b 100644 --- a/config/bandwidthd/bandwidthd.xml +++ b/config/bandwidthd/bandwidthd.xml @@ -130,6 +130,43 @@ Read back the cdf files on startup checkbox + + output PostgreSQL + outputpostgresql + Log data to a PostgreSQL database.<br> + Get the postgreSQL schema and PHP files to display the results from: https://github.com/individual-it/bandwidthd-pSQL-frontend + checkbox + + + Database host + postgresqlhost + Hostname of the postgreSQL database server. + input + + + Database name + postgresqldatabase + Database on the postgreSQL database server. + input + + + Database Username + postgresqlusername + Username of the postgreSQL database server. + input + + + Database Password + postgresqlpassword + Password of the postgreSQL database server. + password + + + sensor_id + sensorid + Arbitrary sensor name, I recommend the sensors fully qualified domain name. + input + Filter filter -- cgit v1.2.3 From d0cc7b54121c6c559bdc1550b9ef47c5fbd882b2 Mon Sep 17 00:00:00 2001 From: Individual IT Services Date: Tue, 13 Aug 2013 02:02:34 -0700 Subject: Updated the version number to 2.0.1_5 pkg v.0.1 --- config/bandwidthd/bandwidthd.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/bandwidthd') diff --git a/config/bandwidthd/bandwidthd.xml b/config/bandwidthd/bandwidthd.xml index 8b4a1d8b..6aaf30ff 100644 --- a/config/bandwidthd/bandwidthd.xml +++ b/config/bandwidthd/bandwidthd.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. bandwidthd - 2.0.1.4 + 2.0.1_5 pkg v.0.1 Bandwidthd /pkg_edit.php?xml=bandwidthd.xml&id=0 /usr/local/pkg/bandwidthd.inc -- cgit v1.2.3 From 75e10d96c1114187da4b02ca656031269df6bec2 Mon Sep 17 00:00:00 2001 From: Individual IT Services Date: Wed, 14 Aug 2013 01:43:31 -0700 Subject: corrected typo for log_error --- config/bandwidthd/bandwidthd.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/bandwidthd') diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc index b33dd48f..00e3cd28 100644 --- a/config/bandwidthd/bandwidthd.inc +++ b/config/bandwidthd/bandwidthd.inc @@ -96,7 +96,7 @@ function bandwidthd_install_config() { 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."); + log_error("You have to specify the postgreSQL Host, Database, Username and Password. Exiting."); } $sensor_id = $bandwidthd_config['sensorid']; -- cgit v1.2.3