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的更多相关文章
随机推荐
- javascript中值传递与值引用的研究
今天重新看了一下<javascript高级程序设计>,其中讲到了javascript中的值传递和值引用,所以就自己研读了一下,但是刚开始没有明白函数中的参数只有值传递,有的场景好像参数是以 ...
- jsp内置对象浅谈
jsp内置对象浅谈 | 浏览:1184 | 更新:2013-12-11 16:01 JSP内置对象:我们在使用JSP进行页面编程时可以直接使用而不需自己创建的一些Web容器已为用户创建好的JSP内置对 ...
- Eclipse的FindBugs插件
Eclipse的FindBugs插件 问题提出: 当我们编写完代码,做完单元测试等各种测试后就提交正式运行,只能由运行的系统来检测我们代码是否有问题了,代码中隐藏的错误在系统运行的过程中被 ...
- Web Deploy安装时显示Web Management Service无法启动
在安装显示如题错误,看了日志: IISWMSVC_STARTUP_UNABLE_TO_READ_CERTIFICATE 无法读取带有指纹"3f60e39108a7e4c54f671b75 ...
- Node调用C++(dll)
最近开始搞毕设了,打算用自己拿手的js来搞,但是仿佛入坑了,Node还不是很熟.总之,兵来将挡,水来土掩嘛,带着问题学习才是最高效的. 折腾1:Node 调用 C++ 刚开始,虽然我老师把dll文件给 ...
- mac下获取应用签名
查看md5和SHA1: universalbroker.jks为签名文件 keytool -list -v -keystore universalbroker.jks 微信分享和登录平台需要去掉冒号的 ...
- Android之QQ新用户注册界面1
还没到睡觉时间所以再加了一个界面... 问题: 1.下拉列表(因为还没看到这里...) 2.标题栏显示问题 3.按钮的 Enable 设置 .......... 以下是代码: 布局 fragment_ ...
- 如何关闭emacs开启时自己打开的欢迎界面
EMACS在开启后,会自动打开一个欢迎界面.如果要去除他,可以在用emacs或其实编辑工具编辑~/.emacs文件. 在最下面一行加上,保存退出即可. (setq inhibit-startup-me ...
- ios系统(苹果手机)按钮显示为圆角和渐变的问题
按钮在安卓手机上显示正常,但在苹果手机上会显示如下: 解决办法:给该按钮的样式加上:-webkit-appearance:none;这样按钮就会显示正常
- 【转】oracle内存分配和调优总结
转自 http://blog.itpub.net/12272958/viewspace-696834/ 一直都想总结一下oracle内存调整方面的知识,最近正好优化一个数据库内存参数,查找一些资料并且 ...