http://rimuhosting.com/howto/memory.jsp
# create a memmon.sh script that tracks the current date, memory usage and running processes
cat << EOF > /root/memmon.sh
#!/bin/bash
date;
uptime
free -m
vmstat 1 5
ps auxf --width=200
if which iptables 2>&1 > /dev/null; then
iptables -L | diff iptables_default - | awk '{print "IPTABLES: " $0}'
iptables -L > iptables_default
else
echo "IPTABLES MISSING"
fi
dmesg | diff -u dmesg_default - | grep '^+' | awk '{print "DMESG:" $0}'
dmesg > dmesg_default
EOF
chmod +x /root/memmon.sh
# create a cronjob that runs every few minutes to log the memory usage
echo '0-59/10 * * * * root /root/memmon.sh >> /root/memmon.txt' > /etc/cron.d/memmon
/etc/init.d/cron* restart
# create a logrotate entry so the log file does not get too large
echo '/root/memmon.txt {}' > /etc/logrotate.d/memmon
分享到:
相关推荐
技术文档分享。
Symptoms, Causes, and Troubleshooting of Native Out of Memory Conditions Generic JDBC Pattern Understanding Generic JDBC Pattern Review: JDBC Database, Datasources, Connection Pool, and Statement ...
Oracle TimesTen In-Memory Database Troubleshooting Guide 11g Release 2 (11.2.2)-124
Starting with an introduction to OpenStack troubleshooting tools, we'll walk through each OpenStack service and how you can quickly diagnose, troubleshoot, and correct problems in your OpenStack....
Advanced Oracle Troubleshooting
Cisco Press 2002 Troubleshooting2
Citrix Troubleshooting Guide
Troubleshooting PostgreSQL
This book will be a practical guide showing how to fix real-life issues related to installation, memory, Dockerfile syntax, connection, authorization, networking and so on in Docker. This book will ...
TCPIP Analysis and Troubleshooting Toolkit
IBM Open source course for JVM troubleshooting it's a course for medium and experienced java developer
3TroubleShooting (BIOS-Xwindow)
数据通信网络troubleshooting培训胶片
Cisco.Press.CCNP.Practical.Studies.Troubleshooting.eBook CCNP Troubleshooting操作指南 受上传限制,分为2个压缩包
Troubleshooting IP Routing Protocols 2002 Troubleshooting IP Routing Protocols 2002
Windows 10 Troubleshooting 英文pdf
sybase errors and troubleshooting Guide Sybase的错误和故障排除指南,英文版。
關於 RAC Troubleshooting 的處理。
BGP_TroubleShooting
Troubleshooting PostgreSQL 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或...