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

MIB Complications - Question #18

Closed
wilpig opened this issue Aug 18, 2015 · 2 comments
Closed

MIB Complications - Question #18

wilpig opened this issue Aug 18, 2015 · 2 comments

Comments

@wilpig
Copy link
Contributor

wilpig commented Aug 18, 2015

We've just recently hit one instance where a user had mibs present on the system for his servertech pdu's and they modify the return data to add what type of unit they are measuring. I've put examples of the walks below.

snmpwalk -v 2c -c public 10.0.0.2 .1.3.6.1.4.1.1718.3.2.1.1.11.1 ;
Sentry3-MIB::towerActivePower.1 = INTEGER: 1730 Watts
snmpwalk -OU -v 2c -c public 10.0.0.2 .1.3.6.1.4.1.1718.3.2.1.1.11.1
Sentry3-MIB::towerActivePower.1 = INTEGER: 1730

If I set up an oss_snmp instance and tell it to read the above oid I get INTEGER: 1740 Watts as the initial return value that it passes to the parser. The parser knows this should just be an int and returns back 740.

Is there a way that you know of to force snmpwalk to NOT utilize the available mib?

@wilpig
Copy link
Contributor Author

wilpig commented Aug 18, 2015

This is the work around that we're using right now but not sure of the other implications.

        {
            case 'INTEGER':
                if( !is_numeric( substr($value,0,1) ) )
                    $rtn = (int)substr( substr( $value, strpos( $value, '(' ) + 1 ), 0, -1 );
                else
                    $rtn = (int)$value;
                break;
        }

@barryo
Copy link
Member

barryo commented Aug 20, 2015

Yeah.... this would certainly be use case specific. I think you'd need to handle this directly in the function you use to get the data and we'd possibly need to implement a 'get raw' type return.

I'll close this and happily evaluate a pull request if you want to go down that road.

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

2 participants