Skip to main content
Solved

Regex on CMA Windows filter filesystem

  • March 4, 2025
  • 2 replies
  • 66 views

Forum|alt.badge.img+2

Hello,

I’m trying to monitor C:\ disk only on Windows with the filesystem filter option (CMA 24.10.4).

Following Windows Centreon Monitoring Agent | Centreon Documentation I tested with C:\.* and got this restult : 

Fail to execute {"check":"storage", "args":{ "warning" : "80", "critical" : "90", "filter-storage-type" : ".*", "filter-fs" : "C:\.*"}} : The system cannot find the file specified

Following How to play with Regex - Part I | Community I tested with ^C:\$ and got this result : 

Fail to execute {"check":"storage", "args":{ "warning" : "80", "critical" : "90", "filter-storage-type" : ".*", "filter-fs" : "^C:\$"}} : The system cannot find the file specified

How does the regex interpreter work?

Thanks for your help

 

Best answer by christophe.niel

hello

: and \ are special char for regex

for windows disk, try

^C.*$

any disk starting whith C will match, normally you should have only 1

 

2 replies

Forum|alt.badge.img+17
  • Centreon Lord Commander
  • Answer
  • March 4, 2025

hello

: and \ are special char for regex

for windows disk, try

^C.*$

any disk starting whith C will match, normally you should have only 1

 


Forum|alt.badge.img+2
  • Author
  • Steward *
  • March 4, 2025

Thanks Christophe, it works.

I also successfully tested for C:\ and E:\ with this argument 

^[C,E].*$