That's the similar case to CDP(Cisco Discovery Protocol) neighbor address.
Quote:
% snmpwalk -v2c -c public 192.168.1.100 .1.3.6.1.4.1.9.9.23.1.2.1.1.4
SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.4.10101.4 = Hex-STRING: C0 A8 01 05
I think you should create your own script as 'Script Data Query' instead of 'SNMP Data Query' to convert these hex-string into dotted string (a.b.c.d).
For example:
Quote:
% php -r 'print long2ip("0xC0A80105");'
192.168.1.5
But if you want to manage to translate results of SNMP anyway, try this...
At line 876 of 'graphs_new.php', modify from
Code:
if (isset($row[$field_name])) {
print .... "<span style='background-color: #F8D93D;'>\\1</span>", $row[$field_name]) : $row[$field_name]) . "</span></td>";
}else{
to
Code:
if (isset($row[$field_name])) {
$tmp = $row[$field_name];
if (preg_match('/^[[:xdigit:]]+[: ][[:xdigit:]]+[: ][[:xdigit:]]+[: ][[:xdigit:]]+$/', $tmp) != 0) {
$tmp = long2ip("0x" . preg_replace('/[: ]/', '', $tmp));
}
print .... "<span style='background-color: #F8D93D;'>\\1</span>", $tmp) : $tmp) . "</span></td>";
}else{
(NOTE) [[:xdigit:]] is equal to
[0-9A-Fa-f]Before:
After:
I tried this on Cacti 0.8.7g, but not fully tested. At your own risk.