2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

[debsecan] Use temp filename rather than PID-derived

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
Olivier Mehani 2016-09-01 10:50:00 +10:00
parent d0a837056f
commit 87f5a74ec8

View File

@ -59,11 +59,12 @@ EOF_
exit 0
fi
debsecan 2> /dev/null > /tmp/debsecan.munin.$$
high=`grep -c 'high urgency' /tmp/debsecan.munin.$$`
medium=`grep -c 'medium urgency' /tmp/debsecan.munin.$$`
low=`grep -c 'low urgency)' /tmp/debsecan.munin.$$`
other=`grep -c -v -e 'low urgency' -e 'medium urgency' -e 'high urgency' /tmp/debsecan.munin.$$`
OUT=`mktemp -t debescan.XXXXXX`
debsecan 2> /dev/null > ${OUT}
high=`grep -c 'high urgency' ${OUT}`
medium=`grep -c 'medium urgency' ${OUT}`
low=`grep -c 'low urgency)' ${OUT}`
other=`grep -c -v -e 'low urgency' -e 'medium urgency' -e 'high urgency' ${OUT}`
cat <<EOF_
high.value $high
medium.value $medium
@ -71,4 +72,4 @@ low.value $low
other.value $other
EOF_
rm -f /tmp/debsecan.munin.$$
rm -f ${OUT}