I've been reading the documentation and I still don't understand the Cacti common data query 'interface.xml', just the final part:
Code: Select all
<oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
[...]
<ifIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.2.2.1.1</oid>
</ifIndex>
[...]
<ifIP>
<name>IP Address</name>
<method>walk</method>
<source>
OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$
</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.4.20.1.2</oid>
</ifIP>
ifIndex.1=1
ifIndex.2=2
but is the case of "<ifIP>" that I don't understand, because the instantiation cannot be like in the previous case; this following is not correct:
ipAdEntIfIndex.1=1
ipAdEntIfIndex.2=2
because "ifIndex" is not the index for "ipTable" but "ipAdEntAddr". i.e. (this is correct)
ipAdEntIfIndex.192.168.0.56=1
ipAdEntIfIndex.192.168.0.34=2
I know the secret is in "OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$". The regular expression means "any number of characters followed of an IP and then EOF". But I don't understand step by step how it works.
?? Is it supposed that:
1-It walks ".1.3.6.1.2.1.4.20.1.2 (ipAdEntIfIndex)" so it gets for example:
ipAdEntIfIndex.192.168.0.56=1
ipAdEntIfIndex.192.168.0.34=2
2-Then, in the case of ifIndex=1 it looks for the interface 1,
ipAdEntIfIndex.192.168.0.56=1
3-The regular expression gets 192.168.0.56 ??
4-And then we see 192.168.0.56 for the interface 1 when clicking "Create graphs for this host" in Cacti ??