Posts

Showing posts with the label Scripts

change file upper letters in lower letters

awk '{ print tolower($0) }' yum_update.bkp >yum_update.bkp_lower

Scripts for Nagios

###Find disk Space### #!/bin/bash used_space=`df -h / | grep -v Filesystem | awk '{print $5}' | sed 's/%//g'` case $used_space in [1-84]*) echo "OK - $used_space% of disk space used." exit 0 ;; [85]*) echo "WARNING - $used_space% of disk space used." exit 1 ;; [86-100]*) echo "CRITICAL - $used_space% of disk space used." exit 2 ;; *) echo "UNKNOWN - $used_space% of disk space used." exit 3 ;; esac # for VM count in KVM #!/bin/bash VM_running=`virsh list --all | grep -i running | wc -l` if [ $VM_running -lt 10 ] ; then echo "OK - $VM_running are currently in running state." exit 0 fi         if [[ "VM_running" -gt "10" ]] && [[ "VM_running" -lt "12" ]]; then         echo "WARNING - $VM_running are currently in running state."         exit 1 fi         if [[ "VM_running" -gt "12" ]] && [[ "VM_runnin...

Script to create bridge for KVM configuration

#!/bin/bash brctl addbr br0 ifconfig br0 9.126.138.64 netmask 255.255.255.0 up route add default gw 9.126.138.1 br0 ifconfig eth0 0.0.0.0 up brctl addif br0 eth0