I (noob) have been tinkering trying to ignore snapshot mounts which have dynamic paths.
Even using the -A and fairly certain my regex line for my -i option is correct, nothing seems to work. Meaning, tried various wildcards, etc, but it’s as if the regex part of this is truly being ignored.
If regex101.com confirms there should be a match, but disk_check disregards any such pattern, where do I look next? I am simply running this on the host CLI since any attempts in director seemed futile (and may be missing a mapped field somewhere), so shouldn’t it work “locally” or manually first before dealing with director foo?
thanks
Hello paddlefaster,
Quick answer to your question: yes, it should first locally work in command-line mode.
For further help, could you share:
- the OS version
- the check_disk version
- the output of the mount command
- the list of snapshot mounts you want to exclude
- the check_disk command you are currently using
- the output of the check_disk command above
Thank you,
Jean
Hi Jean,
RHEL 8.10
check_disk v2.4.9
The outputs of mount and others, I’m omitting excess info to be clear and considerate. There are 3 mounts which are normally checked fine and pertain to the snaps:
mount |egrep ‘/opt/cv|ddb’
/dev/mapper/app–index-app on /opt/cv type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/ddb1-ddb on /opt/cv/ddb1 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/ddb2-ddb on /opt/cv/ddb2 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=64k,sunit=128,swidth=128,noquota)
Those are normally around. When the snaps occur, these will be created with dynamic names and want to ignore:
/dev/mapper/ddb1-DDBSnap_3073410075 on /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073410075 type xfs (ro,relatime,seclabel,nouuid,norecovery,attr2,inode64,logbufs=8,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/ddb2-DDBSnap_3073413773 on /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073413773 type xfs (ro,relatime,seclabel,nouuid,norecovery,attr2,inode64,logbufs=8,logbsize=64k,sunit=128,swidth=128,noquota)
check minus extraneous things:
check_disk ‘-c’ ‘5%’ ‘-w’ ‘10%’ -A (blah -X and -x things) -i ‘/opt/cv/commvault/iDataAgent64/jobResults/2/\d+/DDB_SNAPSHOTS’
and the output minus the blah blah
DISK OK - free space: /opt/cv 71259 MiB (92.83% inode=100%); /opt/cv/ddb1 79961 MiB (12.01% inode=100%); /opt/cv/ddb2 82397 MiB (12.38% inode=100%); /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073410075 84632 MiB (12.72% inode=100%); /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073413773 87068 MiB (13.08% inode=100%);| /opt/cv=5503MiB;69085;72923;0;76762 /opt/cv/ddb1=585388MiB;598815;632082;0;665350 /opt/cv/ddb2=582952MiB;598815;632082;0;665350 /opt/cv/ic=293907MiB;690862;729243;0;767625 /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073410075=580717MiB;598815;632082;0;665350 /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3073413773=578281MiB;598815;632082;0;665350
I have tried numerous forms of that -i path including escape 's, forms of “\d+” and wildcard * approaches. I originally thought I could just tell it to ignore /DDB_SNAPSHOTS/ as that seems obvious, but no luck.
thanks!
Have you tried just:
check_disk -c '5%' -w '10%' -A (blah -X and -x things) -i 'DDB_SNAPSHOTS'
Instead of filtering out, I would first try to filter in, like:
check_disk -c '5%' -w '10%' -r 'DDB_SNAPSHOTS'
and ensure I can capture just the disks I will want to filter out afterwards.
My two cents,
Jean
yes, those fail, oddly enough I did prove that if I simply use the preceding path “up to” the dynamic portion, it works. For example -i ‘/opt/cv/commvault/iDataAgent64/2/’ (works)
What I read as regex though I think should include such string as 'DDB_SNAPSHOTS", correct?
thanks
Yes, correct…
![]()
Would you mind sharing the output and return code of
/usr/lib64/nagios/plugins/check_disk '-c' '5%' '-w' '10%' -R 'DDB_SNAPSHOTS'
I wonder if this would be capturing anything…
that works (if/when the snapshots are present).
DISK OK - free space: /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3142435406 73899 MiB (11.10% inode=100%); /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3142440580 76338 MiB (11.47% inode=100%);| /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3142435406=591450MiB;612122;632082;0;665350 /opt/cv/commvault/iDataAgent64/jobResults/2/872/DDB_SNAPSHOTS/DDBSnap_3142440580=589011MiB;612122;632082;0;665350
The reason trying to ignore these is the check (from director) gets a permission denied when it pokes it, but, seems like we’re getting closer. With that variable added to the existing check it fails when they aren’t there.
thanks
Hi folks. AI says the check_disk plugin doesn’t support “full” regex matching, so, can anyone shed some light on this issue since it still exists. Maybe a wrapper is a solution, but seems messy unless that’s the only way forward.
UPDATE though - I think this is busted internal to our director and the defaults, etc. Out of date stuff and I think the regex is to blame. I will update this if we make progress on it. The manual check on the CLI using the basic -i method does indeed run fine, just not the automated runs.
thanks
Disclosure: I work at Linuxfabrik. If you would rather not fight POSIX ERE quoting inside Director at all, our disk-usage might be an alternative.
I finally figured out that the problem wasn’t my regex but in how the fields were being populated, or should I say, the variable (disk_regex_ignore) I was trying to use was defunct. I had to add the proper variable into the director and then it just worked. Essentially I couldn’t clearly see why no matter what I entered as the regex, it never ever actually made it into the cmd so once I studied the name vs variable logic long enough, decided to add disk_ignore_ereg_path and that was the ticket. thanks all