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

Trailing parentheses are removed from the SNMP system description #2668

Closed
eschoeller opened this issue May 5, 2019 · 7 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@eschoeller
Copy link

I've noticed this one for awhile. See the output from SNMP:

RFC1213-MIB::sysDescr.0 = STRING: "CRAH-1 (North)"

See what comes through in Cacti:
image

Nothing major.

@cigamit
Copy link
Member

cigamit commented May 5, 2019

Well, that was odd. The snmp string was being trimmed by a regex, going to try to trace why that was added.

cigamit added a commit that referenced this issue May 5, 2019
RFC1213 sysDescr trailing parentheses lost
@cigamit
Copy link
Member

cigamit commented May 5, 2019

Okay, resolved this. There was a pull request back in 2017 with no explanation. So, backed off the offending portion.

@cigamit cigamit added bug Undesired behaviour resolved A fixed issue labels May 5, 2019
@eschoeller
Copy link
Author

That fixed it!

@eschoeller
Copy link
Author

eschoeller commented May 6, 2019

I think this might have broken something else though (one of my scripts). So I just backed it out. I'll take another closer look at this later.
Actually several of my script queries.

@netniV
Copy link
Member

netniV commented May 6, 2019

So, the regex was extended to look for the values of "(up" or "(down" and remove them for some reason. Plus it was also asked to remove the closing bracket if it was on the end of the line. This was added by @arno-st 11th May 2017 with the comment of 'I also change the REGEXP_SNMP_TRIM to be able to handle correctly the status of an interface who can give up or down status, and now it's not handle correctly' in commit dcf2b03

@cigamit
Copy link
Member

cigamit commented May 6, 2019

@eschoeller, the issue we have with the current snmp library functions include one issue around obtaining numeric data vs. text data.

There is no way to say: "Hey, I don't want the walk to return up or down, I want it to return 1 or 0", the same applies with your HRULE issues. "Hey, I want the numeric value without the suffix, and not the whole string.".

Some of this can be accommodated by a value regex. But there may be some cases that can not be accommodated by that.

There is also a major compatibility issue with the SNMP class in php-snmp module that needs to be corrected. So, basically, it's a mess right now.

cigamit added a commit that referenced this issue May 8, 2019
SNMP strings not being trimmed properly.
@netniV netniV changed the title [1.2.3] RFC1213 sysDescr trailing parentheses lost Trailing parentheses are removed from the system description Jun 2, 2019
@netniV netniV changed the title Trailing parentheses are removed from the system description Trailing parentheses are removed from the SNMP system description Jun 2, 2019
@cigamit cigamit closed this as completed Jun 8, 2019
@netniV netniV added this to the v1.2.4 milestone Jun 8, 2019
@eschoeller
Copy link
Author

Confirmed working in 1.2.4

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
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