bundles/zfs: import bundle from work repository
This commit is contained in:
parent
b690ae25b0
commit
4934eb46fb
11 changed files with 841 additions and 0 deletions
26
bundles/zfs/files/check_zfs_volumes
Normal file
26
bundles/zfs/files/check_zfs_volumes
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
# Written by jpaul, 2017-03
|
||||
# Extended by El Pinguino, 2017-07
|
||||
|
||||
<%
|
||||
datasetlist = sorted(node.metadata.get('zfs', {}).get('datasets', {}).items())
|
||||
volumes = []
|
||||
for dataset, options in datasetlist:
|
||||
if options.get('mountpoint', 'none') != 'none':
|
||||
volumes.append(dataset)
|
||||
%>\
|
||||
|
||||
exitcode=0
|
||||
% for volume in volumes:
|
||||
if [[ "$(zfs get -Hp -o value mounted '${volume}')" != "yes" ]]
|
||||
then
|
||||
echo 'CRITICAL - ${volume} not mounted'
|
||||
exitcode=2
|
||||
fi
|
||||
% endfor
|
||||
|
||||
if (( exitcode == 0 ))
|
||||
then
|
||||
echo OK
|
||||
fi
|
||||
exit $exitcode
|
Loading…
Add table
Add a link
Reference in a new issue