tomcatstatushtml内容处理awk-创新互联
[root@localhost handle_tomcat_status]# cat handle.sh
#!/bin/sh
awk '/Free memory:/{print "Free memory: " $4}' a.txt
awk '/Total memory:/{print "Total memory: " $8}' a.txt
awk '/Max memory:/{print "Max memory: " $12}' a.txt
for n in 'Eden Space' 'Survivor Space' 'Tenured Gen' 'Code Cache' 'Compressed Class Space' 'Metaspace'
do
awk -F"($n)+" '/Eden Space/{ print $2}' a.txt |awk -v name="$n" -F'[()]+' '{print name ": " $5 " "$7 " "$9 " "$11}'
done
html内容:

成都创新互联专注于图木舒克企业网站建设,响应式网站,
商城网站开发。图木舒克网站建设公司,为图木舒克等地区提供建站服务。全流程按需搭建网站,专业设计,全程项目跟踪,
成都创新互联专业和态度为您提供的服务
curl http://tomcat:s3cret@192.168.10.12:8080/manager/status?JSON=true
/manager
Server Status
Manager
| List Applications
| HTML Manager Help
| Manager Help
| Complete Server Status
Server Information
| Tomcat Version
| JVM Version
| JVM Vendor
| OS Name
| OS Version
| OS Architecture
| Hostname
| IP Address
| Apache Tomcat/7.0.53
| 1.8.0_91-b14
| Oracle Corporation
| Linux
| 2.6.32-431.el6.x86_64
| amd64
| localhost
| 127.0.0.1
JVM Free memory: 27.21 MB Total memory: 58.00 MB Max memory: 928.00 MB Memory PoolTypeInitialTotalMaximumUsedEden SpaceHeap memory16.00 MB16.00 MB256.00 MB10.50 MB (4%)Survivor SpaceHeap memory2.00 MB2.00 MB32.00 MB0.82 MB (2%)Tenured GenHeap memory40.00 MB40.00 MB640.00 MB19.45 MB (3%)Code CacheNon-heap memory2.43 MB6.62 MB240.00 MB6.49 MB (2%)Compressed Class SpaceNon-heap memory0.00 MB2.12 MB1024.00 MB1.95 MB (0%)MetaspaceNon-heap memory0.00 MB18.37 MB-0.00 MB17.73 MB"ajp-bio-8009" Max threads: 200 Current thread count: 0 Current thread busy: 0 Max processing time: 0 ms Processing time: 0.0 s Request count: 0 Error count: 0 Bytes received: 0.00 MB Bytes sent: 0.00 MB StageTimeB SentB RecvClient (Forwarded)Client (Actual)VHostRequestP: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive "http-bio-8080" Max threads: 200 Current thread count: 10 Current thread busy: 1 Max processing time: 166 ms Processing time: 0.552 s Request count: 47 Error count: 6 Bytes received: 0.00 MB Bytes sent: 0.27 MB StageTimeB SentB RecvClient (Forwarded)Client (Actual)VHostRequestS1 ms0 KB0 KB192.168.10.12192.168.10.12192.168.10.12 | GET /manager/status?JSON=true HTTP/1.1R??????R??????R?????? P: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive
Copyright © 1999-2014, Apache Software Foundation
| | | | |
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享文章:tomcatstatushtml内容处理awk-创新互联
文章分享:
http://scpengxi.com/article/jiipo.html