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

[snmp] customisable oid_batch_size batch size #1990

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

yannmh
Copy link
Member

@yannmh yannmh commented Oct 21, 2015

Here is a 5.5.2 candidate

Context

For an unindentified reason (need more investigation ?), some OIDs do not return when pulled in a batch query. By default, the SNMP AgentCheck attemps to query up to 10 OID at the same time to speed up the crawling runtime.

Example

Running SNMP command nextCmd on OIDS ('1.3.6.1.4.1.39538.3.1.3.1.1.7', '1.3.6.1.4.1.39538.3.1.3.3.1.11') 
Returned vars: [[(ObjectName('1.3.6.1.4.1.39538.3.1.3.1.1.7.0'), Integer(7)), (ObjectName('1.3.6.1.6.3.1.1.6.1.0'), Integer(1694833796))]]

(Note the unrelated '1.3.6.1.6.3.1.1.6.1.0' returned 😮 )

versus

Running SNMP command nextCmd on (CommunityData(communityIndex='s1542604247011267360', communityName=<COMMUNITY>, mpModel=1, contextEngineId=None, contextName='', tag='', securityName='s1542604247011267360'), UdpTransportTarget(('127.0.0.1', 161), timeout=1, retries=5, tagList=''), '1.3.6.1.4.1.39538.3.1.3.3.1.11') | {'lookupValues': False, 'lookupNames': False}
Returned vars: (None, Integer('noError', NamedValues(('noError', 0), ('tooBig', 1), ('noSuchName', 2), ('badValue', 3), ('readOnly', 4), ('genErr', 5), ('noAccess', 6), ('wrongType', 7), ('wrongLength', 8), ('wrongEncoding', 9), ('wrongValue', 10), ('noCreation', 11), ('inconsistentValue', 12), ('resourceUnavailable', 13), ('commitFailed', 14), ('undoFailed', 15), ('authorizationError', 16), ('notWritable', 17), ('inconsistentName', 18))), Integer(0, subtypeSpec=ConstraintsIntersection(ConstraintsIntersection(), ValueRangeConstraint(0, Integer(2147483647)))), [[(ObjectName('1.3.6.1.4.1.39538.3.1.3.3.1.11.0'), Integer(3))]])

Changes

Make the OID batch size configurable. Create a 'hidden' oid_batch_size option in the init_config section of the check YAML configuration file (default to 10).
Helpful to troubleshoot and workaround batch query related cases.

Make the OID batch size configurable. Create a 'hidden' `oid_batch_size`
option in the `init_config` section of the check YAML configuration
file (default to 10).
Helpful to troubleshoot and workaround batch query related cases.
@yannmh yannmh added this to the 5.5.2 milestone Oct 21, 2015
@@ -62,6 +62,9 @@ def __init__(self, name, init_config, agentConfig, instances=None):
# Create SNMP command generator and aliases
self.create_command_generator(mibs_path, ignore_nonincreasing_oid)

# Set OID batch size
self.oid_batch_size = int(init_config.get("oid_batch_size", DEFAULT_OID_BATCH_SIZE))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be at the instance level instead ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's better, I purposely made this parameter settable at the check level. I can move it to an instance level instead,

@yannmh yannmh modified the milestones: 5.6.0, 5.5.2 Oct 23, 2015
remh pushed a commit that referenced this pull request Nov 2, 2015
[snmp] customisable `oid_batch_size` batch size
@remh remh merged commit f82da94 into master Nov 2, 2015
@yannmh yannmh deleted the yann/snmp-custom-batch-size branch November 18, 2015 13:25
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

Successfully merging this pull request may close these issues.

2 participants