Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/share/perl5/Net/Ping.pm #300

Open
bakkc opened this issue Jun 25, 2022 · 6 comments

Comments

@bakkc
Copy link

bakkc commented Jun 25, 2022

Hi Gerard,
after moving form centos6 to rhel8 we encounter the following issue with the plugin with the following command:
check_nwc_health --hostname xxx.xxx.xxx.xxx --protocol 2c --community something --mode connect-vips --verbose
Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/share/perl5/Net/Ping.pm line 1418.
Issue reproduced with Ping.pm 2.55 and 2.74

@lausser
Copy link
Owner

lausser commented Aug 4, 2022

There should be the code:

    foreach (@{$self->{vips}}) {
      $ping->port_number($_->{ltmVirtualServPort});
      my $now = time;
      $ping->ping_syn($_->{ltmVirtualServAddr},
          inet_aton($_->{ltmVirtualServAddr}),
          $now, $now + 2);
    }

Can you check if $_->{ltmVirtualServAddr} is perhaps undef or does not have a valid ip address value?

@bakkc
Copy link
Author

bakkc commented Aug 4, 2022

Hi Gerhard,
thaks for repying. Perl is not really my thing, how can i debug the script to gather the info? ( like set -x in bash/ksh )

If i'm correct the --mode connect-vips should connect to the F5 (-H ip adres/management ip ) and connect to each virtual server ? Otherwise maybe i'm confusing the fuctionality of the check.

P.S. in the --help mode there is a double line "watch-vips (Watch load balancer vips)"

@lausser
Copy link
Owner

lausser commented Aug 4, 2022

Insert a line:

   foreach (@{$self->{vips}}) {
      printf "%s\n", Data::Dumper::Dumper($_);
      $ping->port_number($_->{ltmVirtualServPort});

@bakkc
Copy link
Author

bakkc commented Aug 4, 2022

Hi Gergard,
below the output.

$VAR1 = bless( {
'ltmVirtualServEnabled' => 'true',
'ltmVirtualServGtmScore' => 0,
'ltmVirtualServActualPvaAccel' => 'none',
'ltmVirtualServWildmask' => '255.255.255.255',
'ltmVirtualServConnLimit' => 0,
'ltmVirtualServIpProto' => 6,
'indices' => [
'18',
'47',
'67',
'111',
'109',
'109',
'111',
'110',
'47',
'65',
'79',
'86',
'80',
'78',
'95',
'83',
'83',
'84',
'80'
],
'ltmVirtualServTranslatePort' => 'true',
'ltmVirtualServSnatpoolName' => '',
'ltmVirtualServSnatType' => 'none',
'ltmVirtualServDefaultPool' => '/Common/ANICENAME',
'ltmVirtualServSourceAddressTranslationType' => 'automap',
'ltmVirtualServAvailabilityState' => 'none',
'ltmVirtualServName' => '/Common/ANICENAME',
'ltmVirtualServWildmaskType' => 'ipv4',
'ltmVirtualServLasthopPoolName' => '',
'ltmVirtualServRclass' => '',
'ltmVirtualServTranslateAddr' => 'true',
'ltmVirtualServPort' => 443,
'ltmVirtualServListedEnabledVlans' => 'false',
'ltmVirtualServFallbackPersist' => '',
'ltmVirtualServAddr' => '172.16.1.72',
'ltmVirtualServDisabledParentType' => 0,
'ltmVirtualServEnabledState' => 'none',
'flat_indices' => '18.47.67.111.109.109.111.110.47.65.79.86.80.78.95.83.83.84.80',
'ltmVirtualServType' => 'poolbased',
'ltmVirtualServAddrType' => 'ipv4',
'ltmVirtualServCmpEnabled' => 'true',
'ltmVirtualServSfFlags' => 'disabled',
'ltmVirtualServSrcport' => 'srcportreserve',
'ltmVirtualServSourceAddressTranslationPool' => '',
'ltmVirtualServStatusReason' => '',
'ltmVirtualServVaName' => '/Common/172.16.1.72'
}, 'Classes::F5::F5BIGIP::Component::VipSubsystem::VIP' );

Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/share/perl5/Net/Ping.pm line 1418.

@bakkc
Copy link
Author

bakkc commented Aug 4, 2022

I have tested the same version on the old centos 6 just to compare.

$VAR1 = bless( {
'ltmVirtualServWildmask' => '255.255.255.255',
'ltmVirtualServEnabledState' => 'none',
'ltmVirtualServRclass' => '',
'ltmVirtualServListedEnabledVlans' => 'false',
'ltmVirtualServSrcport' => 'srcportreserve',
'ltmVirtualServDefaultPool' => '/Common/ANICENAME',
'ltmVirtualServConnLimit' => 0,
'ltmVirtualServType' => 'poolbased',
'flat_indices' => '18.47.67.111.109.109.111.110.47.65.79.86.80.78.95.83.83.84.80',
'ltmVirtualServAddrType' => 'ipv4',
'ltmVirtualServVaName' => '/Common/172.16.1.72',
'ltmVirtualServStatusReason' => '',
'ltmVirtualServTranslateAddr' => 'true',
'ltmVirtualServGtmScore' => 0,
'ltmVirtualServSnatpoolName' => '',
'ltmVirtualServFallbackPersist' => '',
'ltmVirtualServIpProto' => 6,
'ltmVirtualServCmpEnabled' => 'true',
'ltmVirtualServDisabledParentType' => 0,
'ltmVirtualServSourceAddressTranslationType' => 'automap',
'ltmVirtualServTranslatePort' => 'true',
'ltmVirtualServActualPvaAccel' => 'none',
'ltmVirtualServSourceAddressTranslationPool' => '',
'indices' => [
'18',
'47',
'67',
'111',
'109',
'109',
'111',
'110',
'47',
'65',
'79',
'86',
'80',
'78',
'95',
'83',
'83',
'84',
'80'
],
'ltmVirtualServAddr' => '172.16.1.72',
'ltmVirtualServSfFlags' => 'disabled',
'ltmVirtualServEnabled' => 'true',
'ltmVirtualServAvailabilityState' => 'none',
'ltmVirtualServName' => '/Common/ANICENAME',
'ltmVirtualServSnatType' => 'none',
'ltmVirtualServPort' => 443,
'ltmVirtualServWildmaskType' => 'ipv4',
'ltmVirtualServLasthopPoolName' => ''
}, 'Classes::F5::F5BIGIP::Component::VipSubsystem::VIP' );

@bakkc
Copy link
Author

bakkc commented Aug 4, 2022

I noticed that on rhel8 the check stops at the first virtual server. On the old centos it returns all the virtual servers (54 in total)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants