slauger/check_netscaler

excluding name(s) on check state object

gromine opened this issue · 2 comments

Hi,

when using the "state" option for objects "vserver", "service", "groupservice" or "server", it's only possible to get a list or to query one single object. If one member of the list is out of order, the answer is "critical" ; it could be nice to query on a part of the list only, by :
• excluding one or more object's values from the query or
• using the -n ( name ) option with more than 1 name

The check could be written as following :
./check_netscaler.pl -H IP -u user -p password -s -C state -o lbvserver -nx name9 --> name9 is excluded from the query
./check_netscaler.pl -H IP -u user -p password -s -C state -o lbvserver -n name1,name2,name3 --> the query is asked on the 3 names written

sometimes you need to disable some objects ( test's lbvserver by ex. ) and this way permits to clean nagios screen from useless alerts. It would permit not to query every object by a single check, which is a working way today, but not the best when you have many objects to look after.

Hi gromine,

this is currently possible with the subcommands check_keyword and check_threshold (by using split(',', $plugin->opts->objectname)... in the code). It seems like that check_state currently misses this option.
You are absolutely right, filtering out some objects in the result is a very important feature. It will fix this in the next days and keep you updated.

Thanks.

Usage:

./check_netscaler.pl -H netscaler01 -C state -o lbvserver -s -f 'vs_lb_ssl_mam|vs_lb_http_sharefile_connectors|vs_lb_http_sharefile_options|vs_lb_tcp_.*'

Im looking forward to add the filter to the other subcommands as well.