Checkfilesize wildcard in filepath
Posted: Wed Dec 03, 2014 4:08 pm
Hello Nagios forums,
I am trying to implement a pretty simple check to see if a file exists with the name "test-***" where *** will be any random numbers and/or letters. I have tried several combos in Nagios including:
checkfilesize -a D:/downloads/test1/test-% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-%%% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$%%% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$* --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$*** --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-* --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-*** --nodatamode -c _ItemCount=1:
but none will match the file named "test-123". Obviously if I hardcode the numbers into the check, it works as intended, but these numbers will constantly be changing. Does anyone know how I can use a wildcard in the filepath for this check?
Thank you
I am trying to implement a pretty simple check to see if a file exists with the name "test-***" where *** will be any random numbers and/or letters. I have tried several combos in Nagios including:
checkfilesize -a D:/downloads/test1/test-% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-%%% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$%%% --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$* --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-$*** --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-* --nodatamode -c _ItemCount=1:
checkfilesize -a D:/downloads/test1/test-*** --nodatamode -c _ItemCount=1:
but none will match the file named "test-123". Obviously if I hardcode the numbers into the check, it works as intended, but these numbers will constantly be changing. Does anyone know how I can use a wildcard in the filepath for this check?
Thank you