Check_mk Regex, Hostname with the same termination


(Gabriel Burich) #1

Hello i need a help.

I need apply a rule for all host with the same termination.

Capture

Example, the hosts are:

PC1_SYS_DATA,
ABC_SYS_DATA,
BLUE_SYS_DATA

I need apply a rule for all host with “_SYS_DATA”


#2

On the fly test::

.*_SYS_DATA

and if you want with comma:

.*_SYS_DATA,?


(Philipp Näther) #3

You have to add a tilde (~) in front to make cmk recognize it is a regular expression.


(Gabriel Burich) #4

Thanks for reply.
but, does not work.


(Gabriel Burich) #5

the ~ is for the begin, i need the same termination.


#6

You mean:

~.*_SYS_DATA,?


(Philipp Näther) #7

This should match PC1_SYS_DATA, ABC_SYS_DATA and BLUE_SYS_DATA, yes. I even tested it on my site to make sure.

The tilde is not part of regex. It just indicates that everything after that should be handled as regex by cmk.


(Gabriel Burich) #8

Very thanks. This works.


(Gabriel Burich) #9

Yes yes,you are correctly. Sorry i not saw in first time.