หน้าเว็บ

วันพฤหัสบดีที่ 31 มีนาคม พ.ศ. 2554

Introduction to VMware ESXi and Install ESXi 4.1 from a USB stick


System Requirements
CPU          รองรับ 64-bit และ Intel VT-x/ AMD-V
Memory     2 GB หรือสูงกว่า
Network     1 Ethernet Card
Hard disk     มีพื้นที่ว่างอย่างน้อย 8GB (แนะนำ 20 GB สำหรับติดตั้ง Guest OS เพิ่ม)
Software     VMWare ESXi 4.0
Note:    สำหรับ Intel VT-x/ AMD-V จะต้องสั่ง enable ใน BIOS ด้วย เพราะโดย default แล้วจะถูกเซตเป็น disable ไว้

เนื่องจาก VMware Esxi ออกแบบมาเฉพาะกับ Hardware บางประเภท ทำให้คอมพิวเตอร์ทั่วไปที่เราใช้กันอยู่นั้นไม่สามารถติดตั้ง VMware Esxi ได้ แต่เราสามารถใช้ VMware Workstation จำลองสภาพแวดล้อม ให้มีลักษณะเหมาะสมเพื่อติดตั้ง VMware Esxi ลงไป
Note:    ดูรายละเอียด Hardware ที่รองรับการทำงานของ VMware Esxi ได้ที่
http://www.vm-help.com/esx40i/Hardware_support.php

ติดตามต่อที่นี้ 

Install VMware ESXi 4.1 from bootable USB stick



Ref 


     1 . http://www.jonathanmedd.net/2011/01/install-esxi-4-1-from-a-usb-stick.html

     2.  http://www.ivobeerens.nl/?p=699
  
     3.  http://www.kernel.org/pub/linux/utils/boot/syslinux/

     4.  http://www.techhead.co.uk/how-to-create-a-bootable-vmware-esxi-usb-pen-drive

     5.  http://benincosa.org/blog/?p=171

วันพฤหัสบดีที่ 24 มีนาคม พ.ศ. 2554

Install nagios nrpe on ubuntu

First, you need to install the nagios-nrpe-server. There is a nagios-nrpe-plugin but that’s not what you need because that is just the plugin and you need this daemon (Linux equivalent of a Windows Service for all you Windows guys).
sudo apt-get install nagios-nrpe-server
next, we should check and make sure that the service is actually running. We can do this two ways
sudo ps -Al | grep nrpe
This will show a line where the process is started. If it just comes back without stating anything something is wrong. Another check is to make sure you machine is listening on the nrpe port
netstat -an | grep 5666
Next, we need to set up the Nagios server to be able to check our machine.
sudo nano /etc/nagios/nrpe.cfg
and change
allowed_hosts=127.0.0.1
to
allowed_hosts=127.0.0.1,x.x.x.x
where “x.x.x.x” is the ip address of your nagios server. Now restart the nrep daemon so it reloads the settings
sudo /etc/init.d/nagios-nrpe-server restart
Now go on the Nagios server and run the following command
/usr/local/nagios/libexec/check_nrpe -H y.y.y.y
where “y.y.y.y” is the ip address of the machine you just installed nrpe on. If it works it will respond with the version of NRPE you just installed on the machine.

วันจันทร์ที่ 21 มีนาคม พ.ศ. 2554

Linux / Unix Command: vmstat

vmstat - Report virtual memory statistics  

SYNOPSIS

vmstat [-n] [delay [ count]]
vmstat[-V]  

DESCRIPTION

vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity. The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case.
 

Options

The -n switch causes the header to be displayed only once rather than periodically. delay is the delay between updates in seconds. If no delay is specified, only one report is printed with the average values since boot.
count is the number of updates. If no count is specified and delay is defined, count defaults to infinity.
The -V switch results in displaying version information.
 

FIELD DESCRIPTIONS

 

Procs

r: The number of processes waiting for run time.  
b: The number of processes in uninterruptable sleep.
w: The number of processes swapped out but otherwise runnable.  This 
   field is calculated, but Linux never desperation swaps.
 

Memory

swpd: the amount of virtual memory used (kB).
free: the amount of idle memory (kB).
buff: the amount of memory used as buffers (kB).
 

Swap

si: Amount of memory swapped in from disk (kB/s).
so: Amount of memory swapped to disk (kB/s).
 

IO

bi: Blocks sent to a block device (blocks/s).
bo: Blocks received from a block device (blocks/s).
 

System

in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.

These are percentages of total CPU time.
us: user time
sy: system time
id: idle time 
 
 
Example
$ vmstat 1 5
 
Example for add timestamp
 
Create perl script 
$ vi timestamp.pl
#!/usr/bin/perl
while (<>) { print localtime() . ": $_"; }
 
$ vmstat 1 5 | ./timestamp.pl 
 
Example for monitor Memory and CPU
 
$/usr/bin/watch -n 5 '/usr/bin/vmstat -s -S M | /bin/grep -E "memory|cpu"' 
 
Thanks : www.thegeekstuff.com

วันพฤหัสบดีที่ 17 มีนาคม พ.ศ. 2554

SQL: BETWEEN Condition

BETWEEN Condition

เมื่อกล่าวถึงการใช้งาน   BETWEEN  หลายคนคงสงสัยว่าใช้งานอย่างไร ลองมาดูกัน
       
       Syntax : SELECT columns
                     FROM tables
                     WHERE column1 between value1 and value2;

       โดย  columns => ค่าในคอลัมน์ที่เราต้องการ
               tables     => ตารางที่เราจะหา
               column1 => คอลัมน์ที่เรามาตรวจสอบ
               value1,value2 => ค่าสองตัวที่เราจะให้ไปตรวจสอบ


        Example1SELECT * FROM suppliers WHERE supplier_id between 500 AND 510;

       Example2SELECT * FROM orders WHERE order_date between to_date ('2011/03/17', 'yyyy/mm/dd') AND to_date ('2011/03/31', 'yyyy/mm/dd');


วันพฤหัสบดีที่ 3 มีนาคม พ.ศ. 2554

How to test a POP server by using telnet


The initial telnet: >  telnet pop.example.com pop3
client: USER MyUsername                     //ใส่ username
server: +OK please send PASS command
client: PASS MyPassword                     //ใส่ password
server: +OK MyUsername is welcome here
client: LIST                        // คำสั่งดู รายการ
server: +OK 1 messages
server: 1 1801
client: RETR 1                    // เปิดดูเมลล์
***********Show data in mail*************
client: DELE 1                    // ลบเมลล์
server: +OK
client: quit                        //  ออก
server: +OK MyUsername InterMail POP3 server signing off.


Thanks : anta.net