From 8f9df8d04d547cb6f1d2389873979853c8199406 Mon Sep 17 00:00:00 2001 From: Dave Pedu Date: Sat, 5 Dec 2015 17:48:57 -0800 Subject: [PATCH] add some unanalyzed fields for better searches --- pymonitor/daemon.py | 8 ++++++++ pymonitor/monitors/diskspace.py | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/pymonitor/daemon.py b/pymonitor/daemon.py index 73bf069..68df9f9 100755 --- a/pymonitor/daemon.py +++ b/pymonitor/daemon.py @@ -81,6 +81,7 @@ class Backend: Fetch generic system info that is sent with every piece of monitoring data """ self.sysinfo["hostname"] = sysinfo.hostname() + self.sysinfo["hostname.raw"] = self.sysinfo["hostname"] self.sysinfo["ipaddr"] = sysinfo.ipaddr() def get_index_name(self): @@ -100,6 +101,13 @@ class Backend: "properties": { "ipaddr": { "type": "ip" + }, + "hostname": { + "type": "string" + }, + "hostname.raw": { + "type" : "string", + "index" : "not_analyzed" } } } diff --git a/pymonitor/monitors/diskspace.py b/pymonitor/monitors/diskspace.py index 65c3308..c89fc7e 100644 --- a/pymonitor/monitors/diskspace.py +++ b/pymonitor/monitors/diskspace.py @@ -6,6 +6,7 @@ def diskspace(filesystems=[]): info = { "fs": fs, + "fs.raw": fs, "diskfree": stats.f_bsize * stats.f_bavail, "diskused": (stats.f_blocks-stats.f_bavail) * stats.f_bsize, "disksize": stats.f_bsize * stats.f_blocks @@ -36,6 +37,10 @@ mapping = { }, "fs": { "type": "string" + }, + "fs.raw": { + "type" : "string", + "index" : "not_analyzed" } } }