I've got an issue but don't really have sufficient Python knowledge to solve it. I found some similar cases so for someone who is really good at Python this is probably a really small task to solve, if you would like!
Problem: Write a list of failed IP's within a monitored range from two input sources
I've got a CSV file with two columns, "FailedIPs.csv":
State, FailedIP, 1, 178.203.178.159,
Then I've got another file with ISP name and CIDR, "IPranges.csv":
ISPname, IPrange, Vodafone, 88.128.64.0/18,
I want to produce a CSV which contains all the failed IP addresses that are in one of the supplied ranges:
State, FailedIP, ISPname, IPrange, 1, 178.203.178.159, Vodafone, 168.00.64.0/32,
I found some similar questions here on StackOverflow:
- matching an IP to a CIDR mask in php5?
- How to see if an IP address belongs inside of a range of IPs using CIDR notation?
- How to sort IP addresses in a trie table? (probably not that relevant)
Looking forward to any Python "pro" (from my point of view) that would like to help! :)