• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

BornToBeRoot/check_nextcloud: Nagios/Centreon plugin for nextcloud serverinfo AP ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

BornToBeRoot/check_nextcloud

开源软件地址:

https://github.com/BornToBeRoot/check_nextcloud

开源编程语言:

Python 100.0%

开源软件介绍:

Nagios/Centron check | Nextcloud serverinfo

Nagios/Centreon plugin for nextcloud serverinfo API (https://github.com/nextcloud/serverinfo)

This branch contains the check for Python 3. A version for Python 2.7 can be found here.

Syntax / Help

./check_nextcloud.py -u username -p password -H cloud.example.com -c [system|storage|shares|webserver|php|database|users|apps]


Options:
  -h, --help            show this help message and exit
  -v, --version         Print the version of this script
  -u USERNAME, --username=USERNAME
                        Username of the user with administrative permissions
                        on the nextcloud server
  -p PASSWORD, --password=PASSWORD
                        Password of the user
  -t TOKEN, --nc-token=TOKEN
                        NC-Token for the Serverinfo API
  -H HOSTNAME, --hostname=HOSTNAME
                        Nextcloud server address (make sure that the address
                        is a trusted domain in the config.php)
  -c CHECK, --check=CHECK
                        The thing you want to check
                        [system|storage|shares|webserver|php|database|activeUsers|uploadFilesize|apps]
  --upload-filesize     Filesize in MiB, GiB without spaces (default="512.0GiB")
  --protocol=PROTOCOL   Protocol you want to use [http|https]
                        (default="https")
  --ignore-proxy        Ignore any configured proxy server on this system for
                        this request
  --api-url=API_URL     Url of the api
                        (default="/ocs/v2.php/apps/serverinfo/api/v1/info")

Install

  • Copy the check (python script) in your nagios/centreon plugins folder
  • Create a check with the following command line:
    $USER1$/plugins_custom/check_nextcloud.py -u $_HOSTCLOUDUSER$ -p $_HOSTCLOUDPWD$ -H $HOSTNAME$ -c $ARG1$ --ignore-proxy
    
    or for the check: uploadFilesize
    $USER1$/plugins_custom/check_nextcloud.py -u $_HOSTCLOUDUSER$ -p $_HOSTCLOUDPWD$ -H $HOSTNAME$ -c $ARG1$ --upload-filesize=$ARG2$ --ignore-proxy
    
  • Create a service for each thing you want to check (system, storage, etc.) and link it to your host(s)
  • Add the credentials of your nextcloud admin user as custom macro (CLOUDUSER, COUDPWD) to your host.

Example 1

./check_nextcloud.py -u adminUser -p secretPassword -H cloud.example.com -c system --ignore-proxy

OK - Nextcloud version: 12.0.3.3

Example 2

./check_nextcloud.py -u adminUser -p secretPassword -H cloud.example.com -c activeUsers --ignore-proxy

OK - Last 5 minutes: 3 user(s), last 1 hour: 10 user(s), last 24 hour: 44 user(s) | users_last_5_minutes=3, users_last_1_hour=10, users_last_24_hours=44

This will return a status message and create a graph based on the performance data.

Example 3

./check_nextcloud.py -u adminUser -p secretPassword -H cloud.example.com -c uploadFilesize --upload-filesize=2.0GiB --ignore-proxy

OK - Upload max filesize: 2.0GiB

# Or, when changed after an update...

CRITICAL - Upload max filesize is set to 512.0MiB, but should be 2.0GiB




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap