From 29b5d1bd5c6ac8fe8b9b5e10d77335a74a5a6b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Sun, 12 May 2013 22:55:31 +0300 Subject: [PATCH] bacula: Added alert commands to tape device. --- bacula/manifests/init.pp | 4 ++++ bacula/templates/device.conf.erb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bacula/manifests/init.pp b/bacula/manifests/init.pp index 9d758ed..537d348 100644 --- a/bacula/manifests/init.pp +++ b/bacula/manifests/init.pp @@ -408,6 +408,10 @@ class bacula::storage($password = undef) { define bacula::device($device, $media) { include bacula::storage + require smart + package { "mtx": + ensure => installed, + } file { "/etc/bacula/bacula-sd.d/${name}.conf": ensure => present, diff --git a/bacula/templates/device.conf.erb b/bacula/templates/device.conf.erb index 546066e..eec5b4f 100644 --- a/bacula/templates/device.conf.erb +++ b/bacula/templates/device.conf.erb @@ -7,4 +7,6 @@ Device { AlwaysOpen = no; RemovableMedia = yes; RandomAccess = no; + Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert | cat'" + Alert Command = "sh -c 'smartctl -H -l error %c'" }