folder restructure, dbmanager placeholder, iniparser file fullpath, and updated example

This commit is contained in:
Nicholas St. Germain 2018-11-29 12:55:13 -06:00
parent 3eb91d5352
commit e89a2a75a8
8 changed files with 0 additions and 0 deletions

36
Legacy/san.py Normal file
View file

@ -0,0 +1,36 @@
import platform
import psutil
from datetime import datetime, timezone
from influxdb import InfluxDBClient
mount_points = ['/mnt/raid6-a', '/mnt/raid6-b']
# Do not edit below this line #
influx_payload = []
devices = {
'mount_points': {}
}
for mount in mount_points:
devices['mount_points'][mount] = {
'usage': psutil.disk_usage(mount)
}
influx_payload.append(
{
"measurement": "Storage Servers",
"tags": {
"server": platform.uname()[1],
"mount_point": mount
},
"time": datetime.now(timezone.utc).astimezone().isoformat(),
"fields": {
"bytes Used": devices['mount_points'][mount]['usage'].used,
"bytes Free": devices['mount_points'][mount]['usage'].free,
"bytes Total": devices['mount_points'][mount]['usage'].total,
"Utilization": devices['mount_points'][mount]['usage'].percent
}
}
)
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'storage_server')
influx.write_points(influx_payload)