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 !
| # Edit the following file on nagios controller | |
| # | |
| # add an entry like | |
| define contact { | |
| contact_name user_nick_name | |
| use generic-contact | |
| alias Realtebo |
| 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 |
| # 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 |
| #!/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 |