Skip to content

Commit 09469ce

Browse files
authored
Merge pull request #3 from tosumitdhaka/mib_browser_update
Version 1.2.0
2 parents 92d6026 + 97dd83b commit 09469ce

19 files changed

Lines changed: 2540 additions & 91 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ TRAP_PORT=1162
1010

1111
# Application
1212
APP_NAME=Trishul-SNMP
13-
APP_VERSION=1.1.7
13+
APP_VERSION=1.2.0
1414
APP_AUTHOR=Sumit Dhaka
1515
APP_DESCRIPTION=Professional SNMP Utilities
1616

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
backend/data*
22
.venv*
33
.vscode*
4+
*.tmp*

README.md

Lines changed: 102 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![License](https://img.shields.io/github/license/tosumitdhaka/trishul-snmp?style=for-the-badge)](LICENSE)
99
[![Docker Pulls](https://img.shields.io/docker/pulls/tosumitdhaka/trishul-snmp-backend?style=for-the-badge)](https://github.com/tosumitdhaka/trishul-snmp/pkgs/container/trishul-snmp-backend)
1010

11-
A web-based SNMP toolkit for network engineers and administrators. Simulate SNMP agents, send/receive traps, walk devices with MIB resolution, and manage MIB files—all from a clean, intuitive interface.
11+
A web-based SNMP toolkit for network engineers and administrators. Simulate SNMP agents, send/receive traps, walk devices with MIB resolution, browse MIB trees, and manage MIB files—all from a clean, intuitive interface.
1212

1313
**Replace 5+ SNMP tools with one modern platform**
1414

@@ -19,7 +19,8 @@ A web-based SNMP toolkit for network engineers and administrators. Simulate SNMP
1919
- 🖥️ **SNMP Simulator** - Run configurable SNMP agent with custom OID values
2020
- 🚶 **Walk & Parse** - Execute SNMP walks with MIB resolution, export to JSON/CSV
2121
- 📡 **Trap Manager** - Send/receive SNMP traps with real-time monitoring
22-
- 📚 **MIB Manager** - Upload, validate MIBs, browse traps, auto-resolve OIDs with dependency detection
22+
- 📚 **MIB Manager** - Upload, validate MIBs, browse trap library, auto-resolve OIDs with dependency detection
23+
- 🌳 **MIB Browser** - Interactive tree explorer with hierarchical OID navigation, search, and filtering
2324
- 🔐 **Secure** - Session-based authentication with credential management
2425
- 🐳 **Containerized** - One-command Docker deployment with host network support
2526
- 🌐 **Modern UI** - Clean, responsive interface built with Bootstrap 5
@@ -32,7 +33,7 @@ A web-based SNMP toolkit for network engineers and administrators. Simulate SNMP
3233

3334
**Net-SNMP CLI tools** → Web UI with no command memorization
3435
**snmpsim** → Custom OID simulator with web interface
35-
**iReasoning MIB Browser ($500)** → Free MIB browser and validator
36+
**iReasoning MIB Browser ($500)** → Free MIB browser with tree navigation
3637
**snmptrapd** → Real-time trap receiver with web display
3738
**Custom scripts** → Built-in JSON/CSV export functionality
3839
**Multiple scattered tools** → One unified platform
@@ -109,6 +110,55 @@ BACKEND_PORT=9000 FRONTEND_PORT=3000 ./install-trishul-snmp.sh up
109110

110111
---
111112

113+
## 🧩 Component Overview
114+
115+
### 🖥️ **SNMP Simulator**
116+
Run a configurable SNMP agent on UDP port 1061 with custom OID values. Perfect for testing SNMP clients without real hardware.
117+
- **Custom OIDs** - Define any OID with custom values and types
118+
- **SNMPv1/v2c** - Support for community-based authentication
119+
- **Persistent data** - OID values survive restarts
120+
- **Web control** - Start/stop agent from dashboard
121+
122+
### 🚶 **Walk & Parse**
123+
Execute SNMP walks against any device with automatic MIB resolution and data export.
124+
- **MIB resolution** - Converts numeric OIDs to human-readable names
125+
- **Bulk operations** - Walk entire MIB trees efficiently
126+
- **Export formats** - JSON and CSV export for analysis
127+
- **History** - View previous walk results
128+
129+
### 📡 **Trap Manager**
130+
Send and receive SNMP traps with real-time monitoring and MIB-based trap browsing.
131+
- **Trap sender** - Send v1/v2c traps with custom varbinds
132+
- **Trap receiver** - Real-time trap display on UDP port 1162
133+
- **Trap library** - Browse 24+ available traps from loaded MIBs
134+
- **Auto-populate** - Select trap from library to auto-fill varbinds
135+
136+
### 🌳 **MIB Browser**
137+
Interactive tree explorer for navigating OID hierarchies and understanding MIB structures.
138+
- **Dual views** - Browse by module or standard OID hierarchy
139+
- **Real-time search** - Find OIDs by name, numeric OID, or description
140+
- **Smart filtering** - Filter by module and type (scalars, tables, notifications)
141+
- **Tree navigation** - Expandable hierarchy with configurable depth (1-5 levels)
142+
- **Details panel** - View full metadata, descriptions, and varbinds
143+
- **Integration** - Jump to Walker or Trap Sender with pre-filled data
144+
- **State persistence** - Remembers your position across page switches
145+
146+
### 📚 **MIB Manager**
147+
Upload, validate, and manage MIB files with automatic dependency resolution.
148+
- **Upload MIBs** - Drag-and-drop or file selection
149+
- **Validation** - Automatic syntax checking and dependency detection
150+
- **Trap enumeration** - Lists all notification types per MIB
151+
- **Statistics** - View object counts, imports, and trap counts
152+
- **Delete/Reload** - Manage MIB lifecycle with hot-reload
153+
154+
### 🔐 **Settings**
155+
Manage authentication and system preferences.
156+
- **Credentials** - Change admin password
157+
- **Session management** - Secure token-based authentication
158+
- **System info** - View version and configuration
159+
160+
---
161+
112162
## 🔧 Configuration
113163

114164
### Environment Variables
@@ -174,11 +224,11 @@ docker-compose build
174224

175225
## 👥 Best For
176226

177-
- 🔧 **Network engineers** testing devices
227+
- 🔧 **Network engineers** testing devices and exploring MIB structures
178228
- 🚀 **DevOps teams** testing SNMP integrations
179-
- 📚 **Students** learning SNMP protocols
180-
-**QA teams** validating implementations
181-
- 👥 **Small teams** needing trap monitoring
229+
- 📚 **Students** learning SNMP protocols and MIB hierarchies
230+
-**QA teams** validating SNMP implementations
231+
- 👥 **Small teams** needing trap monitoring and MIB browsing
182232
- 🧪 **Developers** building SNMP-enabled applications
183233

184234
---
@@ -267,7 +317,19 @@ Thank you to all our supporters! Your contributions help maintain and improve Tr
267317

268318
## 📝 Changelog
269319

270-
### v1.1.7 (Current)
320+
### v1.2.0 (Current) - MIB Browser Release 🌳
321+
-**NEW: MIB Browser** - Interactive tree explorer with dual view modes
322+
-**Tree Navigation** - Expandable OID hierarchy with configurable depth (1-5 levels)
323+
-**Smart Search** - Real-time search by name, OID, or description
324+
-**Advanced Filtering** - Filter by module and object type (scalars, tables, notifications)
325+
-**Detailed Panel** - Compact metadata display with breadcrumb navigation
326+
-**Seamless Integration** - Jump to Walker/Trap Sender with pre-filled data
327+
-**Trap Library** - Enhanced trap manager
328+
- 🐛 **Fixed** - MIB delete function error handling
329+
- 🐛 **Fixed** - Trap count consistency across dashboard, manager, and browser
330+
- 🎨 **Dashboard** - Added MIB Browser card
331+
332+
### v1.1.7
271333
- ✅ Rebranded to Trishul-SNMP
272334
- ✅ Improved documentation and contributing guidelines
273335

@@ -310,7 +372,7 @@ Thank you to all our supporters! Your contributions help maintain and improve Tr
310372

311373
## 🏷️ Keywords
312374

313-
`snmp` `snmp-simulator` `snmp-trap` `mib-browser` `network-management` `network-monitoring` `snmpwalk` `snmptrap` `docker` `fastapi` `python` `devops` `sysadmin` `netops` `open-source` `self-hosted` `monitoring` `observability` `infrastructure` `network-tools`
375+
`snmp` `snmp-simulator` `snmp-trap` `mib-browser` `mib-tree` `oid-explorer` `network-management` `network-monitoring` `snmpwalk` `snmptrap` `docker` `fastapi` `python` `devops` `sysadmin` `netops` `open-source` `self-hosted` `monitoring` `observability` `infrastructure` `network-tools`
314376

315377
---
316378

@@ -333,6 +395,8 @@ Thank you to all our supporters! Your contributions help maintain and improve Tr
333395
| **Send Traps** | ✅ CLI | ✅ GUI | ✅ Web + MIB Browse |
334396
| **Receive Traps** | ✅ CLI || ✅ Web + Real-time |
335397
| **MIB Manager** | ✅ CLI | ✅ GUI | ✅ Web + Validate |
398+
| **MIB Browser** || ✅ GUI | ✅ Web + Tree Nav |
399+
| **OID Search** ||| ✅ Real-time |
336400
| **Export JSON/CSV** ||||
337401
| **Web-Based** ||||
338402
| **Docker Deploy** ||||
@@ -344,6 +408,7 @@ Thank you to all our supporters! Your contributions help maintain and improve Tr
344408
## 🎓 Learning Resources
345409

346410
- 📖 [SNMP Basics Tutorial](https://github.com/tosumitdhaka/trishul-snmp/wiki/SNMP-Basics) *(coming soon)*
411+
- 📖 [MIB Browser Guide](https://github.com/tosumitdhaka/trishul-snmp/wiki/MIB-Browser-Guide) *(coming soon)*
347412
- 🎥 [Video Tutorials](https://www.youtube.com/@tosumitdhaka) *(coming soon)*
348413
- 📝 [Blog Posts](https://dev.to/tosumitdhaka) *(coming soon)*
349414
- 💬 [Community Discord](https://discord.gg/tosumitdhaka) *(coming soon)*
@@ -364,7 +429,7 @@ MIT License - See [LICENSE](LICENSE) file for details.
364429
- SNMP implementation by [pysnmp](https://github.com/etingof/pysnmp)
365430
- MIB parsing by [pysmi](https://github.com/etingof/pysmi)
366431
- UI powered by [Bootstrap 5](https://getbootstrap.com/)
367-
- Icons by [Bootstrap Icons](https://icons.getbootstrap.com/)
432+
- Icons by [Font Awesome](https://fontawesome.com/) & [Bootstrap Icons](https://icons.getbootstrap.com/)
368433

369434
---
370435

@@ -403,18 +468,33 @@ Deploy on your own infrastructure using the one-command installer or Docker Comp
403468

404469
## 🎯 Roadmap
405470

406-
- [ ] Full MIB tree browser
407-
- [ ] View OID descriptions and syntax
408-
- [ ] Search OIDs across MIBs
409-
- [ ] SNMPv3 authentication support
410-
- [ ] Scheduled SNMP walks
411-
- [ ] Email/Slack/Webhook notifications
412-
- [ ] Custom dashboard widgets
413-
- [ ] API rate limiting and keys
414-
- [ ] Bulk device management
415-
- [ ] Historical data retention
416-
- [ ] Advanced trap filtering
417-
- [ ] Mobile-responsive improvements
471+
### ✅ Completed (v1.2.0)
472+
- [x] Full MIB tree browser with dual view modes
473+
- [x] Interactive OID navigation with expandable tree
474+
- [x] Search OIDs across MIBs with real-time results
475+
- [x] View OID descriptions, syntax, and metadata
476+
- [x] Filter by module and object type
477+
- [x] Seamless integration with Walker and Trap Sender
478+
- [x] State persistence across page switches
479+
- [x] Configurable expansion depth (1-5 levels)
480+
481+
### 🚧 In Progress
482+
- [ ] SNMPv3 authentication support (MD5, SHA, AES)
483+
- [ ] Scheduled SNMP walks with cron-like syntax
484+
- [ ] Email/Slack/Webhook notifications for traps
485+
486+
### 📋 Planned
487+
- [ ] Custom dashboard widgets with drag-and-drop
488+
- [ ] API rate limiting and authentication keys
489+
- [ ] Bulk device management (import/export CSV)
490+
- [ ] Historical data retention with time-series graphs
491+
- [ ] Advanced trap filtering with regex support
492+
- [ ] Mobile-responsive improvements for tablets
493+
- [ ] Dark mode theme
494+
- [ ] Multi-language support (i18n)
495+
- [ ] SNMP SET operations in Walker
496+
- [ ] MIB compiler for custom MIBs
497+
- [ ] Export MIB tree to PDF/PNG
418498

419499
See [Issues](https://github.com/tosumitdhaka/trishul-snmp/issues) for detailed roadmap and vote on features!
420500

backend/api/routers/browser.py

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
import logging
2+
from typing import Optional
3+
from fastapi import APIRouter, HTTPException, Query
4+
from services.mib_service import get_mib_service
5+
6+
router = APIRouter(prefix="/mibs/browse", tags=["MIB Browser"])
7+
logger = logging.getLogger(__name__)
8+
9+
10+
@router.get("/modules")
11+
def list_modules():
12+
"""List all MIB modules with statistics"""
13+
try:
14+
mib_service = get_mib_service()
15+
modules = mib_service.get_module_stats()
16+
17+
return {"modules": modules}
18+
19+
except Exception as e:
20+
logger.error(f"Failed to list modules: {e}")
21+
raise HTTPException(status_code=500, detail=str(e))
22+
23+
24+
@router.get("/tree/module")
25+
def get_module_tree(module: Optional[str] = None):
26+
"""
27+
Get tree organized by modules
28+
29+
Args:
30+
module: Filter by specific module (optional)
31+
32+
Returns:
33+
List of module trees with their root objects
34+
"""
35+
try:
36+
mib_service = get_mib_service()
37+
tree = mib_service.get_module_tree(module)
38+
39+
return {
40+
"view": "module",
41+
"modules": tree,
42+
"count": len(tree)
43+
}
44+
45+
except Exception as e:
46+
logger.error(f"Failed to get module tree: {e}")
47+
raise HTTPException(status_code=500, detail=str(e))
48+
49+
50+
@router.get("/tree/oid")
51+
def get_oid_tree(
52+
root_oid: str = Query("1.3.6.1", description="Starting OID"),
53+
depth: int = Query(1, ge=1, le=5, description="Expansion depth"),
54+
module: Optional[str] = Query(None, description="Filter by module")
55+
):
56+
"""
57+
Get OID tree starting from root_oid
58+
59+
Args:
60+
root_oid: Starting OID (default: 1.3.6.1 = internet)
61+
depth: How many levels to expand (1-5)
62+
module: Filter by MIB module
63+
64+
Returns:
65+
Tree structure with root and children
66+
"""
67+
try:
68+
mib_service = get_mib_service()
69+
tree = mib_service.get_oid_tree(root_oid, depth, module)
70+
71+
return tree
72+
73+
except ValueError as e:
74+
raise HTTPException(status_code=400, detail=str(e))
75+
except Exception as e:
76+
logger.error(f"Failed to get OID tree: {e}")
77+
raise HTTPException(status_code=500, detail=str(e))
78+
79+
80+
@router.get("/node/{oid:path}")
81+
def get_node_details(oid: str):
82+
"""
83+
Get detailed information about a specific OID node
84+
"""
85+
try:
86+
mib_service = get_mib_service()
87+
details = mib_service.get_node_details(oid_identifier=oid)
88+
89+
# If it's a notification, get associated objects
90+
node = details["node"]
91+
if node.get("type") == "NotificationType":
92+
# Get trap details from list_traps
93+
trap_details = mib_service.get_trap_details(oid)
94+
if trap_details:
95+
details["trap_objects"] = trap_details.get("objects", [])
96+
97+
return details
98+
99+
except ValueError as e:
100+
raise HTTPException(status_code=404, detail=str(e))
101+
except Exception as e:
102+
logger.error(f"Failed to get node details for {oid}: {e}")
103+
raise HTTPException(status_code=500, detail=str(e))
104+
105+
106+
@router.get("/search")
107+
def search_oids(
108+
query: str = Query(..., min_length=2, description="Search term"),
109+
limit: int = Query(100, ge=1, le=500, description="Max results"),
110+
module: Optional[str] = Query(None, description="Filter by module"),
111+
type_filter: Optional[str] = Query(None, description="Filter by node type")
112+
):
113+
"""
114+
Search OIDs by name, description, or numeric OID
115+
116+
Args:
117+
query: Search term (minimum 2 characters)
118+
limit: Maximum number of results (1-500)
119+
module: Filter by MIB module
120+
type_filter: Filter by node type (MibScalar, MibTable, MibTableColumn, NotificationType, etc.)
121+
122+
Returns:
123+
Search results with count
124+
"""
125+
try:
126+
mib_service = get_mib_service()
127+
results = mib_service.search_oids(query, limit, module, type_filter)
128+
129+
return results
130+
131+
except Exception as e:
132+
logger.error(f"Search failed for query '{query}': {e}")
133+
raise HTTPException(status_code=500, detail=str(e))

backend/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from core.security import validate_auth
55
from core.logging import setup_logging
6-
from api.routers import simulator, walker, settings, traps, mibs
6+
from api.routers import simulator, walker, settings, traps, mibs, browser
77
from core.config import meta
88

99
setup_logging()
@@ -40,6 +40,7 @@ def health_check():
4040
app.include_router(simulator.router, prefix="/api", dependencies=[Depends(validate_auth)])
4141
app.include_router(walker.router, prefix="/api", dependencies=[Depends(validate_auth)])
4242
app.include_router(traps.router, prefix="/api", dependencies=[Depends(validate_auth)])
43+
app.include_router(browser.router, prefix="/api", dependencies=[Depends(validate_auth)])
4344
app.include_router(mibs.router, prefix="/api", dependencies=[Depends(validate_auth)])
4445
app.include_router(settings.router, prefix="/api")
4546

0 commit comments

Comments
 (0)