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
Some interface aliases do not appear correctly #5554
Comments
@Linegod, should be fixed now. Please test. |
Applied changes - made no difference. Same results. |
@Linegod, are you using php-snmp? What version of PHP? |
I tested on ifDescr and it seems to work perfectly. Are there other special characters in the output. I'm using:
Testing without php-snmp now... |
Same outcome with or without php-snmp @Linegod |
php 5.4.16 in production I'll spin up a new instance tomorrow using the full develop branch to validate, then one on php 7.4.33 |
Wow, pretty old stuff. 1.2.26 will be a solid release too. I'm using remi PHP 8.2 repos for just about everything these days. PHP 7 is already beyond EOL too. |
Pulled dev branch, using php-8.0.30, without php-snmp Still doesn't work snmpset -v2c -cxxxxxxxxxx localhost IF-MIB::ifAlias.2 s 'Job Id# = 15 (that thing)'Click to show Data Query output for field 'ifName' snmpset -v2c -cxxxxxxxx localhost IF-MIB::ifAlias.2 s 'Job Id# 15 (that thing)'Click to show Data Query output for field 'ifName' |
If I escape it: snmpset -v2c -cxxxxxxx localhost IF-MIB::ifAlias.2 s 'Job Id# = 15 (that thing)' Total: 0.120000, Delta: 0.000000, Located input field 'ifAlias' [walk] Then it returns - but in production 'Job Id# =' is set by the automation system, and there doesn't appear to be a way to adjust it. |
Okay, at least I have more to go on now. Away at conference till Friday. |
@Linegod, can you post the output of the unescaped raw SNMPGET output? Use these options:
|
Also:
|
snmpget -O fntevU -v2c -cxxxxxxxxx localhost .1.3.6.1.2.1.31.1.1.1.18.2 snmpwalk -O QnU -v2c -cxxxxxxx localhost .1.3.6.1.2.1.31.1.1.1.18 |
Okay, I've written the following test script. If you can run it, that would be good. <?php
include('./include/cli_check.php');
include_once('./lib/snmp.php');
$host = '192.168.11.1'; // MicroTik Router
$community = 'public'; // lol
$version = '2'; // yup, still popular
$oid = '.1.3.6.1.2.1.2.2.1.2'; // ifDescr
$output = cacti_snmp_walk(
$host,
$community,
$oid,
$version
);
print_r($output); On my system with the funky ifDescription, I'm getting this... [root@vmhost5 cacti]# php -q test.php
Array
(
[0] => Array
(
[oid] => .1.3.6.1.2.1.2.2.1.2.1
[value] => wlan1
)
[1] => Array
(
[oid] => .1.3.6.1.2.1.2.2.1.2.2
[value] => wlan2
)
[2] => Array
(
[oid] => .1.3.6.1.2.1.2.2.1.2.3 = Job Id#
[value] => Job Id# = 15 (that thing)
)
<snip> |
It doesn't output the interface description even if I change it. I may have to test against another host. |
Wait, I adjusted for for the ifAlias - the 'description' setting on an alias appears in ifAlias, not ifDescr
So the weird part of the output is:
The oid is being mucked up. If I remove the equal sign:
There is no longer the extra ' = Job Id#' in the oid array |
Okay, so far so good. I'll keep digging. |
Can you confirm that the ifAlias in the interface.xml file matches this? <ifAlias>
<name>Alias (IF-MIB)</name>
<method>walk</method>
<output_format>ascii</output_format>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.2.1.31.1.1.1.18</oid>
</ifAlias> |
Here is a light modification @Linegod <?php
include('./include/cli_check.php');
include_once('./lib/snmp.php');
include_once('./lib/data_query.php');
$host = '192.168.11.1'; // MicroTik Router
$community = 'public'; // lol
$version = '2'; // yup, still popular
$oid = '.1.3.6.1.2.1.2.2.1.2'; // ifDescr
$output = cacti_snmp_walk(
$host,
$community,
$oid,
$version,
'',
'',
'',
'',
'',
'',
161,
200,
1,
20,
SNMP_POLLER,
'',
SNMP_STRING_OUTPUT_ASCII
);
$output = array_rekey($output, 'oid', 'value');
print_r($output); |
data_query.php line 1262, here we lost data: |
This is tricky, and still breaks down if the second line has an equal sign. For example: .1.3.2.4 = Some Text\n Some More Text = Stuff\n This is a real long line. .1.3.2.5 = Some numeric value So, it's not perfect.
This is tricky, and still breaks down if the second line has an equal sign. For example: .1.3.2.4 = Some Text\n Some More Text = Stuff\n This is a real long line. .1.3.2.5 = Some numeric value So, it's not perfect.
@TheWitness - That works Before and after from updated test.php: Before
After
Output of Cacti Verbose:
|
@Linegod, close if you are satisfied. |
Closing as completed |
Describe the bug
Network device interface description with equal sign (=) in ifAlias does not show Alias
To Reproduce
Steps to reproduce the behavior:
ie:
interface TenGigE0/0/0/1
description Job Id# = 55555 (Circuit #555555555555)
service-policy ...
....
ie:
interface TenGigE0/0/0/1
description 55555 (Circuit #555555555555)
service-policy....
Expected behavior
Alias should be populated with Job Id# = 55555 (Circuit #555555555555)
Additional context
Cacti version 1.2.21
The text was updated successfully, but these errors were encountered: