diff --git a/zabbix-agent-scripts/get_nc_quota_metrics.py b/zabbix-agent-scripts/get_nc_quota_metrics.py index 9c8dce9..78f7fe5 100644 --- a/zabbix-agent-scripts/get_nc_quota_metrics.py +++ b/zabbix-agent-scripts/get_nc_quota_metrics.py @@ -32,7 +32,7 @@ ## as the JSON file created is not correctly formatted as a JSON ## file. result_set = subprocess.check_output( - ["occ", "usage-report:generate"] + ["/usr/bin/php", "/var/www/nextcloud/occ", "usage-report:generate"] ) result_set = result_set.decode() @@ -47,6 +47,9 @@ names=column_names ) +## In some cases assigned_quota get the value of -2 or 'none'. In these cases, we are replacing with 0 +df["assigned_quota"] = pd.to_numeric(df.assigned_quota.str.replace('none','0').str.replace('-2','0')) + ## Transformation to int is necessary as json library cannot serialize numpy ## data types results = {