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

Problem with query interface and descr on CAT9K_IOSXE #14

Open
Operaciones-VTI-UChile opened this issue Jun 25, 2024 · 2 comments
Open

Comments

@Operaciones-VTI-UChile
Copy link

Operaciones-VTI-UChile commented Jun 25, 2024

Hi all:

We are trying to use this code on a Cisco Catalyst 9400 (version 17.9.4a), and the "interface" and "descr" queries don't work:

Executing script query '"/usr/bin/php" -q /media/storage/cacti/site/scripts/ss_sfp.php xx.xx.xx.xx:199:2:161:1000:1:10:xxxxx:::::: query interface'
+ Found item [interface=''] index: 1090

+ Executing script query '"/usr/bin/php" -q /media/storage/cacti/site/scripts/ss_sfp.php xx.xx.xx.xx:199:2:161:1000:1:10:xxxxx:::::: query descr'
+ Found item [descr=''] index: 1090

Looking through the PHP code, we think the problem in both cases would be that the following database queries (lines 174, 216 and 217) are not responding correctly:

174 $snmp_index = db_fetch_cell("select snmp_index from host_snmp_cache where host_id = '$host_id' and field_value = '$oid_name[0]' and field_name = 'ifDescr'");
216 $snmp_index = db_fetch_cell("select snmp_index from host_snmp_cache where host_id = '$host_id' and field_value = '$oid_name[0]' and field_name = 'ifDescr'");
217 $alias = db_fetch_cell("select field_value from host_snmp_cache where snmp_index='$snmp_index' and host_id='$host_id' and field_name='ifDescr'");

That would be because the "ifDescr" field does not exist in that table for this type of devices. As we saw, the correct field would be "ifName".

@kennykentaur
Copy link

I'm seeing the same issue in our environment.
SFP Indexes created before 1.2.xx still works with the latest cacti release and the SFP statistics script.

But when querying devices for new SFP indexes I'm seeing the same issues you post here.

@netniV
Copy link
Owner

netniV commented Jul 24, 2024

So, you could have it use either field to find the value, but not sure if that would have the desired effect. If not, you'd need some way to select which method is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants