Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
datadump
Commits
345a3f79
Commit
345a3f79
authored
Aug 27, 2019
by
Jonathan Schaeffer
Browse files
Zabbix error format
parent
0d1aedb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/resifdatadump
View file @
345a3f79
...
...
@@ -59,7 +59,7 @@ irods_push(){
if
[[
$s
-ne
0
]]
;
then
echo
"[
$KEY
] Error 002 creating remote directory."
format_report
$KEY
$SIZEMB
$(
date
+%Y-%m-%dT%H:%M:%S
)
- -
'Error 010. imkdir failed'
>>
$LOCAL_REPORT
zabbix_err
"
${
KEY
}
:
Error 002"
zabbix_err
"
${
KEY
}
Error 002"
return
1
fi
...
...
@@ -72,23 +72,23 @@ irods_push(){
irods_rollback
$KEY
rm
$RESIFDD_WORKDIR
/
${
KEY
}
.tar
# Alert to zabbix
zabbix_err
"
${
KEY
}
:
Error 011"
zabbix_err
"
${
KEY
}
Error 011"
else
duration
=
$((
$(
date
+%s
)
-
$start
))
throughput
=
$((
$SIZEMB
/
$duration
))
# Compute remote checksum
# Compute remote checksum
echo
"[
$KEY
] staging.tar data sent, let's compute remote checksum"
irods_sha
=
$(
ichksum
$KEY
/staging.tar |
awk
-F
':'
'/sha2:/ {print $2; exit;}'
)
echo
"[
$KEY
]
$irods_sha
"
if
[[
"
$SHA
"
=
"
$irods_sha
"
]]
;
then
echo
"[
$KEY
] checksums match, commit remote data"
echo
"[
$KEY
] checksums match, commit remote data"
format_report
$KEY
$SIZEMB
$(
date
+%Y-%m-%dT%H:%M:%S
--date
=
@
$start
)
$duration
$throughput
'OK'
>>
$LOCAL_REPORT
irods_commit
$KEY
zabbix_ok
"
$KEY
|
${
SIZEMB
}
MB|
${
duration
}
s|
${
throughput
}
MB/s"
else
echo
"[
$KEY
] Error 012, checksum mismatch"
zabbix_ok
"
$KEY
|
${
SIZEMB
}
MB|
${
duration
}
s|
${
throughput
}
MB/s"
else
echo
"[
$KEY
] Error 012, checksum mismatch"
zabbix_err
"
${
KEY
}
Error 012"
fi
fi
rm
$RESIFDD_WORKDIR
/
${
KEY
}
.
*
fi
# Send report to irods. Do some locking here
...
...
@@ -194,7 +194,7 @@ pack_and_send() {
echo
"[
$KEY
] Error 007 creating tar"
rm
-f
$RESIFDD_WORKDIR
/
$KEY
.tar
# Send key to zabbix_err
zabbix_err
"
$KEY
:
Error 007"
zabbix_err
"
$KEY
Error 007"
return
1
fi
local_sha
=
$(
sha256sum
$RESIFDD_WORKDIR
/
$KEY
.tar |
awk
'{print $1}'
| xxd
-r
-p
|
base64
)
...
...
@@ -302,7 +302,7 @@ if [[ "x$DUMP_METADATA" = "xyes" ]]; then
tar
cf
$RESIFDD_WORKDIR
/
$KEY
.tar
--exclude
portalproducts
-C
$SNAPSHOT_DIR
.
if
[[
$?
-ne
0
]]
;
then
echo
"[
$KEY
] Error 001 while creating tar archive."
zabbix_err
"
${
KEY
}
:
Error 001"
zabbix_err
"
${
KEY
}
Error 001"
exit
1
fi
local_sha
=
$(
sha256sum
$RESIFDD_WORKDIR
/
$KEY
.tar |
awk
'{print $1}'
| xxd
-r
-p
|
base64
)
...
...
Write
Preview
Supports
Markdown
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