Skip to content
Snippets Groups Projects
Select Git revision
  • ada16a78618ac56b2a85c09f2198e966acf3d335
  • master default protected
  • simple-task/7248-eol-check-add-node-22
  • 6877_check_iml_deployment
4 results

check_ssl

Blame
  • check_mysqlserver.md 4.36 KiB

    Check Mysql / mariadb server

    Script: check_mysqlserver

    check_mysqlserver is a plugin execute different checks on a mysql server instance. The kind of check is defined by a parameter -m METHOD.

    Requirements

    • mysql (mysql client as cli tool)
    • The icinga user needs to connect to the database server (see Installation).

    Standalone installation

    From this repository you need next to this script:

    • inc_pluginfunctions shared function for all IML checks written in bash

    Syntax

    $ check_mysqlserver [-i|-u|-m METHOD]

    ______________________________________________________________________
    
    CHECK_MYSQLSERVER
    v1.2
    
    (c) Institute for Medical Education - University of Bern
    Licence: GNU GPL 3
    
    https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_mysqlserver.html
    ______________________________________________________________________
    
    USAGE:
      check_mysqlserver [OPTIONS] -m METHOD
    
    OPTIONS:
      -h  this help
      -i  install monitoring user (must be executed as root)
      -u  uninstall monitoring user (must be executed as root)
    
    PARAMETERS:
      -m  method; valid methods are:
          connections     current/ max connections
          connects        connects per min and aborted connections/ clients
          commands        current running statements insert, select, ...
          qcache-blocks   query cache blocks total vs free
          qcache-queries  cached / non cached queries; low memeory prunes 
          qcache-hits     query cache efficiency: cached vs non cached and inserted
    
    EXAMPLES:
      check_mysqlserver -i
      check_mysqlserver -m commands
    

    Installation

    To give access to the database there is the param -i(for "install"). This command needs to be run as root.

    ./check_mysqlserver -i

    This creates a database user "icingamonitor" with a 64 byte random password. To store the credentials a file file be created: /etc/icingaclient/.my.cnf. It is the known mysql password file. The mysql check plugin sets $HOME to /etc/icingaclient and this config will be found automatically.

    cat /etc/icingaclient/.my.cnf
    #
    # generated on Tue Jun  8 10:01:31 CEST 2021
    #
    [client]
    user=icingamonitor
    host=localhost
    password=qrYEiPG33qNoedO4oWNrmtDOtEmQ9tw8pYEYcPbuYphUweemJEOC4fzZXIWJFvZ5

    To test the connection run ./check_mysqlserver -m connections.

    Checks

    connections

    current/ max connections