aleex42 / netapp-cdot-nagios

Nagios-Checks for monitoring NetApp cDOT-Systems via NetApp Perl API
GNU General Public License v3.0
43 stars 30 forks source link

Update check_cdot_clusterlinks.pl #64

Closed log1-c closed 1 year ago

log1-c commented 2 years ago

Hi Alex,

I just found out that running this script against a AFF-A250 with VERSION 9.10.1P4 produces the following output:

Use of uninitialized value $_ in pattern match (m//) at /usr/lib/nagios/plugins/check_cdot_clusterlinks.pl line 107.
Use of uninitialized value $_ in pattern match (m//) at /usr/lib/nagios/plugins/check_cdot_clusterlinks.pl line 107.
OK: all clusterlinks up

This is because the result of line 104 has no brackets () in the string. I have simply removed the split/match for the brackets. Not sure if that works in all scenarios though.

Another "solution" could be

if (grep(/[()]/, $link_status)){
                $link_status = (split( /[()]/, $link_status ))[1];
}