Skip to content

Instantly share code, notes, and snippets.

View tsleite's full-sized avatar

tsleite tsleite

View GitHub Profile
version: '3.1'
networks:
zbx-net:
driver: bridge
services:
mysql:
container_name: mysql
image: mysql:5.7
networks:
- zbx-net
# App Zabbix Server
server {
listen 8010;
server_name <INSERT_IP_PRIVATE>;
auth_basic "App01 Zabbix Server - Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://localhost:8080/zabbix/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
mkdir -p /etc/certs
cd /etc/certs/
openssl genrsa -aes256 -out server.key 2048
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
rm server.key.org
---- Request Assign Certificate
# tleite
# Se não estiver rodando interativamente, não fazer nada
[ -z "$PS1" ] && return
# Não armazenar as linhas duplicadas ou linhas que começam com espaço no historico
HISTCONTROL=ignoreboth
# Adicionar ao Historico e não substitui-lo
shopt -s histappend
#!/bin/bash
# Foked script
# Discovery all process running
# Data: 01/09/2020
set -e
run=`echo -n '{"data":[' ;ps -A -o comm= -o time= -o vsz= | grep -v ' 00:00:00' | awk '$3 != 0' | cut -c-15 | sed 's/ *$//' | awk '!a[$0]++' | sed 's/\(.*\)/{"{#N_PROCESSO}":"\1"}/g' | sed '$!s/$/,/' | tr '\n' ' ' ;echo -n ']}'`
echo -e "$run" | jq .
#!/bin/bash
##################################################################
# Script: check_sap_availability.sh #
# Author: Wilson Fernandes #
# Contact: Email: wilsonwers@gmail.com #
# Date: 2019-08-15 #
# Description: Monitoramento Disponibilidade SAP #
# Use: check_sap_availability.sh hdbnameserver 00 #
##################################################################
use zabbix;
truncate table history;
truncate table history_log;
truncate table history_str;
truncate table history_text;
truncate table history_uint;
truncate table trends;
truncate table trends_uint;
optimize table history;
optimize table history_log;
#!/bin/bash
# Disable IPv6 on Linux
echo "Disabling IPv6..."
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo "Disabling IPv6 on boot..."
cat >> /etc/sysctl.conf << EOF
#disable ipv6 on boot
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
#!/bin/bash
# Arquivo realiza um backup rápido do sqlite3 do grafana para o diretório /tmp
PATH=/tmp
DB="/var/lib/grafana/grafana.db"
BACKUP="$PATH/grafana.db-$(date +%Y%m%d).bck"
SQLITE=/usr/bin/sqlite3
ZIP=/bin/gzip
 
# Execução 
#!/bin/bash
# Instala Elasticsearch 7 em ambiente Linux
# Permissão
sudo -n true
if [ $? -ne 0 ]
then
echo "$(whoami), Precisa de permissão SUDO"
exit
fi