This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#set -x | |
#define oracle install dir | |
oracle_dir="" | |
if [ -z $oracle_dir ];then | |
echo "your need define oracle install PATH,please open this setting oracle_dir variables" | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /etc/xinetd.d/mysqlchk | |
# | |
service mysqlchk_write | |
{ | |
flags = REUSE | |
socket_type = stream | |
port = 9200 | |
wait = no | |
user = nobody |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script checks if a mysql server is healthy running on localhost. It will | |
# return: | |
# | |
# "HTTP/1.x 200 OK\r" (if mysql is running smoothly) | |
# | |
# - OR - | |
# | |
# "HTTP/1.x 500 Internal Server Error\r" (else) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HAProxy configuration - haproxy-db.cfg | |
## | |
## FRONTEND ## | |
## | |
# Load-balanced IPs for DB writes and reads | |
# | |
frontend db_write | |
bind 172.16.0.50:3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cpuinfo=`egrep '^flags.*(vmx|svm)' /proc/cpuinfo` | |
if [ "$cpuinfo" = "" ]; then | |
echo "There doesn't appear to be any hardware support for virtualization" | |
exit | |
fi | |
hardware=`dmesg | grep kvm | grep -i 'no hardware support'` | |
bios=`dmesg | grep kvm | grep -i 'disabled by bios'` | |
if [ "$hardware" != "" ]; then | |
echo "No hardware support for KVM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Any Failing Command Will Cause The Script To Stop | |
set -e | |
# Treat Unset Variables As Errors | |
set -u | |
NAGIOS_VERSION=3.5.0 | |
PLUGIN_VERSION=1.4.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk 'BEGIN {printf "%s%5s%15s%15s\n", "Connect","TPS","QPS","RT"}; {if ($0 ~ /threads:/){printf "%s\t", $4} ;if ($0 ~/transactions:/){sub(/\(/,"");printf "%s\t", $3};if($0~/requests:/){sub(/\(/,"");printf "%s\t",$4};if ($0~/avg:/){print $2}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk 'BEGIN {printf "%s\t%s\n", "Connect","TpmC"}; {if ($0 ~ /connection/){printf "%s\t", $2} ;if ($0 ~/[0-9].*TpmC/) {print $1}}' tpcc_result_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# set -x | |
# Shell script to monitor or watch the disk space | |
# It will send an email to $ADMIN, if the (free available) percentage of space is >= 90%. | |
# ------------------------------------------------------------------------- | |
# Set admin email so that you can get email. | |
ADMIN="root" | |
# set alert level 90% is default | |
ALERT=90 | |
# Exclude list of unwanted monitoring, if several partions then use "|" to separate the partitions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
modprobe ipt_MASQUERADE | |
modprobe ip_conntrack_ftp | |
modprobe ip_nat_ftp | |
iptables -F | |
iptables -t nat -F | |
iptables -X | |
iptables -t nat -X | |
###########################INPUT键################################### |