[Check_mk (english)] Piggyback once again

Gerd Radecke wi2009i at gmail.com
Tue Jul 19 19:01:36 CEST 2016


Hi Tom,

The matching regex would be: ([^_*]).*
replaced by: \1

Explanation (shamelessly copied from regex101.com

/([^_]*).*/

1st Capturing group ([^_]*)

[^_]* match a single character not present in the list below

Quantifier: * Between zero and unlimited times, as many times as
possible, giving back as needed [greedy]
_ the literal character _

.* matches any character (except newline)

Quantifier: * Between zero and unlimited times, as many times as
possible, giving back as needed [greedy]

This way it doesn't matter what comes after the _.

To deal with HOSTNAME_somedesc and hostname_somedesc alike, you can
then also activate the "Case Translation" within the piggyback rule.

Cheers,
 Gerd

On Tue, Jul 19, 2016 at 3:13 PM, Thomas Wittmann <tom.teel at gmail.com> wrote:
> Hi all
> i have a little question about piggyback.
> I have several dozen VMs added as hosts to monitoring named "hostname".
> The VMs names in the vCenter is either
> HOSTNAME_somedescription1_somedescription2 or
> hostname_somedescription1_somedescription2. Sometimes the is even only
> _somedescription1 (missing the second)
> So now: i want piggyback to rip of these _somedesciption (which is sometimes
> uppercase, too) so that i only have "hostname". I am not so experienced with
> regex but everything i entered would not work. Can somebody assist me with
> that?
>
> Tom
>
> _______________________________________________
> checkmk-en mailing list
> checkmk-en at lists.mathias-kettner.de
> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en


More information about the checkmk-en mailing list