file="$1"
needle="$2"
- pos="$3"
perl -e '
undef $/;
- $i = index(<>, "'"$needle"'", '"$pos"');
- if ($i < 0) {
- exit 1;
- };
- print $i,"\n"' < "$file"
+ $i = 0; $k=<>;
+ while (($i = index($k, "'"$needle"'", $i)) >= 0) {
+ print $i++,"\n";
+ }; ' < "$file"
}
get_avail() {
header="$2"
filter="$3"
hdroff="$4"
- nextoff=0
-
- while : ; do
- off=`get_offset "$image" $header $nextoff`
- local ret="$?"
- if [ "$ret" != 0 ]; then
- # not found, exit
- return 1
- fi
+ get_offset "$image" $header | head -n 5 | while read off; do
(if [ "$off" != 0 ]; then
dd ibs="$((off+hdroff))" skip=1 count=0
fi &&
dd bs=512k) < "$image" 2>/dev/null | $filter 2>/dev/null
- nextoff=$((off + 1))
done
- return 0
}
get_image_linux() {
* dsa-check-hpasm: Support supplying a list of things for which failures are
ignored.
* dsa-check-soas: do some queries without RD set.
+ * dsa-check-running-kernel: in cat_vmlinux(), only consider the first 5 hits
+ for the magic start sequence. This makes running times bearable on our
+ new octeons.
[ Hendrik Köhler ]
* Extend dsa-check-entropy output so Icinga2 can process performance
data (e.g. used by Graphite).
- -- Peter Palfrader <weasel@debian.org> Sat, 11 Oct 2014 09:43:01 +0200
+ -- Peter Palfrader <weasel@debian.org> Wed, 05 Nov 2014 14:57:51 +0100
dsa-nagios-checks (100) unstable; urgency=low