summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-04-26 21:14:05 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-04-26 21:15:09 +0200
commit15572ce3a023ea3c6093dc595107564a7f35d7cb (patch)
treea78468d3346db0a99edc47ec7ff92221ba340b20 /extras
parent2565aed0f14ec1f1814798489aad4478f96a300d (diff)
munin-plugin: return 0 instead of NULL
munin can't graph NULL Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'extras')
-rw-r--r--extras/munin/filebin_stats4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/munin/filebin_stats b/extras/munin/filebin_stats
index f638ecc4b..f7e3bbeac 100644
--- a/extras/munin/filebin_stats
+++ b/extras/munin/filebin_stats
@@ -19,7 +19,7 @@ EOM
esac
echo -n "used.value "
-mysql $mysqlopts -sr $database <<<"select sum(filesize) as 'Used storage' from (select filesize from files group by hash) a;" || echo "a"
+mysql $mysqlopts -sr $database <<<"select coalesce(sum(filesize), 0) as 'Used storage' from (select filesize from files group by hash) a;" || echo "a"
echo -n "dedup.value "
-mysql $mysqlopts -sr $database <<<"select sum((c - 1) * sub.filesize) 'Space saved by deduplication' from (select hash, filesize, count(*) c from files group by hash having c > 1 order by c) sub;" || echo "a"
+mysql $mysqlopts -sr $database <<<"select coalesce(sum((c - 1) * sub.filesize), 0) 'Space saved by deduplication' from (select hash, filesize, count(*) c from files group by hash having c > 1 order by c) sub;" || echo "a"