CENTOS IFTOP 直接取有效网卡名称
因为Centos7 的网卡 不在默认使用eth(n) 使用iftop的时候 需要制定网卡 不太方便 所以使用这 […]
因为Centos7 的网卡 不在默认使用eth(n) 使用iftop的时候 需要制定网卡 不太方便 所以使用这 […]
懒惰
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
#!/bin/bash # created by "XXB" on idclayer.com # SNMP Installer Projects service snmpd stop echo "Please enter Server Location: " echo "Like DC,City,Country" read LOC echo "Location: $LOC" yum -y install net-snmp net-snmp-devel net-snmp-utils mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf_$(date +"%N").bak echo -n " rocommunity oooo 1.1.1.1 view all included .1 80 syslocation $LOC syscontact Matt<support######idclayer.com> extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro ">> /etc/snmp/snmpd.conf #/etc/snmp/snmpd.conf service snmpd start chkconfig snmpd on #回调 使用CURL请求监控API接口 自动添加监控目标 IP=$(host $(uname -n) | grep "address" | grep -v "IPv6" | head -n 1 | awk '{print $4}') echo "Server IP is $IP" RESULT=`curl -s "http://www.test.com/add?ip=$IP" | grep -o -E "adderror|pingerror"` echo $RESULT; # ./add_device.php ip nnn v2c echo "Dot forget open IPTables 161 UDP Port!!!" |