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

Automation does not calculate network information correctly for single hosts #2862

Closed
bmfmancini opened this issue Jul 31, 2019 · 13 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@bmfmancini
Copy link
Member

Hey All

So I was adding some single IP's to automation and I noticed that even though I specify a /32 which should be 1 IP cacti calculates this wrong

Here is an example

1.1.1.1/32
2.2.2.2/32
3.3.3.3/32
4.4.4.4/32
5.5.5.5/32

image

And one more weird thing
Even if cacti had a predetermined CIDR it falls back to wouldn't it be 5G and not 4 since there are 5 subnets ?

@bmfmancini
Copy link
Member Author

Ok if you separate them by commas it goes to 0

image

Just as a FYI my rationale of using the /32 is that we have a much larger block but are picking which devices to put in cacti I want to feed the single ip's into autom8 to do the graph creation and such

If I put a /30 then it works fine

image

The above where it was showing 4G is actually my bad because I didn't separate the networks by ,
but I did notice that in 1.2.4 you would get this popup

image

However I didnt see that popup in 1.2.5

@bmfmancini
Copy link
Member Author

Here is the successful save from 1.2.5

so the validation that 1.2.4 has didn't make it to 1.2.5 it appears

image

@cigamit
Copy link
Member

cigamit commented Aug 1, 2019

Can't you just include the 4 ip addresses. The 32bit mask is likely a corner case. I'll leave this open, but you should just include the 4 ip addresses in the mean time.

@netniV
Copy link
Member

netniV commented Aug 1, 2019

I'll take a look tonight at the code and review it just to be sure there's nothing strange.

@bmfmancini
Copy link
Member Author

Thanks Guys

@cigamit yes I tested this morning and the single addresses without the /32 works fine

@netniV
Copy link
Member

netniV commented Aug 2, 2019

I've done some testing and the code wasn't quite right. So, I'm testing a new function to provide all network details as one array which the others can use.

@bmfmancini
Copy link
Member Author

cool! thanks for checking into this !

@cigamit
Copy link
Member

cigamit commented Aug 11, 2019

@netniV, when were you going to commit your changes?

@cigamit cigamit added the bug Undesired behaviour label Aug 11, 2019
@bmfmancini
Copy link
Member Author

Hey Guys

Found another both with AUTOM8 and CIDR on 1.2.5
if there is a whitespace after the CIDR cacti will register a huge IP range

I.e 192.168.1.0/24(white space) will show 4G instead of 254

@netniV netniV changed the title AUTOM8 wrong cidr calculation 1.2.5 Automation does not calculate network information correctly for single hosts Aug 16, 2019
@netniV
Copy link
Member

netniV commented Aug 16, 2019

I've made a change that should resolve the issues regarding network calculations. There may be other places that need a change still but I did the immediate functions.

@bmfmancini
Copy link
Member Author

Looking good!

/32 shows up as one and white spaces throws an error !
how about instead of throwing an error for white space when clicking the save action would remove any whitespace in the range ?

@netniV
Copy link
Member

netniV commented Aug 16, 2019

By default, no fields are automatically trimmed in cacti.

@bmfmancini
Copy link
Member Author

gotcha

ok cool everything looks good in the lab now

Thanks alot !

@netniV netniV closed this as completed Aug 16, 2019
@netniV netniV added this to the v1.2.6 milestone Aug 16, 2019
@netniV netniV added the resolved A fixed issue label Aug 16, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants