Alignak checks pack for mysql/mariadb database server
Project description
Checks pack for monitoring mysql database server
Installation
The installation of this checks pack will copy some configuration files in the Alignak default configuration directory (eg. /usr/local/share/alignak). The copied files are located in the default sub-directory used for the packs (eg. arbiter/packs).
From PyPI
To install the package from PyPI:
sudo pip install alignak-checks-mysql
From source files
To install the package from the source files:
git clone https://github.com/Alignak-monitoring-contrib/alignak-checks-mysql cd alignak-checks-linux-mysql sudo pip install .
Note: using `sudo python setup.py install` will not correctly manage the package configuration files! The recommended way is really to use `pip`;)
Documentation
This checks pack is using the some PERL plugins that are shipped with the checks pack. As such, some more installation and preparation are necessary;)
Configuration
Note: this pack embeds the check_mysql_health script from http://labs.consol.de/lang/en/nagios/check_mysql_health/. The embedded version is built from the 2.2.2 version but you may install this script by yourself …
We recommand that you download and install your own available from the web site. An abstract:
$ tar xvfz check_mysql_health-2.2.2 $ cd check_mysql_health-2.2.2 $ ./configure --prefix=/usr/local/var/libexec/alignak --with-nagios-user=alignak --with-nagios-group=alignak --with-mymodules-dir=/usr/local/var/libexec/alignak --with-mymodules-dyn-dir=/usr/local/var/libexec/alignak $ make $ make install
Note: replace /usr/local/var/libexec/alignak according to your platform …
After compilation and installation, the plugin is installed in the /usr/local/var/libexec/alignak directory.
Edit the /usr/local/etc/alignak/arbiter/packs/resource.d/mysql.cfg file and configure the credentials to access to the mysql server.
#-- MySQL default credentials $MYSQLUSER$=root $MYSQLPASSWORD$=root
Install PERL dependencies for check_mysql_health plugin
You must install some PERL dependencies for the check_mysql_health script.
Before installing PERL dependencies, you must install the mysql/mariadb client for your operating system.
On FreeBSD, you can:
pkg install mariadb102-client cpan install DBI cpan install DBD::mysql
On some Linux distros, you can:
su - apt-get install mariadb-client apt-get install dbi-perl apt-get install dbd-mysql-perl
Or you can use the PERL cpan utility:
cpan install DBI cpan install DBD::mysql
Note: you must have previously installed the mysql client for your operating system :)
Alignak configuration
You simply have to tag the concerned hosts with the template mysql.:
define host{ use mysql host_name my_server address 127.0.0.1 }
Set the MySql connection credentials in the resource.d/mysql.cfg or declare the variables in each host.:
#-- MySQL default credentials $MYSQLUSER$=alignak $MYSQLPASSWORD$=alignak
The main mysql template declares macros used to configure the launched checks. The default values of these macros listed hereunder can be overriden in each host configuration.:
_MYSQLUSER $MYSQLUSER$ _MYSQLPASSWORD $MYSQLPASSWORD$ _UPTIME_WARN 10: _UPTIME_CRIT 5: _CONNECTIONTIME_WARN 1 _CONNECTIONTIME_CRIT 5 _QUERYCACHEHITRATE_WARN 90: _QUERYCACHEHITRATE_CRIT 80: _THREADSCONNECTED_WARN 10 _THREADSCONNECTED_CRIT 20 _QCACHEHITRATE_WARN 90: _QCACHEHITRATE_CRIT 80: _QCACHELOWMEMPRUNES_WARN 1 _QCACHELOWMEMPRUNES_CRIT 10 _KEYCACHEHITRATE_WARN 99: _KEYCACHEHITRATE_CRIT 95: _BUFFERPOOLHITRATE_WARN 99: _BUFFERPOOLHITRATE_CRIT 95: _BUFFERPOOLWAITFREE_WARN 1 _BUFFERPOOLWAITFREE_CRIT 10 _LOGWAITS_WARN 1 _LOGWAITS_CRIT 10 _TABLECACHEHITRATE_WARN 99: _TABLECACHEHITRATE_CRIT 95: _TABLELOCKCONTENTION_WARN 1 _TABLELOCKCONTENTION_CRIT 2 _INDEXUSAGE_WARN 90: _INDEXUSAGE_CRIT 80: _TMPDISKTABLES_WARN 25 _TMPDISKTABLES_CRIT 50 _SLOWQUERIES_WARN 0.1 _SLOWQUERIES_CRIT 1 _LONGRUNNINGPROCS_WARN 10 _LONGRUNNINGPROCS_CRIT 20 _OPENFILES_WARN 80 _OPENFILES_CRIT 95 _THREADCACHEHITRATE_WARN 99: _THREADCACHEHITRATE_CRIT 95:
To set a specific value for an host, declare the same macro in the host definition file.:
define host{ use mysql contact_groups admins host_name my_host address 192.168.0.16 # Specific values for this host _MYSQLUSER root _MYSQLPASSWORD root_pwd }
Bugs, issues and contributing
Contributions to this project are welcome and encouraged … issues in the project repository are the common way to raise an information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file alignak_checks_mysql-1.2.2.tar.gz
.
File metadata
- Download URL: alignak_checks_mysql-1.2.2.tar.gz
- Upload date:
- Size: 48.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 199e474bf8bc60508ecf4f6e5001cb687db7c17724a14884ef8f99aae63e4c2c |
|
MD5 | 3f0a3e22e4415899c7be21851a179d85 |
|
BLAKE2b-256 | f0db60b1e9b760f26ae2e6dfe6f7bbf3c56ad70100b60818148cb42e3fa43eee |
File details
Details for the file alignak_checks_mysql-1.2.2-py2-none-any.whl
.
File metadata
- Download URL: alignak_checks_mysql-1.2.2-py2-none-any.whl
- Upload date:
- Size: 49.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bf4a0bd8af4dc9f977d9dc26573365221219f26916bd90573221f5cbe1bbe07 |
|
MD5 | 8c1d621f4346751a6a0565994f9e8a25 |
|
BLAKE2b-256 | d98a689bf3bb661267ac98593f867d653478fa49228d6affbdd6ec9fa524b152 |