我正在寻找一种方式来记录和图形显示cpu和RAM使用linux进程随着时间的推移。由于找不到简单的工具,所以(我尝试过zabbix和munin,但是安装失败),所以我开始编写一个shell脚本。
脚本文件通过awk解析top命令的输出,并登录到csv文件中。它
通过ps命令计算出进程的pid。
使用top和awk记录cpu和内存的使用情况。
下面是脚本的样子
#!/bin/sh
#A script to log the cpu and memory usage of linux processes namely - redis, logstash, elasticsearch
我想编写一个python脚本来对运行在linux服务器上的远程进程执行一些非常简单的“无代理”监视。
它将在psuedocode中执行以下任务:
for each remoteIPAddress in listOfIPAddresses:
log into server@remoteIPAddress via ssh
execute the equivalent of a 'ps -ef' command
grep the result to make sure a particular process (by name) is still runnin
我有一个愚蠢的sendmail aliases.local文件设置,以传递电子邮件,以获得邮件。这是一个建立在古代Solaris系统上的装置。现在,我正在RHEL6系统上运行它:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
所以我有这个/etc/mail/alias.local文件:
users-log: "|/usr/bin/procmail /auto/data/users/logs/.procmailrc"
/auto/data/user/log/..p