summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-03-31 19:29:00 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-03-31 19:29:00 (GMT)
commit5524ae404ffb897ca60162819502e4a9bd7d9599 (patch)
tree1422075c73b0dd6404d6b93f320057a7d8597936
parentfdd96c527de9e5987c1f8592d1751c3bdc31c9c8 (diff)
fixed conf file management
-rw-r--r--rhnop-client/conf.lua2
-rw-r--r--rhnop-client/nopcollect.conf8
-rwxr-xr-xrhnop-client/nopcollectd (renamed from rhnop-client/nopcollect)6
-rw-r--r--rhnop-client/nopcollectd.master.conf15
-rw-r--r--rhnop-client/nopcollectd.standby.conf15
5 files changed, 37 insertions, 9 deletions
diff --git a/rhnop-client/conf.lua b/rhnop-client/conf.lua
index eb1cd29..9cc21d3 100644
--- a/rhnop-client/conf.lua
+++ b/rhnop-client/conf.lua
@@ -21,7 +21,7 @@
local conf = {}
-local file = assert(io.open("nopcollect.conf", "r"))
+local file = assert(io.open(conffile, "r"))
for line in file:lines() do
local k,v = string.match(line, "^([^=#]+)=(.*)$")
if k and v and v ~= "" then
diff --git a/rhnop-client/nopcollect.conf b/rhnop-client/nopcollect.conf
deleted file mode 100644
index 18316fb..0000000
--- a/rhnop-client/nopcollect.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-host=127.0.0.1
-port=2345
-
-db=nop
-#db_host=127.0.0.1
-#db_port=3306
-db_user=
-db_pwd=
diff --git a/rhnop-client/nopcollect b/rhnop-client/nopcollectd
index 04560e2..239011e 100755
--- a/rhnop-client/nopcollect
+++ b/rhnop-client/nopcollectd
@@ -27,6 +27,12 @@
require "socket"
+if #arg < 1 then
+ io.stderr:write("too few parameters\n")
+ os.exit(1)
+end
+
+conffile = "nopcollectd." .. arg[1] .. ".conf"
conf = require "conf"
-- connect to server (reconnect after error)
diff --git a/rhnop-client/nopcollectd.master.conf b/rhnop-client/nopcollectd.master.conf
new file mode 100644
index 0000000..22113e6
--- /dev/null
+++ b/rhnop-client/nopcollectd.master.conf
@@ -0,0 +1,15 @@
+sync_host=airplay.helsinki.at
+sync_port=2345
+
+src_db=nop
+src_host=airplay.helsinki.at
+#src_port=3306
+src_user=nopcollectd
+src_pwd=
+
+dst_db=nop
+dst_table=master
+dst_host=127.0.0.1
+#dst_port=3306
+dst_user=nopcollectd
+dst_pwd=
diff --git a/rhnop-client/nopcollectd.standby.conf b/rhnop-client/nopcollectd.standby.conf
new file mode 100644
index 0000000..2597ab0
--- /dev/null
+++ b/rhnop-client/nopcollectd.standby.conf
@@ -0,0 +1,15 @@
+sync_host=airplay2.helsinki.at
+sync_port=2345
+
+src_db=nop
+src_host=airplay2.helsinki.at
+#src_port=3306
+src_user=nopcollectd
+src_pwd=
+
+dst_db=nop
+dst_table=standby
+dst_host=127.0.0.1
+#dst_port=3306
+dst_user=nopcollectd
+dst_pwd=