所有内容来自笔者平时总结和朋友们共享的面试题内容,欢迎留言添加新知识
<———————————————————————————————————>
------------------snmp v3 客服端脚本 ------------------------------------
#!/bin/bash
mypasswd=`ifconfig | awk -F: '/inet addr/{print $2}'| awk '{if(NR==1) print $1 }'`
rpm -ql snmp
[ $? -eq 0 ] ||    yum install net-snmp net-snmp-devel net-snmp-utils -y
net-snmp-config --create-snmpv3-user -ro -A snmp@$mypasswd -a MD5 jiankongbao
echo $mypasswd
service snmpd restart
#!/bin/bash
getenforce | grep    Enforcing
        if [ $? -eq 0 ];then
                sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
setenforce 0
        fi
mypasswd=` ifconfig | awk -F: '/inet addr/{print $2}'| awk '{if(NR==1) print $1 }' | md5sum | head -c32; echo`
rpm -ql snmp
[ $? -eq 0 ] ||    yum install net-snmp net-snmp-devel net-snmp-utils -y
service snmpd stop
net-snmp-config --create-snmpv3-user -ro -A snmp@$mypasswd -a MD5 jiankongbao
echo snmp@$mypasswd
service snmpd restart
snmpwalk -v 3 -u jiankongbao -a MD5 -A "snmp@$mypasswd" -l authNoPriv 127.0.0.1 sysDescr
[ $? -eq 0 ] && echo "snmp is ok"
chkconfig  snmpd on
------------------清空linux buffer cache------------------
sync && echo 3 > /proc/sys/vm/drop_caches

--------------linux 下文件查找命----------------------
linux下又两个命令用于查找文件: