commit - a5c4099f58fd6d1de0a9ae3333c92bcaeb35c6c7
commit + d6cb721e8a449107c61c7176d67f647e63976284
blob - a42eb1b43812bcadeb82b4c5f4f2587e34d58791
blob + 72fe4d5e4ae521e74af8384752843fd9b4c3f227
--- cores.sh
+++ cores.sh
#!/bin/sh
#
-# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
RRA:MAX:0.5:1:20000
fi
-snmpctl snmp walk ${HOST} community ${COMMUNITY} oid hrProcessorLoad | cut -d= -f2 > ${CPUINFO}
+snmp walk -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 - a8e88462631bc4924cf0993d500620ebdba684b6
blob + be4731c04802600943100a21bc992b019be099c0
--- cpu_load.sh
+++ cpu_load.sh
#!/bin/sh
#
-# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
RRA:MAX:0.5:1:20000
fi
-snmpctl snmp walk ${HOST} community ${COMMUNITY} oid hrProcessorLoad | cut -d= -f2 > ${CPUINFO}
+snmp walk -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 - e75f05682d22961548fa0bede0d570d5f9dc472b
blob + 2fac40387e9e01c3c544ba4e4e6d51098b8982af
--- interface.sh
+++ interface.sh
#!/bin/sh
#
-# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# 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: snmpctl snmp walk <host> community public oid ifDescr
+# Get list of interfaces with: snmp walk -c public <host> ifDescr
#
test -n "$1" || exit 1
test -n "$2" || exit 1
RRA:MAX:0.5:288:797
fi
-IN=$(snmpctl snmp get ${HOST} community ${COMMUNITY} oid ifInOctets.${INTERFACE} | cut -d= -f2)
-OUT=$(snmpctl snmp get ${HOST} community ${COMMUNITY} oid ifOutOctets.${INTERFACE} | cut -d= -f2)
-DESCR=$(snmpctl snmp get ${HOST} community ${COMMUNITY} oid ifDescr.${INTERFACE} | cut -d= -f2 | tr -d '"')
+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}')
${RRDTOOL} update ${RRDFILES}/${HOST}-${INTERFACE}.rrd N:${IN}:${OUT}
blob - 3e4446989b7f7ca6936d2ce634021d1c3cd79b04
blob + 312297087c634da67044e121b87b6b7146c01d30
--- ticks.sh
+++ ticks.sh
#!/bin/sh
#
-# Copyright (c) 2019 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
HOST="s1.obsda.ms"
+COMMUNITY="public"
#15259107187 / 8640000 = days (+remainder) = 176.6107855324074
#0.6107855324074 * 24 = hours (+remainder) = 14.65885277777778
#0.53116666666667 * 60 = seconds.milliseconds = 31.87
echo
-TICKS=$(snmpctl snmp get ${HOST} oid hrSystemUptime.0 | cut -d= -f2)
+TICKS=$(snmp get -c ${COMMUNITY} ${HOST} hrSystemUptime.0 | awk -F"[()]" '{print $2}')
echo "TICKS: $TICKS"
TICKS="1193085988"
blob - e57e4cc8c0855eb72e5dda9098aaaed056ae834c
blob + e6a57c4bb4a28944cda06e4ab412780a2328caa8
--- uptime.sh
+++ uptime.sh
#!/bin/sh
#
-# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
UPTIMEINFO="/tmp/${HOST}-uptime.txt"
rm -rf ${UPTIMEINFO}
-TICKS=$(snmpctl snmp get ${HOST} community ${COMMUNITY} oid hrSystemUptime.0 | cut -d= -f2)
+TICKS=$(snmp get -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 - 76489f8b7149f33ecc16a0c42f0482042156c681
blob + ac539f26d0cc98215a96ae80932e5d04516dfb28
--- version.sh
+++ version.sh
#!/bin/sh
#
-# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
COMMUNITY="public"
VERSIONINFO="/tmp/${HOST}-version.txt"
-snmpctl snmp get ${HOST} community ${COMMUNITY} oid sysDescr.0 | awk '{print $3,$4}' > ${VERSIONINFO}
+snmp get -c ${COMMUNITY} ${HOST} sysDescr.0 | awk '{print $6,$7}' > ${VERSIONINFO}
blob - 7a41e8f7341a83162867b7c9c99035f723c3d8ca
blob + 411fe8cc4edd718cd195b4050f65d3a0b95c4894
--- wrapper.sh
+++ wrapper.sh
#
#*/5 * * * * -n /home/mischa/rrdtool/wrapper.sh
#
-HOSTS="12 2"
+HOSTS="14 1"
SCRIPTS="/home/mischa/rrdtool"
for i in $(jot ${HOSTS}); do
done
wait
-${SCRIPTS}/interface.sh s1.obsda.ms 12 &
-${SCRIPTS}/interface.sh s2.obsda.ms 6 &
-${SCRIPTS}/interface.sh s3.obsda.ms 12 &
+${SCRIPTS}/interface.sh s1.obsda.ms 8 &
+${SCRIPTS}/interface.sh s2.obsda.ms 8 &
+${SCRIPTS}/interface.sh s3.obsda.ms 8 &
${SCRIPTS}/interface.sh s4.obsda.ms 12 &
${SCRIPTS}/interface.sh s5.obsda.ms 12 &
${SCRIPTS}/interface.sh s6.obsda.ms 12 &
${SCRIPTS}/interface.sh s11.obsda.ms 12 &
${SCRIPTS}/interface.sh s12.obsda.ms 8 &
${SCRIPTS}/interface.sh s13.obsda.ms 8 &
-#${SCRIPTS}/interface.sh s14.obsda.ms 8 &
+${SCRIPTS}/interface.sh s14.obsda.ms 9 &