Lab_4_SysOps_Monitoring_Linux_v2.5
System Operations - Lab 4: Monitoring with CloudWatch (Linux) - 2.5
================================================================================================================== Using this command reference. ================================================================================================================== 1. Locate the section you need. Each section in this file matches a section in the lab instructions. 2. Replace items in angle brackets - < > - with appropriate values. For example, in this command you would replace the value - <JobFlowID> - (including the brackets) with the parameter indicated in the lab instructions: elastic-mapreduce --list <JobFlowID>. You can also use find and replace to change bracketed parameters in bulk. 3. Do NOT enable the Word Wrap feature in Windows Notepad or the text editor you use to view this file. ++++1. Create Your Web Server++++ ==================================================================================================================
1.1 Create IAM Policy
================================================================================================================== 1.1.5 Use the following custom policy {
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:Describe*",
"cloudwatch:*",
"logs:*",
"sns:*"
],
"Effect": "Allow",
"Resource": "*"
}
]
} ==================================================================================================================
1.4 Create Web Server
================================================================================================================== 1.4.1 Review the user data script #!/bin/bash
yum -y update
yum -y install httpd php
chkconfig httpd on
/etc/init.d/httpd start mkdir /var/awslogs
mkdir /var/awslogs/state yum -y install awslogs cat > /etc/awslogs/awslogs.conf <<EOF
[general]
state_file = /var/awslogs/state/agent-state [HttpAccessLog]
file = /var/log/httpd/access_log
log_group_name = HttpAccessLog
log_stream_name = {instance_id}
datetime_format = %b %d %H:%M:%S [HttpErrorLog]
file = /var/log/httpd/error_log
log_group_name = HttpErrorLog
log_stream_name = {instance_id}
datetime_format = %b %d %H:%M:%S
EOF REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -n 's/.$//p')
sed -i "s/us-east-1/$REGION/g" /etc/awslogs/awscli.conf service awslogs start
chkconfig awslogs on ++++2. Define CloudWatch Log Metrics++++ ==================================================================================================================
2.2 Create a CloudWatch Logs-Derived Metric
================================================================================================================== 2.2.4 Paste the following filter pattern into the Filter Pattern text box [ip, id, user, timestamp, request, status_code=404, size] ++++3. Generate a Custom Metric from an Instance++++ ==================================================================================================================
3.3 Generate HTTPd Memory Usage Metric
================================================================================================================== 3.3.1 Obtain current memory utilization of all HTTPd instances mem=$(ps -C httpd -O rss | gawk '{ count ++; sum += $2 }; END {count --; print sum/1024 ;};') 3.3.2 Verify $mem echo $mem 3.3.3 Retrieve the instance ID of the current instance instance_id=$(curl -s -w '\n' http://169.254.169.254/latest/meta-data/instance-id) 3.3.4 Verify $instance_id echo $instance_id 3.3.5 Define your custom metric aws cloudwatch put-metric-data --namespace HttpServerMetrics --metric-name HttpServerMemUtilization --dimension InstanceId=$instance_id --value $mem --unit "Megabytes" 漏 2016 Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab_4_SysOps_Monitoring_Linux_v2.5的更多相关文章
随机推荐
- Oracle设置自动递增的方法
1)创建序列: create sequence SEQ_TEST --字段名 minvalue 1 --最小值 maxvalue XXXXX --设置最大值 start wit ...
- peersim中BT网络核心代码解析
首先大概介绍BT网络运行的整体流程: 开始阶段,一个节点加入到网络中,并向tracker节点发送信息,tracker返回若干个邻居的列表 得到列表后,向每个邻居发送bitfiled信息,来获取他们的文 ...
- 探究toString()和valueOf()
1.用法如下:toString()方法:返回对象的字符串表示. 对象 操作 Array 将 Array 的元素转换为字符串.结果字符串由逗号分隔,且连接起来. Boolean 如果 Boolean 值 ...
- IE10、IE11 ASP.Net 网站无法写入Cookie 问题
在做项目的时候遇上一个奇怪的问题,这个项目是用前端DWZ框架+MVC框架做的,在IE10和IE11上, 用户登录之后,操作界面中的任何操作,都无法操作,抛出异常,经过查找分析发现, 只有在IE10和I ...
- iOS 微信分享
1.注册微信开放平台账号:https://open.weixin.qq.com 2.创建应用 设置图片可以使用一个小工具,详情http://www.cnblogs.com/czq1989/p/5073 ...
- gdb调试方法
先打开 gdb 的调试选项: -g 串口端: ./gdb-server 10.12.2.100:12345 ./Kylin 服务器端: (1)./gdb ./Kylin (2) targ ...
- logcat 基本使用
adb logcat -c //清空以前的日志 adb logcat -v time > d:/sss.log //将当前日志输出到d盘的sss.log中 sss.log不 ...
- win10 用cmake 3.5.2 和 vs 2015 update1 编译 GPU版本(cuda 8.0, cudnn v5 for cuda 8.0)
win10 用cmake 3.5.2 和 vs 2015 update1 编译 GPU版本(cuda 8.0, cudnn v5 for cuda 8.0) 用vs 2015打开 编译Release ...
- 关于word excel 等的信息隐藏技术
简单的word 信息隐藏技术分为两种 一 利用word自带的功能对信息进行隐藏,即选中要隐藏的文字 单击右键 选择字体 给隐藏选项打勾即可 这种信息隐藏比较简单 找到的方式为单机文件——找 ...
- java 队列基础操作
http://www.cnblogs.com/fuck1/p/5996116.html 队列(简称作队,Queue)也是一种特殊的线性表,队列的数据元素以及数据元素间的逻辑关系和线性表完全相同,其差别 ...