Skip to content

Snmp#52

Open
thegranduke wants to merge 4 commits intoTaurine-Technology:snmpfrom
thegranduke:snmp
Open

Snmp#52
thegranduke wants to merge 4 commits intoTaurine-Technology:snmpfrom
thegranduke:snmp

Conversation

@thegranduke
Copy link
Copy Markdown
Contributor

Overview
This PR implements the foundational SNMP monitoring system for SDN Launch Control, establishing the data collection infrastructure for monitoring network devices via SNMPv2c. This is Phase 1 of a multi-phase implementation that will eventually include automated polling, API endpoints, and UI integration.
Status: ~60% Complete (Core utilities and orchestrator implemented; Celery tasks and API endpoints pending)

- Add comprehensive SNMP communication layer in utilities.py
- Implement low-level SNMP GET/WALK operations using pysnmp 7.x Slim API
- Add high-level metric collection functions:
  - get_device_metrics(): collects CPU, memory, uptime (vendor-aware)
  - get_interface_statistics(): collects per-interface bytes/packets/errors
- Implement poll_snmp_device() orchestrator for Django ORM integration
- Add vendor-specific OID dictionary (MikroTik, Ubiquiti, extensible)
- Wrap async pysnmp API with asyncio.run() for synchronous Celery compatibility

Technical details:
- Update pysnmp from pysnmp-lextudio 6.3.0 to official pysnmp 7.1.22
- Use pysnmp.hlapi.v1arch.Slim API for SNMPv2c operations
- Comprehensive error handling with timeout management
- Full type hints and docstrings on all functions
- Follows existing device_monitoring patterns for consistency

Data flow:
SNMPDevice (config) → poll_snmp_device() → SNMP helpers →
SNMPMetrics + SNMPInterfaceStats (database) → Device status updated

This establishes the foundation for automated SNMP polling and monitoring.
…tation

- Add SNMP_TESTING.md: step-by-step testing guide with troubleshooting
- Add STEP1_COMPLETE.md: low-level SNMP utilities documentation
- Add STEPS_2_AND_3_COMPLETE.md: complete implementation summary with data flow diagrams

Documentation covers:
- Test script usage and expected outputs
- Common issues and solutions (timeouts, connectivity, vendor OIDs)
- API usage examples for all SNMP functions
- Implementation status and what works/doesn't work yet
- Architecture decisions and technical achievements
- Next steps for Celery tasks and API endpoints

Provides clear guidance for testing, debugging, and extending the SNMP integration.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 1, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- snmp_monitoring/tasks.py: poll_single_snmp_device + poll_all_snmp_devices
- snmp_monitoring/views.py: SNMPDevice/Metrics/InterfaceStats endpoints + aggregation
- snmp_monitoring/serializers.py: serializers (community_string write-only)
- snmp_monitoring/urls.py + control_center/urls.py: add router + mount API
- Add Django admin registration for SNMP models
- Remove unused imports in tests.py
- Add missing newlines at end of files
- Fix whitespace issues in migration files
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.

1 participant