首页 > 代码库 > linux 下监控keepalived进程

linux 下监控keepalived进程

ps -ef | grep  "keepalived" | grep -v grep | awk ‘{print $2}‘| wc -l

ps -ef                               显示所有进程

grep "keepalived"           显示包含“keepalived”的行

grep -v grep                   排除显示包含grep的行

awk ‘{print $2}‘               按需要筛选文本,本例是显示第二列(可选)

wc -l                                统计行数



linux 下监控keepalived进程