标签:nagios监控
#!/bin/bash Modify=$(stat /etc/shadow|awk NR==6‘{print $2,$3}‘|md5sum|awk ‘{print $1}‘) Change=$(stat /etc/shadow|awk NR==7‘{print $2,$3}‘|md5sum|awk ‘{print $1}‘) oldmd5=$(cat /tmp/shadow) newmd5=${Modify}${Change} if [ $newmd5 != $oldmd5 ];then echo passwd is changed exit 1 else echo passwd is ok echo ${Modify}${Change} > /tmp/shadow exit 0 fi
本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1676337
标签:nagios监控
原文地址:http://thedream.blog.51cto.com/6427769/1676337