Skip to content

Instantly share code, notes, and snippets.

Mirko Tebaldi realtebo

  • Somewhere over the raimbow
  • Ferrara, Italy
Block or report user

Report or block realtebo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Mysql Query Log To File - Debian 9.md

Configure mysql to log query on file

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 !

@realtebo
realtebo / example of config for a remote with ncpa.ini
Created Oct 9, 2019
example of config for a remote with ncpa
View example of config for a remote with ncpa.ini
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
View create contacts in nagios
# Edit the following file on nagios controller
#
# add an entry like
define contact {
contact_name user_nick_name
use generic-contact
alias Realtebo
View Example of nagios.conf
server {
#### NOTE: UPDATE THE DOMAIN ACCORDING TO YOUR SETUP ####
server_name nagios.yourdomain.tld;
#### NOTE: UPDATE THE PATH ACCORDING TO YOUR SETUP ####
#### This is my Debian 9 vps ####
#### Some systems usess /usr/share/nagios/share ####
root /usr/local/nagios/share;
@realtebo
realtebo / chustom_check_mem script for nrpe
Created Aug 19, 2019
chustom_check_mem script for nrpe
View chustom_check_mem script for nrpe
#### 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 ##########
@realtebo
realtebo / Install NRPE (to remote host, NOT on the controller)
Last active Oct 10, 2019
Install NRPE (to remote host, NOT on the controller)
View Install NRPE (to remote host, NOT on the controller)
# 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 8
################
# NRPE #
################
# Execute all as super user !
View chustom_check_git
#!/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
@realtebo
realtebo / example config for a server without npa
Created Aug 19, 2019
example config for a server without npa
View example config for a server without npa
# 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
@realtebo
realtebo / Install NCPA on a Debian 9 [on the remote machine to be controlled by nagios]
Last active Sep 16, 2019
Install NCPA on a Debian 9 [on the remote machine to be controlled by nagios]
View Install NCPA on a Debian 9 [on the remote machine to be controlled by nagios]
# All steps on debian require root
# DO NOT TRY THIS ON DEBIAN 8 - It will not works !
su
# Prerequisites
# NO !!! apt install python-pip
# NO !!! pip install psutil
apt install libssl-dev
# Installation
@realtebo
realtebo / search.sh
Last active Jun 21, 2019
Search corrupted php file and fake icons
View search.sh
#!/bin/bash
EXIT_CODE=0
for cartella in $( ls -l /var/www | grep -e "^d" | awk '{ print $9 }'); do
echo "Scansione /var/www/$cartella ...."
for phpfile in $(find /var/www/$cartella -type f -iname '*.php'); do
You can’t perform that action at this time.