Comments (13)
Ok, this isn't supposed to happen. Let me check this.
from check_netscaler.
Hi @gjarm93,
the command interface
does already support the filter switch. See https://github.com/slauger/check_netscaler/blob/master/check_netscaler.pl#L829.
I haven't tested it, but it should be possible to filter the check to a single interface via -f '0/1'
. The -f
also supports regular expressions, you can expand the check to multiple interfaces (e.g. -f '0.[1-3]'
).
Please let me know if this fits your needs.
from check_netscaler.
./check_netscaler.pl -H hostname -u user -p pwd -s -C perfdata -o Interface -n rxbytesrate -f '0/1/1'
NetScaler OK - perfdata: Interface.rxbytesrate[0]: 0; Interface.rxbytesrate[1]: 0; Interface.rxbytesrate[2]: 0; Interface.rxbytesrate[3]: 0; Interface.rxbytesrate[4]: 48430; Interface.rxbytesrate[5]: 3060; Interface.rxbytesrate[6]: 958333; Interface.rxbytesrate[7]: 3676; Interface.rxbytesrate[8]: 4449; Interface.rxbytesrate[9]: 1084; Interface.rxbytesrate[10]: 971690; Interface.rxbytesrate[11]: 8099; Interface.rxbytesrate[12]: 5305; Interface.rxbytesrate[13]: 0; Interface.rxbytesrate[14]: 149750; Interface.rxbytesrate[15]: 52753; Interface.rxbytesrate[16]: 4224; Interface.rxbytesrate[17]: 1930708; Interface.rxbytesrate[18]: 11658 | 'Interface.rxbytesrate[0]'=0;; 'Interface.rxbytesrate[1]'=0;; 'Interface.rxbytesrate[2]'=0;; 'Interface.rxbytesrate[3]'=0;; 'Interface.rxbytesrate[4]'=48430;; 'Interface.rxbytesrate[5]'=3060;; 'Interface.rxbytesrate[6]'=958333;; 'Interface.rxbytesrate[7]'=3676;; 'Interface.rxbytesrate[8]'=4449;; 'Interface.rxbytesrate[9]'=1084;; 'Interface.rxbytesrate[10]'=971690;; 'Interface.rxbytesrate[11]'=8099;; 'Interface.rxbytesrate[12]'=5305;; 'Interface.rxbytesrate[13]'=0;; 'Interface.rxbytesrate[14]'=149750;; 'Interface.rxbytesrate[15]'=52753;; 'Interface.rxbytesrate[16]'=4224;; 'Interface.rxbytesrate[17]'=1930708;; 'Interface.rxbytesrate[18]'=11658;;
It still gives all the interfaces even when filter is provided
from check_netscaler.
Sorry, i was a bit wrong. The filter switch filters out an interface from your result, just as the name suggests. It should be possible to add a inverse filter via perl regular expression (like (?:(?!0\/1).)*
), but i couldn't find a working solution right now.
So a quick and very dirty solution would be to filter out all unwanted interfaces:
./check_netscaler.pl -H 10.0.0.240 -p nsroot -C interfaces -f '(LO.1|0.1|0.2|0.3)'
This may or may not solve your initial problem.
Filtering is currently not supported for the perfdata command. This is because the sub check_threshold_and_get_perfdata is very generic. We do not know which field contain the item field.
from check_netscaler.
It seems like that it's also possible to filter the API response to a single interface.
http://<netscaler-ip-address>/nitro/v1/config/Interface/id_value<String>
But this will require some changes in the plugin code - and also this would be only an option for the Interfaces command.
from check_netscaler.
I would need perfdata since I'm looking for rxbytesrate to get current value instead of total(counter). Looks like /nitro/v1/config/Interface doesn't have a rate
from check_netscaler.
Have a look at 5c0ef0a. The commit adds a new --label
switch. Does this fix your problem? Currently i do not have a better idea.
Example usage:
# default
-bash$ ./check_netscaler.pl -H 10.0.0.240 -p secure -s -C perfdata -o Interface -n rxbytesrate
NetScaler OK - perfdata: Interface.rxbytesrate[0]: 1711; Interface.rxbytesrate[1]: 13915 | 'Interface.rxbytesrate[0]'=1711;; 'Interface.rxbytesrate[1]'=13915;;
# with the new -f switch set to 'id'
-bash$ ./check_netscaler.pl -H 10.0.0.240 -p secure -s -C perfdata -o Interface -n rxbytesrate -l id
NetScaler OK - perfdata: Interface.rxbytesrate[0/1]: 1575; Interface.rxbytesrate[LO/1]: 12130 | 'Interface.rxbytesrate[0/1]'=1575;; 'Interface.rxbytesrate[LO/1]'=12130;;
from check_netscaler.
Yes, for now this should work.
Thank you!
from check_netscaler.
And are there any plans for future to again filter to get single interface?
from check_netscaler.
Since we now have a label for filtering, adding support for the -f
shouldn't be a problem. I'll take care of it.
from check_netscaler.
I renamed the label switch from -l
to -L
to make room for a new "limit" switch. The limit switch (-l
) can be used to limit the current check to specific objects, just like you wanted. It can be combined with the label option (-L
) and the existing filter option (-f
).
Examples:
# limit to LO/1
./check_netscaler.pl -H 10.0.0.240 -p secure -s -C perfdata -o Interface -n rxbytesrate -L id -l 'LO.1'
# limit to 0/[0-9] and filter out 0/2
./check_netscaler.pl -H 10.0.0.240 -p secure -s -C perfdata -o Interface -n rxbytesrate -L id -l '0.[0-9]' -f '0.2'
TODOs:
- Waiting for feedback from @gjarm93
- Update our existing docs and add some examples
- Add additional tests for this new switches
from check_netscaler.
It did the job, thank you!!
from check_netscaler.
The new switches are part of Release v1.6.1.
from check_netscaler.
Related Issues (20)
- SDX Support HOT 1
- NetScaler UNKNOWN - 501 Protocol scheme 'proxyname' is not supported HOT 2
- Check that ACLs are Enabled HOT 2
- NTP Check shows perl warnings Use of uninitialized value HOT 1
- Alive? 12.1: Build 51.19 ? HOT 4
- Partition support HOT 10
- incorrect CRITICAL alert assignment HOT 1
- Linting in Travis CI pipeline (perltidy) HOT 1
- invalid perfdata values HOT 12
- interface support HOT 2
- Delete me
- Expanded and extended options for sslcert HOT 1
- Icinga2 issue with performance data HOT 1
- Invalid comparison in ntp check
- NetScaler CRITICAL - state: no VPNvServer found in configuration HOT 2
- check_ntp_time: NTP CRITICAL: Offset unknown #329 HOT 1
- Check the expiry date of a local license file HOT 2
- Get particular information of hwinfo (like: nsversion or hwdescription) HOT 1
- Wrong CPUusagepcnt in 13.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from check_netscaler.