Browse Source

elasticsearch 2.x compatibility, bump version number

master
Dave Pedu 6 years ago
parent
commit
ec819b2cad
  1. 1
      .gitignore
  2. 7
      README.md
  3. 2
      pymonitor/__init__.py
  4. 4
      pymonitor/daemon.py
  5. 4
      pymonitor/monitors/diskio.py
  6. 4
      pymonitor/monitors/diskspace.py
  7. 2
      requirements.txt

1
.gitignore

@ -4,3 +4,4 @@ examples/config.test.json
build
dist
pymonitor.egg-info
testenv

7
README.md

@ -96,3 +96,10 @@ Roadmap
* Complete API docs
* More builtin monitors
* Local logging in case ES can't be reached
Changelog
---------
*0.1.0:* renamed fields with names containing dots for elasticsearch 2.0 compatibility
*0.0.1:* initial release!

2
pymonitor/__init__.py

@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.1.0"

4
pymonitor/daemon.py

@ -82,7 +82,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["hostname_raw"] = self.sysinfo["hostname"]
self.sysinfo["ipaddr"] = sysinfo.ipaddr()
def get_index_name(self):
@ -106,7 +106,7 @@ class Backend:
"hostname": {
"type": "string"
},
"hostname.raw": {
"hostname_raw": {
"type" : "string",
"index" : "not_analyzed"
}

4
pymonitor/monitors/diskio.py

@ -11,7 +11,7 @@ def diskio(disks=[]):
continue
stats = {
"disk": disk,
"disk.raw": disk,
"disk_raw": disk,
"reads_ps": round(stats.read_count/uptime, 2),
"writes_ps":round(stats.write_count/uptime, 2),
"read_ps": round(stats.read_bytes/uptime, 2),
@ -31,7 +31,7 @@ mapping = {
"disk": {
"type": "string"
},
"disk.raw": {
"disk_raw": {
"type": "string",
"index" : "not_analyzed"
},

4
pymonitor/monitors/diskspace.py

@ -6,7 +6,7 @@ def diskspace(filesystems=[]):
info = {
"fs": fs,
"fs.raw": 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,
@ -44,7 +44,7 @@ mapping = {
"fs": {
"type": "string"
},
"fs.raw": {
"fs_raw": {
"type" : "string",
"index" : "not_analyzed"
},

2
requirements.txt

@ -1,3 +1,3 @@
elasticsearch==2.1.0
elasticsearch==2.2.0
psutil==3.3.0
PyYAML==3.11

Loading…
Cancel
Save