diff options
author | nico <nico@magicbroccoli.de> | 2018-09-12 16:46:34 +0200 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2018-09-12 16:52:25 +0200 |
commit | cb7670a84ccef4283401a68271ab64e91e158dd8 (patch) | |
tree | a85264b0d066a0eee4633b46842d18f905af6c5b /nextcloud_shares | |
parent | 1ed8efcacb1ccd18ed7945492b6d2683a9a31b71 (diff) |
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
Diffstat (limited to 'nextcloud_shares')
-rwxr-xr-x | nextcloud_shares | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nextcloud_shares b/nextcloud_shares index ba247d5..03462bd 100755 --- a/nextcloud_shares +++ b/nextcloud_shares @@ -1,12 +1,12 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# + # Plugin to monitor the amount shares to and from the specified nextcloud instance # # Parameters understood: # config (required) # autoconf (optional - used by munin-config) -# + # Magic markers - optional - used by installation scripts and # munin-config: # @@ -53,12 +53,13 @@ class NextcloudShares: 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: |