mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Update backuppc plugin, fix issues with hostnames with dot(s) (.)
We encountered an issue where the hostnames in backuppc had also the domain/subdomain names. As dots are not allowed in munin datasource names we had to fix the backuppc script. Ours is as above, you can find the explanation for clear_fieldnames at : http://munin-monitoring.org/wiki/notes_on_datasource_names.
This commit is contained in:
parent
42aa1e1854
commit
58c0038473
1 changed files with 10 additions and 8 deletions
|
@ -11,6 +11,8 @@
|
||||||
PCDIR=${pcdir:-"/var/lib/BackupPC/pc"}
|
PCDIR=${pcdir:-"/var/lib/BackupPC/pc"}
|
||||||
HOSTS=$(cd ${PCDIR} 2>/dev/null && ls -1)
|
HOSTS=$(cd ${PCDIR} 2>/dev/null && ls -1)
|
||||||
|
|
||||||
|
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
[ ! -z "${HOSTS}" ] && echo "yes" && exit 0
|
[ ! -z "${HOSTS}" ] && echo "yes" && exit 0
|
||||||
echo "no"
|
echo "no"
|
||||||
|
@ -26,8 +28,8 @@ if [ "$1" = "config" ]; then
|
||||||
|
|
||||||
for h in ${HOSTS}
|
for h in ${HOSTS}
|
||||||
do
|
do
|
||||||
echo "${h}_full.label ${h} Full"
|
echo "$(clean_fieldname ${h})_full.label $(clean_fieldname ${h}) Full"
|
||||||
echo "${h}_incr.label ${h} Incr"
|
echo "$(clean_fieldname ${h})_incr.label $(clean_fieldname ${h}) Incr"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "multigraph backuppc_ages"
|
echo "multigraph backuppc_ages"
|
||||||
|
@ -38,8 +40,8 @@ if [ "$1" = "config" ]; then
|
||||||
|
|
||||||
for h in ${HOSTS}
|
for h in ${HOSTS}
|
||||||
do
|
do
|
||||||
echo "${h}_full.label ${h} Full"
|
echo "$(clean_fieldname ${h})_full.label $(clean_fieldname ${h}) Full"
|
||||||
echo "${h}_incr.label ${h} Incr"
|
echo "$(clean_fieldname ${h})_incr.label $(clean_fieldname ${h}) Incr"
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -49,18 +51,18 @@ echo "multigraph backuppc_sizes"
|
||||||
for h in $HOSTS
|
for h in $HOSTS
|
||||||
do
|
do
|
||||||
SIZE=$(awk '/full/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
|
SIZE=$(awk '/full/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
|
||||||
echo "${h}_full.value $SIZE"
|
echo "$(clean_fieldname ${h})_full.value $SIZE"
|
||||||
SIZE=$(awk '/incr/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
|
SIZE=$(awk '/incr/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
|
||||||
echo "${h}_incr.value $SIZE"
|
echo "$(clean_fieldname ${h})_incr.value $SIZE"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "multigraph backuppc_ages"
|
echo "multigraph backuppc_ages"
|
||||||
for h in $HOSTS
|
for h in $HOSTS
|
||||||
do
|
do
|
||||||
SIZE=$(awk '/full/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
|
SIZE=$(awk '/full/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
|
||||||
echo "${h}_full.value $SIZE"
|
echo "$(clean_fieldname ${h})_full.value $SIZE"
|
||||||
SIZE=$(awk '/incr/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
|
SIZE=$(awk '/incr/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
|
||||||
echo "${h}_incr.value $SIZE"
|
echo "$(clean_fieldname ${h})_incr.value $SIZE"
|
||||||
done
|
done
|
||||||
|
|
||||||
<<'__END__'
|
<<'__END__'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue