commit ae63ed124123f565076daf777a1c731b1e5579a6 from: mischa date: Mon Oct 18 06:48:30 2021 UTC added explicit -v2c for new version of snmp commit - bff89b27881d536f575423a24da7d11522d83345 commit + ae63ed124123f565076daf777a1c731b1e5579a6 blob - 72fe4d5e4ae521e74af8384752843fd9b4c3f227 blob + 8c60997c76bf9ae5b8f6033912122c814ffe07b1 --- cores.sh +++ cores.sh @@ -45,7 +45,7 @@ ${RRDTOOL} create ${RRDFILES}/${HOST}-cores.rrd \ RRA:MAX:0.5:1:20000 fi -snmp walk -c ${COMMUNITY} ${HOST} hrProcessorLoad | awk '{print $4}' > ${CPUINFO} +snmp walk -v2c -c ${COMMUNITY} ${HOST} hrProcessorLoad | awk '{print $4}' > ${CPUINFO} CORES=$(cat ${CPUINFO} | wc -l) ACT_CORES=$((${CORES}/2)) CPU_LOAD=$(cat ${CPUINFO} | paste -s -d: - | cut -d: -f1-${ACT_CORES}) blob - be4731c04802600943100a21bc992b019be099c0 blob + 8f5ebdb78add7b4fcc021b7e2ce53692efa4076d --- cpu_load.sh +++ cpu_load.sh @@ -35,7 +35,7 @@ ${RRDTOOL} create ${RRDFILES}/${HOST}-cpu.rrd \ RRA:MAX:0.5:1:20000 fi -snmp walk -c ${COMMUNITY} ${HOST} hrProcessorLoad | awk '{print $4}' > ${CPUINFO} +snmp walk -v2c -c ${COMMUNITY} ${HOST} hrProcessorLoad | awk '{print $4}' > ${CPUINFO} CORES=$(grep -cv "^0$" ${CPUINFO}) CPU_LOAD_SUM=$(awk '{sum += $1} END {print sum}' ${CPUINFO}) CPU_LOAD=$(echo "scale=2; ${CPU_LOAD_SUM}/${CORES}" | bc -l) blob - 24807a2b3ca1eae31d2a64551759030336a81822 blob + 3ce244ca4c4864b2835aee9c6885f521ccb49bb7 --- ifdescr.sh +++ ifdescr.sh @@ -14,10 +14,10 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -# Get list of interfaces with: snmp walk -c public ifDescr +# Get list of interfaces with: snmp walk -v2c -c public ifDescr # test -n "$1" || exit 1 HOST="$1" COMMUNITY="public" -snmp walk -c ${COMMUNITY} ${HOST} ifDescr +snmp walk -v2c -c ${COMMUNITY} ${HOST} ifDescr blob - 2fac40387e9e01c3c544ba4e4e6d51098b8982af blob + 4056dea9863c02b42d0966ac1097cab23a81b15e --- interface.sh +++ interface.sh @@ -14,7 +14,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -# Get list of interfaces with: snmp walk -c public ifDescr +# Get list of interfaces with: snmp walk -v2c -c public ifDescr # test -n "$1" || exit 1 test -n "$2" || exit 1 @@ -46,9 +46,9 @@ ${RRDTOOL} create ${RRDFILES}/${HOST}-${INTERFACE}.rrd RRA:MAX:0.5:288:797 fi -IN=$(snmp walk -c ${COMMUNITY} ${HOST} ifInOctets.${INTERFACE} | awk '{print $4}') -OUT=$(snmp walk -c ${COMMUNITY} ${HOST} ifOutOctets.${INTERFACE} | awk '{print $4}') -DESCR=$(snmp walk -c ${COMMUNITY} ${HOST} ifDescr.${INTERFACE} | awk '{print $4}') +IN=$(snmp walk -v2c -c ${COMMUNITY} ${HOST} ifInOctets.${INTERFACE} | awk '{print $4}') +OUT=$(snmp walk -v2c -c ${COMMUNITY} ${HOST} ifOutOctets.${INTERFACE} | awk '{print $4}') +DESCR=$(snmp walk -v2c -c ${COMMUNITY} ${HOST} ifDescr.${INTERFACE} | awk '{print $4}') ${RRDTOOL} update ${RRDFILES}/${HOST}-${INTERFACE}.rrd N:${IN}:${OUT} blob - 312297087c634da67044e121b87b6b7146c01d30 blob + 9102419318d0191ba4d594f0d62b60307c9cd291 --- ticks.sh +++ ticks.sh @@ -23,7 +23,7 @@ COMMUNITY="public" #0.53116666666667 * 60 = seconds.milliseconds = 31.87 echo -TICKS=$(snmp get -c ${COMMUNITY} ${HOST} hrSystemUptime.0 | awk -F"[()]" '{print $2}') +TICKS=$(snmp get -v2c -c ${COMMUNITY} ${HOST} hrSystemUptime.0 | awk -F"[()]" '{print $2}') echo "TICKS: $TICKS" TICKS="1193085988" blob - e6a57c4bb4a28944cda06e4ab412780a2328caa8 blob + 05ca76f7cc91b339bb26db73d602af9b2a4c64ba --- uptime.sh +++ uptime.sh @@ -20,7 +20,7 @@ COMMUNITY="public" UPTIMEINFO="/tmp/${HOST}-uptime.txt" rm -rf ${UPTIMEINFO} -TICKS=$(snmp get -c ${COMMUNITY} ${HOST} hrSystemUptime.0 | awk -F"[()]" '{print $2}') +TICKS=$(snmp get -v2c -c ${COMMUNITY} ${HOST} hrSystemUptime.0 | awk -F"[()]" '{print $2}') DAYS=$(echo "${TICKS}/8640000" | bc -l) HOURS=$(echo "0.${DAYS##*.} * 24" | bc -l) MINUTES=$(echo "0.${HOURS##*.} * 60" | bc -l) blob - ac539f26d0cc98215a96ae80932e5d04516dfb28 blob + e1692cfef2edf43c05ece52bc21fe2092112279b --- version.sh +++ version.sh @@ -19,4 +19,4 @@ HOST="$1" COMMUNITY="public" VERSIONINFO="/tmp/${HOST}-version.txt" -snmp get -c ${COMMUNITY} ${HOST} sysDescr.0 | awk '{print $6,$7}' > ${VERSIONINFO} +snmp get -v2c -c ${COMMUNITY} ${HOST} sysDescr.0 | awk '{print $6,$7}' > ${VERSIONINFO}