summaryrefslogtreecommitdiff
path: root/src/nopsysstated
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-05-08 18:17:06 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-05-08 18:17:06 (GMT)
commit9407d2d102b3759f37d1cc45027cf27c39994303 (patch)
treea4a913eba6ea8fe37c804944517f835e173f2460 /src/nopsysstated
parent3ff60e5490c8b782dbe103b7b60754468c6e5c9c (diff)
conf refactoring for nopsysstated and nopcollectd
Diffstat (limited to 'src/nopsysstated')
-rwxr-xr-xsrc/nopsysstated10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nopsysstated b/src/nopsysstated
index f1a05f8..dc43c99 100755
--- a/src/nopsysstated
+++ b/src/nopsysstated
@@ -25,18 +25,18 @@
-- the arguments should be: now# nowlen next# nextlen
--
-require "socket"
+socket = require "socket"
package.path = package.path .. ";_rhnoplibdir_/?.lua"
db = require "db"
-
-conffile = "nopsysstated.conf"
conf = require "conf"
-db = assert(db.init(conf.db_db, conf.db_user, conf.db_pwd, conf.db_host, conf.db_port, conf.db_table))
+local cnf = conf.load("nopsysstated.conf")
+
+db = assert(db.init(cnf.db_db, cnf.db_user, cnf.db_pwd, cnf.db_host, cnf.db_port, cnf.db_table))
local sock = assert(socket.tcp())
-local ret, err = sock:connect(conf.host, conf.port)
+local ret, err = sock:connect(cnf.host, cnf.port)
if ret == nil then
print(err)
return 1