Build precise queries to find exactly what you need
Press ESC to close
@dennisk
Favorites0
Views
Projects0
Hi Slauger, thank you for this script. It works very well and most important, it works fast :) We have a problem with applying the regex filter. Can you help us with an example perhaps? [root@server /usr/local/nagios/libexec]$ ./check_netscaler.pl -H 1.2.3.4 -u username -p password -s -C state -o lbvserver NetScaler CRITICAL - state lbvserver: _httpredir_ DOWN; | UNKOWN=0;;;0; UP=28;;;0; 'OUT OF SERVICE'=0;;;0; DOWN=1;;;0; This is a hidden vServer which is apparently down by default and created by the NetScaler when the option "Redirect From Port" is used. The vServer in our case is listening on port 80 to redirect to 443. Since this is by design, we would like to add a filter to the check comment to ignore vServers which have _httpredir_ in the name. I tried to add various things like this, but that didn't work unfortunately: -f '/(?:[^*_httpredir_*]*)/' Hope you can help us with a regex example. Dennis
Reviewed 7 years ago
Hi there, I've found a bug in calculating time drift. The timestamps of hosts are collected as epoch numbers, and put into an array. When the array is sorted, a new array is created but the newly created array is not used in the script. Without sorting, you cannot calculate the drift. This is what I found: my $epoch_oldest = $Host_Epoch_Hash{$Host_Epoch_Array[0]}{'epoch'}; my $epoch_newest = $Host_Epoch_Hash{$Host_Epoch_Array[-1]}{'epoch'}; This is what I changed: my $epoch_oldest = $Host_Epoch_Hash{$Host_Epoch_Array_Sorted[0]}{'epoch'}; my $epoch_newest = $Host_Epoch_Hash{$Host_Epoch_Array_Sorted[-1]}{'epoch'}; Checks works fine now!