Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
puppet-backupninja
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
puppet-backupninja
Commits
d56f1f08
Commit
d56f1f08
authored
Apr 17, 2015
by
Antoine Beaupré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add state to message
parent
795769c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
files/checkbackups.pl
files/checkbackups.pl
+3
-1
No files found.
files/checkbackups.pl
View file @
d56f1f08
...
...
@@ -34,6 +34,7 @@ my $STATE_WARNING=1;
my
$STATE_CRITICAL
=
2
;
my
$STATE_UNKNOWN
=
3
;
my
$STATE_DEPENDENT
=
4
;
my
%
ERRORS
=
(
0
=>
'
OK
',
1
=>
'
WARNING
',
2
=>
'
CRITICAL
',
3
=>
'
UNKNOWN
',
4
=>
'
DEPENDENT
');
# gross hack: we look into subdirs to find vservers
my
@vserver_dirs
=
qw{/var/lib/vservers /vservers}
;
...
...
@@ -117,10 +118,11 @@ sub check_age {
sub
print_status
{
my
(
$host
,
$state
,
$message
,
$service
)
=
@_
;
my
$state_msg
=
$ERRORS
{
$state
};
if
(
!
$service
)
{
$service
=
'
backups
';
}
printf
"
$host
\t
$service
\t
$state
\t
$message
\n
";
printf
"
$host
\t
$service
\t
$state
\t
$
state_msg
$
message
\n
";
}
sub
check_flag
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment