{"id":5322,"date":"2017-02-22T00:01:04","date_gmt":"2017-02-21T15:01:04","guid":{"rendered":"http:\/\/www.magtranetwork.com\/?p=5322"},"modified":"2017-02-23T16:23:50","modified_gmt":"2017-02-23T07:23:50","slug":"amazon_cloudwatch_output_custom_metrics","status":"publish","type":"post","link":"https:\/\/www.magtranetwork.com\/aws\/amazon_cloudwatch_output_custom_metrics.html","title":{"rendered":"AWS Amazon CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u30fb\u767b\u9332\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0) \uff5e\u30b5\u30fc\u30d0\u304b\u3089\u53d6\u5f97\u3057\u305fLoad Average\u3001\u7a7a\u304d\u30e1\u30e2\u30ea\u5bb9\u91cf\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u3001\u7a7a\u304d\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3001\u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u7387\u3001Apache\u30d7\u30ed\u30bb\u30b9\u6570\u3001HTTP(80\u756a\u30dd\u30fc\u30c8)\u30fbHTTPS(443\u30dd\u30fc\u30c8)\u63a5\u7d9a\u6570\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u30bb\u30c3\u30b7\u30e7\u30f3\u6570\u306a\u3069\u306e\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u5024\u8868\u793a\u306b\u3082\u5bfe\u5fdc\uff5e"},"content":{"rendered":"
AWS\u306eAmazon EC2\u3067\u30b5\u30fc\u30d0\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u5b9a\u671f\u7684\u306b\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066Amazon CloudWatch\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n
\u305f\u3060\u3001Amazon CloudWatch\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30e1\u30c8\u30ea\u30af\u30b9\u306fCPU\u306a\u3069\u4e00\u822c\u7684\u306a\u3082\u306e\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u30ed\u30fc\u30c9\u30a2\u30d9\u30ec\u30fc\u30b8\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u3001Web\u30b5\u30fc\u30d0\u306e\u63a5\u7d9a\u6570\u306a\u3069\u30b5\u30fc\u30d0\u4e0a\u3067\u3057\u304b\u53d6\u5f97\u3067\u304d\u306a\u3044\u3082\u306e\u3092CloudWatch\u3067\u76e3\u8996\u3059\u308b\u5834\u5408\u306b\u306f\u5bfe\u8c61\u30b5\u30fc\u30d0\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3068\u3057\u3066\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n
Amazon CloudWatch\u3078\u306e\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u306e\u767b\u9332\u306fAWS CLI\u3067\u53ef\u80fd\u3067\u3042\u308a\u3001\u69d8\u3005\u306a\u5b9f\u88c5\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n
\u4eca\u56de\u306fLinux\u30b5\u30fc\u30d0\u3067Amazon CloudWatch\u306e\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u306b\u767b\u9332\u3057\u3066\u304a\u304f\u3079\u304d\u3001\u4e00\u822c\u7684\u306a\u30e1\u30c8\u30ea\u30af\u30b9\u306e\u53d6\u5f97\u3068\u9001\u4fe1\u30fb\u767b\u9332\u306b\u52a0\u3048\u3066\u3001AWS\u306f\u3082\u3061\u308d\u3093\u3067\u3059\u304cAWS\u4ee5\u5916\u306e\u30b5\u30fc\u30d0\u3067\u3082\u4f7f\u7528\u3067\u304d\u308b\u6a19\u6e96\u51fa\u529b\u3067\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u53d6\u5f97\u306b\u3082\u5bfe\u5fdc\u3057\u305f\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u3092\u5099\u5fd8\u9332\u3068\u3057\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
\u57fa\u672c\u65b9\u91dd\u3068\u3057\u3066\u306f\u5f15\u6570\u306b\u300caws\u300d\u3068\u5165\u529b\u3059\u308b\u304b\u3057\u306a\u3044\u304b\u3067Amazon CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u3059\u308b\u304b\u3001\u6a19\u6e96\u51fa\u529b\u306b\u3059\u308b\u304b\u3092\u5224\u5b9a\u3057\u3001\u4e0b\u8a18\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u30fb\u767b\u9332\u3082\u3057\u304f\u306f\u6a19\u6e96\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n
\uff1c\u53d6\u5f97\u3059\u308b\u30e1\u30c8\u30ea\u30af\u30b9\uff1e<\/p>\n
\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5185\u5bb9\u306fAmazon CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u3059\u308b\u304b\u3001\u6a19\u6e96\u51fa\u529b\u306b\u3059\u308b\u304b\u3092\u5224\u5b9a\u3059\u308b\u95a2\u6570\u3092\u7528\u610f\u3057\u3001\u305d\u306e\u95a2\u6570\u306bAmazon CloudWatch\u306e\u30ea\u30fc\u30b8\u30e7\u30f3\u3001\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9ID\u3001\u30db\u30b9\u30c8\u540d\u3001\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u540d\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u5024\u3001\u6a19\u6e96\u51fa\u529b\u3067\u4f7f\u7528\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u5024\u3092\u6e21\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n
\r\n[root@localhost ~]# vim output_custom_metrics.sh\r\n<\/pre>\n\r\n#!\/bin\/bash\r\n\r\n#CloudWatch\u306b\u9001\u4fe1\u3059\u308b\u304b\u6a19\u6e96\u51fa\u529b\u306b\u8868\u793a\u3059\u308b\u304b\u3092\u5224\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\r\noutput_custom_reports () {\r\n #\u5404\u5f15\u6570\u306e\u5bfe\u5fdc\u4ed8\u3051\r\n IS_AWS=$1\r\n REGION=$2\r\n NAMESPACE=$3\r\n INSTANCE_ID=$4\r\n HOST_NAME=$5\r\n UNIT=$6\r\n METRIC_NAME=$7\r\n VALUE=$8\r\n ADDITIONAL_VALUE=$9\r\n\r\n if [ "${IS_AWS}" = "1" ]; then\r\n #aws\u5f15\u6570\u304c\u3042\u3063\u305f\u5834\u5408\u306fAWS CLI\u3067CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u3059\u308b\u3002\r\n if [ "${VALUE}" != "" ]; then\r\n aws cloudwatch put-metric-data --metric-name "${METRIC_NAME}" --namespace "${NAMESPACE}" --dimensions "InstanceId=${INSTANCE_ID}, Hostname=${HOST_NAME}" --value "${VALUE}" --unit "${UNIT}" --region ${REGION}\r\n fi\r\n else\r\n #aws\u5f15\u6570\u304c\u306a\u3044\u5834\u5408\u306f\u6a19\u6e96\u51fa\u529b\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u306e\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u3002\r\n if [ "${ADDITIONAL_VALUE}" != "" ]; then\r\n #ADDITIONAL_VALUE\u304c\u3042\u308c\u3070\u6587\u5b57\u5217\u3092\u8ffd\u52a0\u3057\u3066\u8868\u793a\u3059\u308b\u3002\r\n echo "${METRIC_NAME}(${UNIT}): ${VALUE} \/ ${ADDITIONAL_VALUE}"\r\n else\r\n #ADDITIONAL_VALUE\u304c\u306a\u3051\u308c\u3070\u30e1\u30c8\u30ea\u30af\u30b9\u540d\u3001\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u3001\u5024\u3092\u8868\u793a\u3002\r\n echo "${METRIC_NAME}(${UNIT}): ${VALUE}"\r\n fi\r\n fi\r\n}\r\n\r\n#CloudWatch\u306e\u30ea\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\r\nREGION="ap-northeast-1"\r\n#AWS CLI\u306eaws cloudwatch put-metric-data\u3067\u4f7f\u7528\u3059\u308bnamespace, instanceId, Hostname\u3092\u6307\u5b9a\u3059\u308b\u3002\r\nNAMESPACE="YourNameSpace: Custom Instance Metric"\r\nINSTANCE_ID="your-instance-id"\r\nHOST_NAME="your-hostname"\r\n\r\n#\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5f15\u6570\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nMODE=$1\r\n#\u53d6\u5f97\u3057\u305f\u5f15\u6570\u3092\u5168\u3066\u5c0f\u6587\u5b57\u306b\u3059\u308b\u3002\r\nMODE=`echo "${MODE}" | tr 'A-Z' 'a-z'`\r\n\r\nIS_AWS=0\r\n#\u5f15\u6570\u304caws\u3067\u3042\u308c\u3070IS_AWS=1\u306b\u3059\u308b\u3002\r\nif [ "${MODE}" = "aws" ]; then\r\n IS_AWS=1\r\nfi\r\n\r\n#\u30ed\u30fc\u30c9\u30a2\u30d9\u30ec\u30fc\u30b8\u306e1\u5206\u5e73\u5747\u30015\u5206\u5e73\u5747\u300115\u5206\u5e73\u5747\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nLOAD_AVERAGES=`uptime | awk 'BEGIN{FS="load average: "}{print $2}' | sed 's\/,\/\/g'`\r\n\r\n#\u30ed\u30fc\u30c9\u30a2\u30d9\u30ec\u30fc\u30b8\u306e1\u5206\u5e73\u5747\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nLOAD_AVERAGE_1=`echo ${LOAD_AVERAGES} | awk '{print $1}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "LoadAverage1Minute" "${LOAD_AVERAGE_1}" ""\r\n\r\n#\u30ed\u30fc\u30c9\u30a2\u30d9\u30ec\u30fc\u30b8\u306e5\u5206\u5e73\u5747\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nLOAD_AVERAGE_5=`echo ${LOAD_AVERAGES} | awk '{print $2}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "LoadAverage5Minutes" "${LOAD_AVERAGE_5}" ""\r\n\r\n#\u30ed\u30fc\u30c9\u30a2\u30d9\u30ec\u30fc\u30b8\u306e15\u5206\u5e73\u5747\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nLOAD_AVERAGE_15=`echo ${LOAD_AVERAGES} | awk '{print $3}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "LoadAverage15Minutes" "${LOAD_AVERAGE_15}" ""\r\n\r\n#CPU\u4f7f\u7528\u7387\u3092vmstat\u30b3\u30de\u30f3\u30c9\u3067\u53d6\u5f97\u3059\u308b\u3002\r\nCPU_UTILIZATION=$((100 - `vmstat 1 2 | tail -n 1 | awk '{print $(NF-2)}'`))\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002output_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Percent" "CPUUtilization" "${CPU_UTILIZATION}" ""\r\n\r\n#\u5408\u8a08\u30e1\u30e2\u30ea\u5bb9\u91cf\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nMEMTOTAL=`free -m | grep Mem | awk '{print $2}'`\r\n#\u7a7a\u304d\u30e1\u30e2\u30ea\u5bb9\u91cf\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nMEMFREE=`free -m | grep Mem | awk '{print $NF}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Megabytes" "FreeMemoryBytes" "${MEMFREE}" "${MEMTOTAL}"\r\n\r\n#\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u3092\u5408\u8a08\u30e1\u30e2\u30ea\u5bb9\u91cf\u3001\u7a7a\u304d\u30e1\u30e2\u30ea\u5bb9\u91cf\u3092\u5143\u306b\u8a08\u7b97\u3059\u308b\u3002\r\nMEMORY_UTILIZATION=`echo "scale=4;$(( ${MEMTOTAL} - ${MEMFREE} )) \/ ${MEMTOTAL} * 100" | bc -l | sed 's\/00$\/\/g'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Percent" "MemoryUtilization" "${MEMORY_UTILIZATION}" ""\r\n\r\n#\u5408\u8a08\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nDISKTOTAL=`df -m | awk 'NR==2' | awk '{print $2}'`\r\n#\u7a7a\u304d\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nDISKFREE=`df -m | awk 'NR==2' | awk '{print $4}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Megabytes" "FreeDiskBytes" "${DISKFREE}" "${DISKTOTAL}"\r\n\r\n#\u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u7387\u3092\u5408\u8a08\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3001\u7a7a\u304d\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3092\u5143\u306b\u8a08\u7b97\u3059\u308b\u3002\r\nDISK_UTILIZATION=`echo "scale=4;$(( ${DISKTOTAL} - ${DISKFREE} )) \/ ${DISKTOTAL} * 100" | bc -l | sed 's\/00$\/\/g'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Percent" "DiskUtilization" "${DISK_UTILIZATION}" ""\r\n\r\n#Apache\u30d7\u30ed\u30bb\u30b9\u6570\u3092ps\u30b3\u30de\u30f3\u30c9\u3067\u53d6\u5f97\u3059\u308b\u3002\r\nNUMBER_OF_PROCESSES=$(( `ps -e | grep httpd | wc -l` - 1 ))\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "NumberOfApacheProcesses" "${NUMBER_OF_PROCESSES}" ""\r\n\r\n#80\u756a\u30dd\u30fc\u30c8\u63a5\u7d9a\u6570\u3092netstat\u30b3\u30de\u30f3\u30c9\u3067\u53d6\u5f97\u3059\u308b\u3002\r\nPORT_COUNT80=`netstat -an | grep :80 | grep ESTABLISHED | wc -l`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "PortCount80" "${PORT_COUNT80}" ""\r\n\r\n#443\u756a\u30dd\u30fc\u30c8\u63a5\u7d9a\u6570\u3092netstat\u30b3\u30de\u30f3\u30c9\u3067\u53d6\u5f97\u3059\u308b\u3002\r\nPORT_COUNT443=`netstat -an | grep :443 | grep ESTABLISHED | wc -l`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "PortCount443" "${PORT_COUNT443}" ""\r\n\r\n#80\u756a\u30dd\u30fc\u30c8\u3001443\u756a\u30dd\u30fc\u30c8\u306e\u5168\u30a2\u30af\u30c6\u30a3\u30d6\u30bb\u30c3\u30b7\u30e7\u30f3\u6570(TIME_WAIT\u7b49\u3082\u542b\u3080)\u3092\u53d6\u5f97\u3059\u308b\u3002\r\nACTIVE_SESSION_COUNT=`netstat -alpn | grep -E ':(80|443) ' | awk {'print $5'} | cut -d : -f1 | sort -n | uniq -c | sort -n | awk '{total = total + $1} END{print total;}'`\r\n#\u30ab\u30b9\u30bf\u30e0\u30ec\u30dd\u30fc\u30c8\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3002\r\noutput_custom_reports "${IS_AWS}" "${REGION}" "${NAMESPACE}" "${INSTANCE_ID}" "${HOST_NAME}" "Count" "ActiveSessionCount" "${ACTIVE_SESSION_COUNT}" ""\r\n\r\n\r\n<\/pre>\nAWS Amazon CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u30fb\u767b\u9332\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u306e\u5b9f\u884c\u4f8b<\/h3>\n
\u4e0a\u8a18\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u3092\u5f15\u6570\u7121\u3057\u3067\u5b9f\u884c\u3057\u305f\u4f8b\u3068\u300caws\u300d\u306e\u5f15\u6570\u3092\u6e21\u3057\u3066\u5b9f\u884c\u3057\u305f\u4f8b\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n
\r\n[root@localhost ~]# chmod 755 output_custom_metrics.sh\r\n[root@localhost ~]# .\/output_custom_metrics.sh\r\nLoadAverage1Minute(Count): 0.05\r\nLoadAverage5Minutes(Count): 0.15\r\nLoadAverage15Minutes(Count): 0.20\r\nFreeMemoryBytes(Megabytes): 13500 \/ 15000\r\nMemoryUtilization(Percent): 10.00\r\nFreeDiskBytes(Megabytes): 295000 \/ 300000\r\nDiskUtilization(Percent): 1.66\r\nNumberOfApacheProcesses(Count): 5\r\nPortCount80(Count): 100\r\nPortCount443(Count): 0\r\nActiveSessionCount(Count): 300\r\n[root@localhost ~]# .\/output_custom_metrics.sh aws\r\n\uff5e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067Amazon CloudWatch\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u3059\u308b\uff5e\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"AWS\u306eAmazon EC2\u3067\u30b5\u30fc\u30d0\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u5b9a\u671f\u7684\u306b\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066Amazon CloudWatch\u304c\u3042\u308a\u307e\u3059\u3002 \u305f\u3060\u3001Amazon CloudWatch\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30e1\u30c8\u30ea\u30af\u30b9\u306fCPU\u306a\u3069 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3,81,14,22,79,82],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5322"}],"collection":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/comments?post=5322"}],"version-history":[{"count":4,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5322\/revisions"}],"predecessor-version":[{"id":5334,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5322\/revisions\/5334"}],"wp:attachment":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/media?parent=5322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/categories?post=5322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/tags?post=5322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}