separated influxdb measurements
This commit is contained in:
parent
861cd1b676
commit
c0e8f998a7
5 changed files with 25 additions and 43 deletions
4
ombi.py
4
ombi.py
|
@ -24,9 +24,8 @@ for movie in get_movie_requests:
|
||||||
|
|
||||||
influx_payload = [
|
influx_payload = [
|
||||||
{
|
{
|
||||||
"measurement": "Plex",
|
"measurement": "Ombi",
|
||||||
"tags": {
|
"tags": {
|
||||||
"server": "Ombi",
|
|
||||||
"type": "Requests"
|
"type": "Requests"
|
||||||
},
|
},
|
||||||
"time": current_time,
|
"time": current_time,
|
||||||
|
@ -36,7 +35,6 @@ influx_payload = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
||||||
influx.write_points(influx_payload)
|
influx.write_points(influx_payload)
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@
|
||||||
"type": "tag"
|
"type": "tag"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"measurement": "Plex",
|
"measurement": "Tautulli",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -631,7 +631,7 @@
|
||||||
{
|
{
|
||||||
"dsType": "influxdb",
|
"dsType": "influxdb",
|
||||||
"groupBy": [],
|
"groupBy": [],
|
||||||
"measurement": "Plex",
|
"measurement": "Tautulli",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -640,7 +640,7 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
"stream_count"
|
"current_streams"
|
||||||
],
|
],
|
||||||
"type": "field"
|
"type": "field"
|
||||||
}
|
}
|
||||||
|
@ -648,9 +648,9 @@
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
{
|
||||||
"key": "server",
|
"key": "type",
|
||||||
"operator": "=",
|
"operator": "=",
|
||||||
"value": "Tautulli"
|
"value": "stream_count"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -788,7 +788,7 @@
|
||||||
"targetBlank": true,
|
"targetBlank": true,
|
||||||
"title": "Ombi",
|
"title": "Ombi",
|
||||||
"type": "absolute",
|
"type": "absolute",
|
||||||
"url": "https://request.domain.tld/requests"
|
"url": "https://request.cajun.pro/requests"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingType": 1,
|
"mappingType": 1,
|
||||||
|
@ -828,7 +828,7 @@
|
||||||
{
|
{
|
||||||
"dsType": "influxdb",
|
"dsType": "influxdb",
|
||||||
"groupBy": [],
|
"groupBy": [],
|
||||||
"measurement": "Plex",
|
"measurement": "Ombi",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -845,9 +845,9 @@
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
{
|
||||||
"key": "server",
|
"key": "type",
|
||||||
"operator": "=",
|
"operator": "=",
|
||||||
"value": "Ombi"
|
"value": "Requests"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -888,7 +888,7 @@
|
||||||
"targetBlank": true,
|
"targetBlank": true,
|
||||||
"title": "Tautulli",
|
"title": "Tautulli",
|
||||||
"type": "absolute",
|
"type": "absolute",
|
||||||
"url": "https://plexpy.domain.tld/home"
|
"url": "https://plexpy.dirtycajunrice.com/home"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minSpan": 6,
|
"minSpan": 6,
|
||||||
|
@ -985,7 +985,7 @@
|
||||||
{
|
{
|
||||||
"dsType": "influxdb",
|
"dsType": "influxdb",
|
||||||
"groupBy": [],
|
"groupBy": [],
|
||||||
"measurement": "Plex",
|
"measurement": "Tautulli",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -1049,7 +1049,7 @@
|
||||||
"targetBlank": true,
|
"targetBlank": true,
|
||||||
"title": "Sonarr",
|
"title": "Sonarr",
|
||||||
"type": "absolute",
|
"type": "absolute",
|
||||||
"url": "https://sonarr.domain.tld/wanted/missing"
|
"url": "https://sonarr.dirtycajunrice.com/wanted/missing"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minSpan": 4,
|
"minSpan": 4,
|
||||||
|
@ -1088,7 +1088,7 @@
|
||||||
{
|
{
|
||||||
"dsType": "influxdb",
|
"dsType": "influxdb",
|
||||||
"groupBy": [],
|
"groupBy": [],
|
||||||
"measurement": "Plex",
|
"measurement": "Sonarr",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -1105,12 +1105,6 @@
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
{
|
||||||
"key": "server",
|
|
||||||
"operator": "=",
|
|
||||||
"value": "Sonarr"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "AND",
|
|
||||||
"key": "type",
|
"key": "type",
|
||||||
"operator": "=",
|
"operator": "=",
|
||||||
"value": "Missing"
|
"value": "Missing"
|
||||||
|
@ -1134,7 +1128,7 @@
|
||||||
"targetBlank": true,
|
"targetBlank": true,
|
||||||
"title": "Radarr",
|
"title": "Radarr",
|
||||||
"type": "absolute",
|
"type": "absolute",
|
||||||
"url": "https://radarr.domain.tld/wanted/missing"
|
"url": "https://radarr.dirtycajunrice.com/wanted/missing"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minSpan": 3,
|
"minSpan": 3,
|
||||||
|
@ -1182,7 +1176,7 @@
|
||||||
{
|
{
|
||||||
"dsType": "influxdb",
|
"dsType": "influxdb",
|
||||||
"groupBy": [],
|
"groupBy": [],
|
||||||
"measurement": "Plex",
|
"measurement": "Radarr",
|
||||||
"orderByTime": "ASC",
|
"orderByTime": "ASC",
|
||||||
"policy": "default",
|
"policy": "default",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
|
@ -1199,12 +1193,6 @@
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
{
|
||||||
"key": "server",
|
|
||||||
"operator": "=",
|
|
||||||
"value": "Radarr"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"condition": "AND",
|
|
||||||
"key": "type",
|
"key": "type",
|
||||||
"operator": "=",
|
"operator": "=",
|
||||||
"value": "Missing"
|
"value": "Missing"
|
||||||
|
@ -1263,5 +1251,5 @@
|
||||||
},
|
},
|
||||||
"timezone": "browser",
|
"timezone": "browser",
|
||||||
"title": "Plex",
|
"title": "Plex",
|
||||||
"version": 25
|
"version": 28
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,8 @@ for movie in movies.keys():
|
||||||
for movie, id in missing:
|
for movie, id in missing:
|
||||||
influx_payload.append(
|
influx_payload.append(
|
||||||
{
|
{
|
||||||
"measurement": "Plex",
|
"measurement": "Radarr",
|
||||||
"tags": {
|
"tags": {
|
||||||
"server": "Radarr",
|
|
||||||
"type": "Missing",
|
"type": "Missing",
|
||||||
"tmdbId": id
|
"tmdbId": id
|
||||||
},
|
},
|
||||||
|
@ -36,7 +35,6 @@ for movie, id in missing:
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
||||||
influx.write_points(influx_payload)
|
influx.write_points(influx_payload)
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,8 @@ for show in tv_shows.keys():
|
||||||
for show, id in missing:
|
for show, id in missing:
|
||||||
influx_payload.append(
|
influx_payload.append(
|
||||||
{
|
{
|
||||||
"measurement": "Plex",
|
"measurement": "Sonarr",
|
||||||
"tags": {
|
"tags": {
|
||||||
"server": "Sonarr",
|
|
||||||
"type": "Missing",
|
"type": "Missing",
|
||||||
"sonarrId": id
|
"sonarrId": id
|
||||||
},
|
},
|
||||||
|
|
13
tautulli.py
13
tautulli.py
|
@ -17,13 +17,13 @@ sessions = {d['session_id']: d for d in activity['sessions']}
|
||||||
|
|
||||||
influx_payload = [
|
influx_payload = [
|
||||||
{
|
{
|
||||||
"measurement": "Plex",
|
"measurement": "Tautulli",
|
||||||
"tags": {
|
"tags": {
|
||||||
"server": "Tautulli"
|
"type": "stream_count"
|
||||||
},
|
},
|
||||||
"time": current_time,
|
"time": current_time,
|
||||||
"fields": {
|
"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()
|
lookup = requests.get('http://freegeoip.net/json/{}'.format(sessions[session]['ip_address_public'])).json()
|
||||||
influx_payload.append(
|
influx_payload.append(
|
||||||
{
|
{
|
||||||
"measurement": "Plex",
|
"measurement": "Tautulli",
|
||||||
"tags": {
|
"tags": {
|
||||||
"server": "Tautulli",
|
|
||||||
"type": "Session",
|
"type": "Session",
|
||||||
"region_code": lookup['region_code']
|
"region_code": lookup['region_code'],
|
||||||
|
"name": sessions[session]['friendly_name']
|
||||||
},
|
},
|
||||||
"time": current_time,
|
"time": current_time,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
@ -49,7 +49,6 @@ for session in sessions.keys():
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
influx = InfluxDBClient('grafana.domain.tld', 8086, 'root', 'root', 'plex')
|
||||||
influx.write_points(influx_payload)
|
influx.write_points(influx_payload)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue