Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. Show all posts

Sunday, March 06, 2016

Monitor EC2 Memory Usage using AWS CloudWatch

CloudWatch an AWS service provides rich set of tools to monitor health and resource utilization of various services on AWS. These metrics can be used to trigger an alarm, send notifications, even trigger actions based on these alarms.

 

One main metric that is missing from default CloudWatch metrics is Memory utilization of EC2 instances. Since AWS does not have access to EC2 instance at the Operating System level, only CPU, Network utilization, IO and other metrics that can be monitored through Hypervisor layer are available by default in AWS Console.

 

AWS provides a set of scripts that utilize CloudWatch API to send Memory Utilization info and make use of CloudWatch features to monitor and take action if alarms are raised.

The process of sending these custom metrics are different for Linux and Windows Instances. Even the process of installing pre-requisites on different Linux distributions is slightly different.

 

In this post we will see the process of installing and configuring CloudWatch Custom Metrics for Redhat derived Linux Distros, mainly RHEL, Amazon Linux and CentOS along with Windows to monitor Memory Utilization of the EC2 instance

 

Updated (27-March-2016) – Added Commands for Ubuntu Linux

 

List of all commands run on Linux are also available at the end of the post for easy

reference.

 

Step –1

Create an IAM user with access key. We do not need password or console access to this user.

 

image_thumb[32]

 

Copy and keep the Access key handy as we would need this every time we configure custom metrics to be sent to CloudWatch

 

Tuesday, April 10, 2012

RHEL/CentOS on Hyper-V 2k8 R2 with LIC v3.2

Microsoft Officially supports RedHat, CentOS and SUSE Linux Distributions as VMs running on Hyper-V. Linux Integration Components (LIC) or Linux Integration Services are the software components released by Microsoft that need to be installed on Linux VMs to take full advantage of Hyper-V features.
 
  • Linux Integration Components are a set of drivers that enable synthetic device support in supported Linux virtual machines running on Microsoft Hyper-V
These components when installed on Linux mainly provide below features
 
1. Drivers : Synthetic network controller (NIC), IDE and SCSI storage controllers support
2. Time sync : Clock inside the virtual machine will be in synch with the clock on the Host
3. Integrated Shutdown : Shut down from either Hyper-V Manager or SCVMM
4. Symmetric Multi-Processing (SMP) Support : Support up to 4 virtual processors Per VM
5. Heartbeat : Allows Host to detect if the virtual machine is running and responsive
6. Integrated Mouse Support : Seamless mouse integration when used with the Linux GUI
 
If Linux IC are not installed one might be presented with one or all of the below errors
 
CEntOS-00
 
CEntOS-01
 
CEntOS-02
 
Note: This post assumes that one has install CentOS/RHEL/Scientific Linux 6.2 on HyperV and has mounted Linux IC v3.2.iso onto DVD Drive of VM. If not please follow link below this post for Picture guide of CentOS server minimal installation
 
The documentation available along with LIC v3.2 looks good, but, unfortunately when trying to install you will get an error similar to the below one
 
ls: cannot access kmod-hyper-v-rhel6-43.1.x86_64.rpm: no such file or directory
ls: cannot access hyper-v-rhel6-43.1.x86_64.rpm: no such file or directory RPM’s are missing
 
There is a simple work around to this by changing the working directory to the mount point of Linux IC drive and invoking ./install.sh script.
 
LIC-Error
 
Below are the commands to run to install Linux IC and reboot, once prompted, as shown in the above screenshot
 
mount /dev/cdrom /media
 
cd /media
 
./install.sh
 
reboot
 
When VM is rebooted you will notice that there is no network connectivity to your VM. Follow steps below for configuring network connectivity
vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
Press i Key on keyboard and type the below lines
DEVICE="eth0"
ONBOOT="yes"
HWADDR=
TYPE=Ethernet
BOOTPROTO=dhcp
NAME="System eth0"
 
HWADDR is the MAC address of the NIC that can be found from settings menu of VM in Hyper-V (Below screenshot for your reference) and DHCP is the mode of getting IP Address
 
CEntOS-27b
 
Now use below Key Combination to save the file and close
Esc
Shift + :
wq
Enter
 
Use the below commands to edit, Save and close one more file
vi /etc/sysconfig/network
 
CEntOS-27c
 
Enter below text, save and close
NETWORKING=yes
 
CEntOS-27d
 
Now Run ifup eth0 and you should be connected to network or else take a reboot.
 
CEntOS-27e
 
With this our CentOS/RHEL/Scientific Linux 6.2 can take full advantage of Hyper-V synthetic drivers and is ready for production :)
 
Useful Links:-