# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1390516268 -3600 # Node ID 92818898bb2c89993a166a2d16667b6e1283ad71 # Parent 3a7ef04681d695bdcb22a38e2d9e55ca80ac6109 [cosmetic] diff -r 3a7ef04681d6 -r 92818898bb2c debian/control --- a/debian/control Thu Jan 23 22:58:26 2014 +0100 +++ b/debian/control Thu Jan 23 23:31:08 2014 +0100 @@ -4,7 +4,7 @@ Package: nagios-plugin-amanda-client Section: misc Architecture: any -Depends: amanda-client (>= 3.0) +Depends: amanda-client (>= 3.0), libconst-fast-perl Description: nagios plugin do client side checks of the Amanda backup suite This is a nagios plugin. It checks triggers the Amanda client check for the current host and compares the DLE with the currenty mounted file systems. diff -r 3a7ef04681d6 -r 92818898bb2c plugins/check_amanda-client --- a/plugins/check_amanda-client Thu Jan 23 22:58:26 2014 +0100 +++ b/plugins/check_amanda-client Thu Jan 23 23:31:08 2014 +0100 @@ -11,9 +11,14 @@ use File::Find; use Carp; use Pod::Usage; +use Const::Fast; our $VERSION = '0.0.2'; +const my $NAME => 'AMANDA-CLIENT'; +const my $USER => 'backup'; +const my $CFDIR => '/etc/amanda'; + sub su; sub find_tool; sub check_perms; @@ -25,8 +30,6 @@ sub main; -my $NAME = 'AMANDA-CLIENT'; - sub ok; sub warning; sub critical; @@ -51,17 +54,9 @@ 'v|verbose' => \$opt_verbose, ) or pod2usage; - if ($opt_verbose) { - *::verbose = sub { say '# ', @_ } - } - else { - *::verbose = sub { } - } + *::verbose = $opt_verbose ? sub { say '# ', @_ } : sub { }; # test needs to be run as root:* or as backup:backup - my $USER = 'backup'; - my $CFDIR = '/etc/amanda'; - # change to backup if still root su $USER if $> == 0;