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

SNMP - KEEPALIVED-MIB Addresses issue #4

Open
m3rlinux opened this issue Mar 5, 2020 · 0 comments
Open

SNMP - KEEPALIVED-MIB Addresses issue #4

m3rlinux opened this issue Mar 5, 2020 · 0 comments

Comments

@m3rlinux
Copy link

m3rlinux commented Mar 5, 2020

As reported here: acassen/keepalived#866

The checks not report correctly some IP Classes.

I managed to solve the issue by changing a bit the chk_vrrp_hex2inet and chk_ipvs_hex2inet functions as belove:

check_keepalived_vrrp.pl

293 sub chk_vrrp_hex2inet($)
294 {
295    my $hexstr = shift;
296    my $oct;
297    my @octs;
298    $hexstr =~ s/"//g;
299    if (length($hexstr) == 4)
300    {
301      for $oct (split(//, $hexstr))
302      {
303        $octs[@octs] = ord($oct);
304      };
305    } else {
306      for $oct (split(/ /, $hexstr))
307      {
308        $octs[@octs] = hex($oct);
309      };
310    };
311 
312    return(join('.', @octs));
313 };

check_keepalived_ipvs.pl

323 sub chk_ipvs_hex2inet($)
324 {
325    my $hexstr = shift;
326    my $oct;
327    my @octs;
328    $hexstr =~ s/"//g;
329    if (length($hexstr) == 4)
330    {
331      for $oct (split(//, $hexstr))
332      {
333        $octs[@octs] = ord($oct);
334      };
335    } else {
336      for $oct (split(/ /, $hexstr))
337      {
338        $octs[@octs] = hex($oct);
339      };
340    };
341 
342    return(join('.', @octs));
343 };
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

1 participant