A flexible SNMP trap sender system that allows monitoring system metrics and sending SNMP traps based on configurable rules.
- Configurable OID root for all traps
 - Multiple SNMP trap receivers support
 - Flexible rule system for monitoring system metrics
 - Support for both string and integer values
 - Threshold-based monitoring with warning and critical levels
 - Automatic OID file generation for SNMP receivers
 - YAML-based configuration
 
Download a precompiled binary release or build locally:
git clone https://github.com/your-org/qxip-snmp.git
cd qxip-snmp
bun installThe system is configured using a YAML file. See config.yaml for a complete example.
# Root OID for all traps
oidRoot: "1.3.6.1.4.1.12345"
# SNMP trap receivers
receivers:
  - id: "receiver1"
    host: "192.168.1.100"
    port: 162
    community: "public"
# Monitoring rules
rules:
  - id: "rule1"
    oid: "1.1"
    name: "Rule Name"
    type: "integer"  # or "string"
    command: "your-command"
    interval: 60
    thresholds:
      warning: 70
      critical: 90
    receivers: ["receiver1"]- Start the SNMP trap sender:
 
bun src/index.js- Generate OID file for SNMP receivers:
 
bun src/index.js --generate-oidEach rule in the configuration defines:
id: Unique identifier for the ruleoid: OID suffix to append to root OIDname: Human-readable name for the OIDtype: Type of value to return ("string" or "integer")command: System command to executeinterval: Check interval in secondsthresholds: Optional thresholds for integer valueswarning: Warning threshold valuecritical: Critical threshold value
receivers: List of receiver IDs to send traps to
The system can generate an SNMP MIB file that can be loaded on SNMP receivers. The generated file includes:
- Module identity
 - Trap definitions
 - Object type definitions
 - Severity level objects (for rules with thresholds)
 
MIT

