Change the file /etc/mysql/conf.d/mysql.cnf (require elevated privileges) adding
[mysqld]
general_log = on
general_log_file=/var/log/query
If you change the filename, keep it consistent in the following steps !
| #!/usr/bin/env bash | |
| PACKAGES=`apt list --upgradable 2>/dev/null | wc -l` | |
| echo "Trovati $PACKAGES package da aggiornare" | |
| # soglie da default | |
| WARNING=10 | |
| CRITICAL=20 | |
| # Leggo i valori delle opzioni | 
| # Nota - Se eseguendo dpk c'è un errore di comandi non trovati | |
| # su | |
| # nano /root/.bashrc | |
| # appendero in fondo | |
| # export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
| # salvare | |
| # source /root/.bashrc | |
| su | 
| define host { | |
| host_name HostNameWithoutSpecialChars | |
| hostgroups NCPA | |
| address 139.xx.yyy.zzzz | |
| check_command check_ncpa!-t 'community_string' -P 5693 -M system/agent_version | |
| max_check_attempts 5 | |
| check_interval 5 | |
| retry_interval 1 | |
| check_period 24x7 | |
| contacts nagiosadmin | 
| # Edit the following file on nagios controller | |
| # | |
| # add an entry like | |
| define contact { | |
| contact_name user_nick_name | |
| use generic-contact | |
| alias Realtebo | 
| server { | |
| #### NOTE: UPDATE THE DOMAIN ACCORDING TO YOUR SETUP #### | |
| server_name nagios.test; | |
| #### NOTE: UPDATE THE PATH ACCORDING TO YOUR SETUP #### | |
| #### This is my Debian 10 vps #### | |
| #### Some systems uses /usr/share/nagios/share #### | |
| root /usr/local/nagios/share; | 
| #### See https://support.nagios.com/forum/viewtopic.php?f=7&t=53059 | |
| # Save the content of the file into /usr/local/nagios/libexec/custom_check_mem | |
| # - ownership root:nagios | |
| # - permissions 755 | |
| #!/bin/bash | |
| # Script to check real memory usage | |
| # L.Gill 02/05/06 - V.1.0 | |
| # ------------------------------------------ | |
| # ######## Script Modifications ########## | 
| # Use nrpe on remote host instead of ncpa only if ncpa is not working | |
| # this setup require BOTH nrpe AND plugins | |
| # Use this when on debian 7/8 | |
| ################ | |
| # NRPE # | |
| ################ | |
| # Execute all as super user ! | 
| #!/bin/bash | |
| cd /var/www/credit-sales | |
| git status --porcelain | grep php >> /dev/null | |
| if [ $? -gt 0 ]; then | |
| echo "CRITICAL, folder credit-sales modified" | |
| exit 2 | |
| fi | 
| # this config file is an example of config file for handle | |
| # remote host with nrpe insted of the new ncpa | |
| # save this file on the controller, NOT on the controlled machine | |
| define host { | |
| host_name Server 212 | |
| address 212.271.149.146 | |
| check_command check-host-alive | |
| max_check_attempts 5 |