Newer
Older
nextcloud-monitoring-dashboard / zabbix-agent-scripts / get_nc_metrics.py
@pmarini pmarini on 20 Dec 2023 481 bytes first commit of assets
import json

import requests

nextcloud_token = "7iz11gm77ivdf24hnfulycpa"

metric_values = json.loads(requests.get("http://localhost/ocs/v2.php/apps/serverinfo/api/v1/info?format=json",
                                         verify=False,
                                         headers={"NC-Token": "%s" % nextcloud_token}).content
                                         )

with open("/var/lib/zabbix/output/nc_metrics.json","w") as fl:
        json.dump(metric_values, fl)