Skip to main content

Hello

I’m encountering an issue for a new firewall I have to monitor (a fortinet)

i’m using the autodiscover rule for the traffic interface, unfortunately there are some interace named with an invalid character for centreon : &

I get discover results like traffic-WAN-AT&T  or “lan-R&D”

 

you can’t change the name in the firewall unless you destroy and recreate the interface, so it’s not possible to do that (for now)

 

is there a way in the autodiscover rule to make some regex magic to delete the “&” from the name, I looked around the discover rules, you can do complex thing in this advanced section

where you can manipulate the strings, but i’m stuck on what to put here for simply deleting all the invalid character (or replacing them with something like dash “-”)

 

an example I found what the exact opposite for extracting the windows drive letter and reusing it in the service name (disk-C, disk-D, etc… from an old kermit article Découverte auto des disques | Les archives de Kermith)

 

any help appreciated

Hello :)
 

In the documentation on this page there is an example of how to use this part of the discovery rule. For further explanation the example in this doc will make the regex to find strings like “Traffic-eth23” and replace them with the same thing but with a hyphen added between eth and the number: “Traffic-eth23” → “Traffic-eth-23”

In our case, it's much simpler: we'd like the ‘&’ to be replaced by another character (for example. ‘-’), which would give this result: 

So without making this addition I saw this

And after changing the rule as proposed I see this: 

I hope you find this useful and that it meets your needs.

Kind regards


thanks!

I didn’t try that, I was having issues with the syntax for the regexp, but it is indeed simple


I’ll add that also : 

you can have  multiple replace for the same macro, here I had some wifi traffic “invité” that were converted to a Unicode

it works fine to have both replace, that’s nice.


Reply