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

Allow monitoring IPv6 with interface graphs #4404

Closed
gj00354347 opened this issue Sep 17, 2021 · 8 comments
Closed

Allow monitoring IPv6 with interface graphs #4404

gj00354347 opened this issue Sep 17, 2021 · 8 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@gj00354347
Copy link

Feature Request

A few weeks back the Network Ops Team has requested us to monitor the IPv6 KPI in cacti , we are on 1.2.18 . One of the typical request was like in cacti in Interface Traffic KPI we used to put |query_ifIP| in the graph title and graph name so this time we wanted to put IPv6 IP in the graph name .

But the challenge that we are facing here is that in IPv6 OID Table , the IPV6 IP is suffixed to OID itself and it is present on the left side of the OID Table and index on the right side .

situation is like IPv6 is encoded as byte-values within the OIDs of the SNMP table itself, and we are not sure if cacti is able to handle this type of entry.

below is example

IP-MIB::ipAddressIfIndex.ipv6."2x:xx:xx:xx:xx:xx:10:20:00:xx:00:00:00:xx:00:04" = INTEGER: 585

The hex-part for the IPv6 address is encoded part at the end of the OID.

The byte sequence in the OID is: 42.1.8.135.16.1.16.32.0.1.0.0.0.0.0.4

which is the binary form for 2aXX:0XX7:xxxx:xxxx:1::4

so is it possible in cacti to extract this info and yes then will you please throw some light how to achieve this .

Many thanks in advance
Gopal

@gj00354347 gj00354347 added the enhancement General tag for an enhancement label Sep 17, 2021
@TheWitness
Copy link
Member

Yea, it's supported. You have to create a new column in the xml file and call it ipv6_address or something and then use a regex replace like the IP address. You should upload you revised resource xml file here, or create a pull request when done with it.

@bernisys
Copy link
Contributor

Hi Larry,

So you mean, we just need to extract the byte-notation and put it into the value of the "ipv6_address" field, then cacti takes care internally, in case the dotted notation in the passed string matches the 16 bytes describing an IPv6 address?
That should be easily doable, and yes of course can we provide a pull.
I think we have added also a few other elements to the XML already, which could be interesting for the community.

@TheWitness
Copy link
Member

Well, upon further investigation, the parsing was not too exceptional. So, I'm going to make a small change to lib/data_query.php and resource/snmp_queries/interface.xml to exploit this.

The change to interface.xml will be the following:

        <ifIPv6>
            <name>IPv6 Address</name>
            <method>walk</method>
            <source>OID2HEX/REGEXP:^\.?1\.3\.6\.1\.2\.1\.4\.34\.1\.3\.2\.16\.(*)</source>
            <direction>input</direction>
            <oid>.1.3.6.1.2.1.4.34.1.3.2.16</oid>
        </ifIPv6>

Then, you will need to alter your suggested values to use the new IPv6 column.

TheWitness added a commit that referenced this issue Sep 25, 2021
Feasibility study of Monitoring IPv6 KPI though Cacti
@TheWitness TheWitness added this to the 1.2.19 milestone Sep 25, 2021
@TheWitness TheWitness added bug Undesired behaviour resolved A fixed issue and removed enhancement General tag for an enhancement labels Sep 25, 2021
@gj00354347
Copy link
Author

Thanks for the code .

I put it in interface.xml which was until now used for IPv4 KPI but just appended this IPv6 KPI XML , for extracting IPv6 IP .
After that I did reindexing but ideally there should be a column for IPv6 which I cannot see .PFA screenshot

interface-xml

is it because below mentioned values are applicable only for IPv4 and they have been defined on top of interface.xml or is it because I see there are some chnages which you have done in lib/data_query.php and I will have to import the new lib/data_query.php from dev branch of cacti .
<oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
<oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>

so Do I have to modify the interface.xml or import the latest changes from lib/data_query.php from dev branch . I am on 1.2.18 .

Best Regards,
Gopal

@bernisys
Copy link
Contributor

Do you think this is really enough?
Haven't looked completely into it at this point in time, but as far as i remember the index for the IPv4 objects should be a different one than for the IPv6 objects. For me this seems to look a lot more complex, as you need to identify the correct relationship between the interface ID and the IPv6 object.

Gopal will check if this is the case and report back to you.

@TheWitness
Copy link
Member

Here is the output from the verbose query for one of my devices.

image

Not sure why I'm not seeing things show up on the Graphs New page yet though.

@TheWitness
Copy link
Member

I might have to re-open this one.

@TheWitness
Copy link
Member

This looks better. It was operator error. MySQL search is not case sensitive, by PHP is.

image

@netniV netniV changed the title Feasibility study of Monitoring IPv6 KPI though Cacti Allow monitoring IPv6 with interface graphs Oct 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
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