sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
408 stars 148 forks source link

Display Filter based on more variables #841

Closed hakong closed 5 years ago

hakong commented 6 years ago

Is your feature request related to a problem? Please describe. Not really a problem, but I'd like to filter based on more variables. For example icon_image.

Describe the solution you'd like Display filter based on custom variables from a service configuration.

Describe alternatives you've considered n/a

Additional context Trying to filter out all windows-related services and hosts from a display. The windows hosts are not in a specific hostgroup, so I can't use that. I've been building filters for various windows-only checks and am currently struggling with getting rid of a "Disk Usage" check that returns "DISK WARNING /C" for Windows, but "DISK WARNING /" for Linux, and can't get the regex to work(DISK WARNING /[A-Z] is basicly what I want), so I thought about filtering the windows icon (icon_image win40.png) but that dosen't seem possible. image

steaksauce- commented 6 years ago

Not a direct solution to your problem, but with a bit of hostgroup magic, you can easily achieve this. We use hostgroups like win-disk-c, win-disk-f that run the checks for specific disks that might be present on a Windows system. Linux? linux-disk-/ and linux-disk-/[other mount pont].. Same thing with various services. If you're monitoring a small amount of servers, changing hostgroups shouldn't be too hard.

hakong commented 6 years ago

That's unfortunately not an option. There's about 10.000 service checks on a few nagios/naemon instances at different sites. I guess figuring out the regex is my best bet here. Do you know how the regex for this would look? I tried a few basics like:

DISK WARNING /[A-Z]
^DISK WARNING /\w

But thruk complained every time and it didn't filter anything.

sni commented 6 years ago

The regular expression looks fine, what does Thruk complain about?

hakong commented 6 years ago

image

sni commented 6 years ago

Which version is that, i have a feeling that i fixed something in that area a while ago.

hakong commented 6 years ago

Even a non-regex doesn't work. image image

hakong commented 6 years ago

Thruk Version 2.20-2

sni commented 6 years ago

Please retry with the latest release.

hakong commented 6 years ago

Does not seem to work. Works: image

Does not work: image

It seems to fail on the forwardslash, could that be?

hakong commented 6 years ago

Found 2 that work:

DISK WARNING .*\w
DISK WARNING .*[A-Z]

image image

Does not work: image

Works, but not what I need: image

hakong commented 6 years ago

Those that work still give an error in the drop-down ajax autocomplete thingy. This works the same in both versions (2.20 and 2.23).

image image image image

These 2 work aswell with the forward slashes:

DISK WARNING .*/[A-Z]
DISK WARNING .*/\w
hakong commented 6 years ago

Seem to have foud another bug. When typing in DISK [A-Z] in "Service", the drop-down ajax list shows HTML tags. image

sni commented 5 years ago

i fixed the issue with the preview. Forward slashes must be escaped like \/