lausser / check_nwc_health

nwc = network component. This plugin checks lots of aspects of routers, switches, wlan controllers, firewalls,.....
http://labs.consol.de/nagios/check_nwc_health
GNU General Public License v2.0
146 stars 88 forks source link

warningx/criticalx not working on all metrics as documented #330

Open PeterLustig1337 opened 1 month ago

PeterLustig1337 commented 1 month ago

Hello dear devs,

first of all, thanks for your awesome work! The plugin is great and comes in very handy.

Now the problem. From the documentation at https://labs.consol.de/nagios/check_nwc_health/#beispiele of the plugin it says:

--warningx/criticalx can set individual thresholds on all metrics.

and the example seems to work like a regexp

--warningx 'broadcast.*'=95 --criticalx 'broadcast.*'=95

which is working fine with interface modes.

So I've tried using it with --mode hardware-health on temperature metrics. As an example I have the item keys "temp_NP" and "temp_CP" and many other from a PaloAlto Firewall. I wanted to set the tresholds for all temperatures with warning and critical like in the broadcast example for interfaces:

--warningx 'temp.*'=75 --criticalx 'temp.*'=95

but it does not work as intended. When I sepcifically pick a temperature name e.g. "temp_NP"

--warningx 'temp_NP'=75 --criticalx 'temp_NP*'=95

it sets the tresholds for this sepcific item key "temp_NP" correctly.

So the questions is, how can I achieve to set thresholds for all temperature items without specifying each seperatly? Do I miss something or am I doing it wrong? I also tried to understand the source code, but I'm not that good with perl. Just found a few hardcoded filter for traffic stuff in plugins-scripts/CheckNwcHealth/IFMIB/Component/InterfaceSubsystem.pm and sensor stuff in plugins-scripts/CheckNwcHealth/Cisco/CISCOENTITYSENSORMIB/Component/SensorSubsystem.pm but don't really understand it.

Thanks in advance and best regards!