Projet

Général

Profil

Révision 58c00384

ID58c00384737b7033bbd22f4b8a4acd65993e24ed
Parent 42aa1e18
Enfant 0cef46c0

Ajouté par delinuxspecialist il y a environ 12 ans

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.

Voir les différences:

plugins/backuppc/backuppc
11 11
PCDIR=${pcdir:-"/var/lib/BackupPC/pc"}
12 12
HOSTS=$(cd ${PCDIR} 2>/dev/null && ls -1)
13 13

  
14
. $MUNIN_LIBDIR/plugins/plugin.sh
15

  
14 16
if [ "$1" = "autoconf" ]; then
15 17
	[ ! -z "${HOSTS}" ] && echo "yes" && exit 0
16 18
	echo "no"
......
26 28

  
27 29
	for h in ${HOSTS}
28 30
	do
29
		echo "${h}_full.label ${h} Full"
30
		echo "${h}_incr.label ${h} Incr"
31
		echo "$(clean_fieldname ${h})_full.label $(clean_fieldname ${h}) Full"
32
		echo "$(clean_fieldname ${h})_incr.label $(clean_fieldname ${h}) Incr"
31 33
	done
32 34

  
33 35
	echo "multigraph backuppc_ages"
......
38 40

  
39 41
	for h in ${HOSTS}
40 42
	do
41
		echo "${h}_full.label ${h} Full"
42
		echo "${h}_incr.label ${h} Incr"
43
		echo "$(clean_fieldname ${h})_full.label $(clean_fieldname ${h}) Full"
44
		echo "$(clean_fieldname ${h})_incr.label $(clean_fieldname ${h}) Incr"
43 45
	done
44 46

  
45 47
	exit 0
......
49 51
for h in $HOSTS
50 52
do
51 53
	SIZE=$(awk '/full/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
52
	echo "${h}_full.value $SIZE"
54
	echo "$(clean_fieldname ${h})_full.value $SIZE"
53 55
	SIZE=$(awk '/incr/ { size = $6 } END { print size; }' ${PCDIR}/${h}/backups)
54
	echo "${h}_incr.value $SIZE"
56
	echo "$(clean_fieldname ${h})_incr.value $SIZE"
55 57
done
56 58

  
57 59
echo "multigraph backuppc_ages"
58 60
for h in $HOSTS
59 61
do
60 62
	SIZE=$(awk '/full/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
61
	echo "${h}_full.value $SIZE"
63
	echo "$(clean_fieldname ${h})_full.value $SIZE"
62 64
	SIZE=$(awk '/incr/ { age = systime() - $3 } END { print age / 3600 / 24; }' ${PCDIR}/${h}/backups)
63
	echo "${h}_incr.value $SIZE"
65
	echo "$(clean_fieldname ${h})_incr.value $SIZE"
64 66
done
65 67

  
66 68
<<'__END__'

Formats disponibles : Unified diff