separated influxdb measurements

This commit is contained in:
Nicholas St. Germain 2018-02-10 01:46:58 -06:00
parent 861cd1b676
commit c0e8f998a7
5 changed files with 25 additions and 43 deletions

View file

@ -24,9 +24,8 @@ for movie in get_movie_requests:
influx_payload = [
{
"measurement": "Plex",
"measurement": "Ombi",
"tags": {
"server": "Ombi",
"type": "Requests"
},
"time": current_time,
@ -36,7 +35,6 @@ influx_payload = [
}
]
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
influx.write_points(influx_payload)

View file

@ -231,7 +231,7 @@
"type": "tag"
}
],
"measurement": "Plex",
"measurement": "Tautulli",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -631,7 +631,7 @@
{
"dsType": "influxdb",
"groupBy": [],
"measurement": "Plex",
"measurement": "Tautulli",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -640,7 +640,7 @@
[
{
"params": [
"stream_count"
"current_streams"
],
"type": "field"
}
@ -648,9 +648,9 @@
],
"tags": [
{
"key": "server",
"key": "type",
"operator": "=",
"value": "Tautulli"
"value": "stream_count"
}
]
}
@ -788,7 +788,7 @@
"targetBlank": true,
"title": "Ombi",
"type": "absolute",
"url": "https://request.domain.tld/requests"
"url": "https://request.cajun.pro/requests"
}
],
"mappingType": 1,
@ -828,7 +828,7 @@
{
"dsType": "influxdb",
"groupBy": [],
"measurement": "Plex",
"measurement": "Ombi",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -845,9 +845,9 @@
],
"tags": [
{
"key": "server",
"key": "type",
"operator": "=",
"value": "Ombi"
"value": "Requests"
}
]
}
@ -888,7 +888,7 @@
"targetBlank": true,
"title": "Tautulli",
"type": "absolute",
"url": "https://plexpy.domain.tld/home"
"url": "https://plexpy.dirtycajunrice.com/home"
}
],
"minSpan": 6,
@ -985,7 +985,7 @@
{
"dsType": "influxdb",
"groupBy": [],
"measurement": "Plex",
"measurement": "Tautulli",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -1049,7 +1049,7 @@
"targetBlank": true,
"title": "Sonarr",
"type": "absolute",
"url": "https://sonarr.domain.tld/wanted/missing"
"url": "https://sonarr.dirtycajunrice.com/wanted/missing"
}
],
"minSpan": 4,
@ -1088,7 +1088,7 @@
{
"dsType": "influxdb",
"groupBy": [],
"measurement": "Plex",
"measurement": "Sonarr",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -1105,12 +1105,6 @@
],
"tags": [
{
"key": "server",
"operator": "=",
"value": "Sonarr"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "Missing"
@ -1134,7 +1128,7 @@
"targetBlank": true,
"title": "Radarr",
"type": "absolute",
"url": "https://radarr.domain.tld/wanted/missing"
"url": "https://radarr.dirtycajunrice.com/wanted/missing"
}
],
"minSpan": 3,
@ -1182,7 +1176,7 @@
{
"dsType": "influxdb",
"groupBy": [],
"measurement": "Plex",
"measurement": "Radarr",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
@ -1199,12 +1193,6 @@
],
"tags": [
{
"key": "server",
"operator": "=",
"value": "Radarr"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "Missing"
@ -1263,5 +1251,5 @@
},
"timezone": "browser",
"title": "Plex",
"version": 25
"version": 28
}

View file

@ -23,9 +23,8 @@ for movie in movies.keys():
for movie, id in missing:
influx_payload.append(
{
"measurement": "Plex",
"measurement": "Radarr",
"tags": {
"server": "Radarr",
"type": "Missing",
"tmdbId": id
},
@ -36,7 +35,6 @@ for movie, id in missing:
}
)
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
influx.write_points(influx_payload)

View file

@ -25,9 +25,8 @@ for show in tv_shows.keys():
for show, id in missing:
influx_payload.append(
{
"measurement": "Plex",
"measurement": "Sonarr",
"tags": {
"server": "Sonarr",
"type": "Missing",
"sonarrId": id
},

View file

@ -17,13 +17,13 @@ sessions = {d['session_id']: d for d in activity['sessions']}
influx_payload = [
{
"measurement": "Plex",
"measurement": "Tautulli",
"tags": {
"server": "Tautulli"
"type": "stream_count"
},
"time": current_time,
"fields": {
"stream_count": int(activity['stream_count'])
"current_streams": int(activity['stream_count'])
}
}
]
@ -32,11 +32,11 @@ for session in sessions.keys():
lookup = requests.get('http://freegeoip.net/json/{}'.format(sessions[session]['ip_address_public'])).json()
influx_payload.append(
{
"measurement": "Plex",
"measurement": "Tautulli",
"tags": {
"server": "Tautulli",
"type": "Session",
"region_code": lookup['region_code']
"region_code": lookup['region_code'],
"name": sessions[session]['friendly_name']
},
"time": current_time,
"fields": {
@ -49,7 +49,6 @@ for session in sessions.keys():
}
)
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
influx.write_points(influx_payload)