From cb7670a84ccef4283401a68271ab64e91e158dd8 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 12 Sep 2018 16:46:34 +0200 Subject: added Multigraph, Licence + added ICS Licence to repo + added multiggraph plugin variant with all features included + added nextcloud 14 pending app updates plugin * updated README.md * updated requests.sessions handeling to reduce keepalive sessions - removed keepalive header for all plugins --- nextcloud_dbsize | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nextcloud_dbsize') diff --git a/nextcloud_dbsize b/nextcloud_dbsize index 7f0920d..986e658 100755 --- a/nextcloud_dbsize +++ b/nextcloud_dbsize @@ -1,12 +1,12 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# + # Plugin to monitor the nextcloud database size # # Parameters understood: # config (required) # autoconf (optional - used by munin-config) -# + # Magic markers - optional - used by installation scripts and # munin-config: # @@ -41,12 +41,13 @@ class NextcloudDB: auth = (os.environ['username'], os.environ['password']) # init requests session with specific header and credentials - s = requests.Session() - s.auth = auth - s.headers.update({'Accept': 'application/json'}) + with requests.Session() as s: + s.auth = auth + s.headers.update({'Accept': 'application/json'}) + s.stream = False - # request data from api - r = s.get(URL) + # request data from api + r = s.get(URL) # if status code is successful close connection and continue if r.status_code == 200: -- cgit v1.2.3-54-g00ecf