Skip to content

Commit

Permalink
Changes in writ_json to correct the directory structure for linux sam…
Browse files Browse the repository at this point in the history
…ple data collected in the server.

desired structure -

/var/lib/data/linux/cpustatic

and similar for other linux plugins.
  • Loading branch information
aayush-bhardwaj committed Nov 8, 2017
1 parent 7654ea9 commit 69558d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion write_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ def datadict_to_dirname(self, data):
if PLUGIN not in data:
collectd.error("Plugin values not set")
return None
path = os.path.join(self.path, DATADIR, data[PLUGIN])
# path = os.path.join(self.path, DATADIR, data[PLUGIN])

if(data[PLUGIN] == "linux"):
path = os.path.join(self.path, DATADIR, data[PLUGIN] + "/" + data[PLUGINTYPE])
else:
path = os.path.join(self.path, DATADIR, data[PLUGIN])

if PLUGIN_INS in data:
path = os.path.join(path, data[PLUGIN_INS])
return path
Expand Down

0 comments on commit 69558d5

Please sign in to comment.