Wednesday, February 23, 2011

Monitoring Disk Usage on AS400 V6R1 using SNMPv1

#!/bin/sh

IP=$1
COMMUNITY="public"
SNMP_VERSION="1"

DISK_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.5.1 | awk '{ print $NF }' | tail -n 1`

DISK_USED=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.6.1 | awk '{ print $NF }' | tail -n 1`

if [ $DISK_SIZE -lt 0 ]
then
        DISK_SIZE=$((DISK_SIZE+2**32))
fi

echo `expr $DISK_USED \* 10000 / $DISK_SIZE`

Monitoring No of Voice Call on Cisco Router

snmpwalk -v 2c -m DIAL-CONTROL-MIB -c public $1 1.3.6.1.2.1.10.21.1.3.1.1.9 | grep -c "INTEGER:"

Monitoring Postfix Mail Queue on Zabbix

/etc/zabbix/zabbix-agentd.conf
UserParameter=postfix.deferred, sudo /usr/sbin/qshape deferred | grep TOTAL | awk '{print $ 2}'
UserParameter=postfix.queue, sudo /usr/sbin/qshape | grep TOTAL | awk '{print $ 2}'

LogFile=/var/log/zabbix-agent/zabbix_agentd.log

visudo
zabbix ALL = NOPASSWD:/usr/sbin/qshape

Monday, February 21, 2011

Surprising about Chrome Web Store !!

Free Web based full function AutoCAD WS!
Facebook App
eBuddy App

It just make my Google Chrome Browser works like my iphone!

Reclaim Disk Space using SVMotion

1. Zero out disk space using sdelete or dd
2. Change Disk Format to Thick Provision by SVmotion
3. Power off PC, SVmotion the datastore with a different VMFS block size and change to Thin Provision.

Sunday, February 20, 2011

Aligning VM Disk Partition

Windows:
Very easy, boot Windows using Gparted, resize the partition with 1 MB free space before will be done.

Linux:
If you are not using LVM, simply do it using Gparted.
If you are using LVM (You can do it online, by move VolGroup from disk to disk!),
1. add a disk same size as the disk you want to align (E.g. the original disk /dev/sdb1 is 40G and belongs to VolGroup01)
2. using fdisk, create a new partition on /dev/sdc, moving beginning data to 128 (http://www.tcpdump.com/kb/virtualization/vmware-esx-server/vmware-disk-alignment/vmfs-liux.html)
3. pvcreate /dev/sdc1
4. vgextend VolGroup01 /dev/sdc1
5. pvmove /dev/sdb1 /dev/sdc1
6. vgreduce VolGroup01/dev/sdb1
7. pvremove ./dev/sdb1
8. shutdown your machine and remove your disk /dev/sdb1

REMARK: if you are using thin disk, this method will allocate whole disk size, you might want to shrink it be Storage Vmotion.

MySQL Innodb Performance

Recently, having trouble on and solving my zabbix server VM which having slow IO resposnse

Tuning Innodb


Align VM Partition
http://www.tcpdump.com/kb/virtualization/vmware-esx-server/vmware-disk-alignment/intro.html


http://dev.mysql.com/doc/refman/5.0/en/innodb-data-log-reconfiguration.html

I LOVE Ubuntu

Love using ubuntu desktop 10.10, found good download manager in firefox, "DownThemAll"


recordMyDesktop - Another good tools in linux for desktop capture and recording


tsclient is suck, I like Remmina Remote Desktop Client!