mirror of
https://github.com/m8tin/cis.git
synced 2026-08-01 11:47:31 +02:00
Fixed generic monitor check ZFS_POOL_CHECK
This commit is contained in:
@@ -5,7 +5,7 @@ base.loadModule ssh
|
||||
|
||||
|
||||
function testPool(){
|
||||
local _RESPONSE=$(ssh.onHostRun "monitoring@${1:?"Missing REMOTE_HOST"}" 'zpool status ${_ZFS_POOL} | grep -F scrub')
|
||||
local _RESPONSE=$(ssh.onHostRun "monitoring@${1:?"Missing REMOTE_HOST"}" "zpool status ${2:?"Missing REMOTE_POOL"} | grep -F scrub")
|
||||
local _RESULT=$(echo "${_RESPONSE}" | grep -F 'scrub repaired 0B' | grep -F '0 errors')
|
||||
_RESULT="${_RESULT#*on}" #Removes shortest matching pattern '*on' from the begin
|
||||
|
||||
@@ -18,6 +18,7 @@ function testPool(){
|
||||
}
|
||||
|
||||
base.set REMOTE_HOST "${1:?"FQDN of server missing: e.g. host.example.net[:port]"}" '^([a-zA-Z0-9][a-zA-Z0-9.-]*)+(:[0-9]+)?$'
|
||||
testPool "${REMOTE_HOST}" && exit 0
|
||||
base.set REMOTE_POOL "${2:?"Missing name of zpool: e.g. zpool1"}" '^[a-zA-Z0-9_-]+$'
|
||||
testPool "${REMOTE_HOST}" "${REMOTE_POOL}" && exit 0
|
||||
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user