This is a Munin plugin to monitor your Nextcloud server.
- It queries the nextcloud server's database directly, and converts data for munin.
- MySQL database is supported (currently)
- Requires:
- MySQL or MariaDB server
- PHP 7.0 or above
- Installed Nextloud instance.
- Working munin-node
- When statistics will be integrated into nextloud's "serverinfo" package, MySQL or any databases connection will be unnecessary.
Usage
Number of Active Clients
Number of Events/Actions
Installing on Debian
-
Copy the nextcloud_munin.php into the /usr/share/munin/plugins/ folder.
-
Set the rights:
chmod 755 /usr/share/munin/plugins/nextcloud_munin.php
-
Create a symlink to this file:
ln -s /usr/share/munin/plugins/nextcloud_munin.php /etc/munin/plugins/nextcloud_munin
-
Edit the /etc/munin/munin.conf and /etc/munin/plugin-conf.d/munin-node files, add the following configuration lines.
-
Restart the munin, and munin-node with
/etc/init.d/munin restart
and/etc/init.d/munin-node restart
commands. -
Test the plugin with the
munin-run nextcloud_munin
command. -
Check for munin configuration with:
munin-run nextcloud_munin config
command.
CONFIGURATION
Edit the /etc/munin/munin.conf with the following options:
[nextcloud.company.com] #Nextcloud server hostname
address 127.0.0.1 #This plugin uses a wirtual munin node on localhost,
use_node_name no #but don't need to use the node name.
Edit the /etc/munin/plugin-conf.d/munin-node, and use the following configurations:
[nextcloud_munin]
user - User, who will run this plugin (can be root)
timeout - Munin-update timeout for this plugin.
env.host - Nextcloud server hostname
env.db_user - MySQL database username
env.db_pass - MySQL database password (void/comment-out, When runner is root)
env.db_db - MySQL database name
env.db_host - MySQL host
env.db_prefix - MySQL table prefix
env.diff_minutes - Munin update interval in minutes (for example: 5)
env.nxt_plugins - Installed plugins
For example:
[nextcloud_munin]
user root
timeout 60
env.host nextcloud.company.com
env.db_user root
#env.db_pass
env.db_db Nextcloud_db
env.db_host localhost
env.db_prefix oc_
env.diff_minutes 5
env.nxt_plugins talk antivirus
AUTHOR
Copyright (C) 2018-2020 Gergő J. Miklós.
LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.