define check_xi_ncpa output status using regex
Posted: Mon Jun 08, 2020 3:10 pm
I am attempting to use the check_xi_ncpa command to verify if a string exists when I query the api and then define what the output status should be if it does exist.
Current Check:
-t 'token' -P 5693 -M 'disk/logical/|data/opts'
Current Output:
OK: Opts was ['rw,nosuid,nodev,relatime,attr2,inode64,sunit=16,swidth=8192,noquota']
Is it possible to set the check options to return a Critical status if "nosuid" exists in the output? I am attempting to do some sort of match regex but no luck so far. Ideally if "nosuid" exists when running the check this is what the output would look like:
CRITICAL: Opts was ['rw,nosuid,nodev,relatime,attr2,inode64,sunit=16,swidth=8192,noquota']
Current Check:
-t 'token' -P 5693 -M 'disk/logical/|data/opts'
Current Output:
OK: Opts was ['rw,nosuid,nodev,relatime,attr2,inode64,sunit=16,swidth=8192,noquota']
Is it possible to set the check options to return a Critical status if "nosuid" exists in the output? I am attempting to do some sort of match regex but no luck so far. Ideally if "nosuid" exists when running the check this is what the output would look like:
CRITICAL: Opts was ['rw,nosuid,nodev,relatime,attr2,inode64,sunit=16,swidth=8192,noquota']