Linuxfabrik / monitoring-plugins

200+ check plugins for Icinga and other Nagios-compatible monitoring applications. Each plugin is a standalone command line tool (written in Python) that provides a specific type of check.
https://linuxfabrik.ch
The Unlicense
207 stars 48 forks source link

nextcloud-stats: KeyError: apps #731

Closed Bastilms closed 6 months ago

Bastilms commented 6 months ago

This issue respects the following points:

Which variant of the Monitoring Plugins do you use?

Bug description

The nextcloud-stats Plugin has an issue since the last Update to Nextcloud 28.0.0. The Plugin outputs

Traceback (most recent call last):
  File "nextcloud-stats.py", line 249, in 'module'
  File "nextcloud-stats.py", line 131, in main
KeyError: 'apps'

The reason for this seems to be a change in the API Call. Per default, this Version ignores the Apps. To change this, the API Call needs to look like this. https://<hostname>/ocs/v2.php/apps/serverinfo/api/v1/info?format=json&skipApps=false The Option skipApps=false has been added.

Bildschirmfoto 2023-12-21 um 03 48 37

Steps to reproduce - Plugin call

/usr/lib64/nagios/plugins/nextcloud-stats --password --url https:///ocs/v2.php/apps/serverinfo/api/v1/info --username

Steps to reproduce - Data

  1. Just call the API without the new Tag.

Environment

Linux monitoring-node2 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

Plugin Version

nextcloud-stats: v2023112901 by Linuxfabrik GmbH, Zurich/Switzerland

Python version

Python 3.11.2

List of Python modules

No response

Additional Information

No response