Skip to content

rConfig - SNMP Trap Handler Supervisor Management

3 mins V8 Pro

The SNMP Trap Handler allows rConfig to receive and process SNMP traps from your network devices. This guide covers how to manage the SNMP Trap Handler service using Supervisor for reliable, production deployment.

Ensure Supervisor is installed and running on your system. If rConfig was installed correctly, Supervisor should already be set up. If not contact support.

Before deploying with Supervisor, test the SNMP trap handler manually:

Terminal window
# Test with default settings
php artisan rconfig:snmp-trap-handler --host=0.0.0.0 --port=162 --daemon
# Test with custom settings
php artisan rconfig:snmp-trap-handler --host=192.168.1.100 --port=1162 --daemon
Section titled “Interactive Setup (Recommended for First-Time Users)”

Launch the interactive management interface:

Terminal window
php artisan rconfig:snmp-trap-supervisor

This will present you with a menu to:

  • 📦 Install service (add to supervisor)
  • 🗑️ Uninstall service (remove from supervisor)
  • 📊 Check service status
  • 🔄 Restart service
  • ❌ Exit

When installing, you’ll be prompted for basic settings:

  • Host: IP address to bind to (default: 0.0.0.0)
  • Port: SNMP trap port (default: 162)
  • Community: SNMP community string (default: public)

Select “Configure advanced settings?” to access additional options:

  • Timeout: SNMP timeout in seconds
  • Memory Limit: Memory limit in MB
  • Base Path: Application installation path
  • Supervisor Config Directory: Where to place the config file
Terminal window
# Install with defaults
php artisan rconfig:snmp-trap-supervisor install --force
# Install with custom settings
php artisan rconfig:snmp-trap-supervisor install \
--host=192.168.1.100 \
--port=1162 \
--community=private
Terminal window
# Check service status
php artisan rconfig:snmp-trap-supervisor status
# Restart the service
php artisan rconfig:snmp-trap-supervisor restart
# Uninstall the service
php artisan rconfig:snmp-trap-supervisor uninstall
Terminal window
# Via rConfig command
php artisan rconfig:snmp-trap-supervisor status
# Direct supervisor commands
supervisorctl status rconfig-snmp-trap
supervisorctl status # View all services
Terminal window
# Follow logs in real-time (recommended for troubleshooting)
supervisorctl tail -f rconfig-snmp-trap
# View recent log entries
supervisorctl tail rconfig-snmp-trap
# View error logs
supervisorctl tail rconfig-snmp-trap stderr
Terminal window
# Start the service
supervisorctl start rconfig-snmp-trap
# Stop the service
supervisorctl stop rconfig-snmp-trap
# Restart the service
supervisorctl restart rconfig-snmp-trap
# Reload supervisor configuration
supervisorctl reread
supervisorctl update

For detailed debugging, run the command manually with verbose output:

Terminal window
# Stop the supervisor service first
supervisorctl stop rconfig-snmp-trap
# Run manually for detailed output
php artisan rconfig:snmp-trap-handler --host=0.0.0.0 --port=162 --daemon

The service logs are automatically stored in:

  • Standard Output: storage/logs/snmp-trap-handler.log
  • Error Output: storage/logs/snmp-trap-handler-error.log

Once the service is running, test it by sending a test trap:

Terminal window
# Send a test SNMP v2c trap
snmptrap -v2c -c public 127.0.0.1:162 "" 1.3.6.1.4.1.9.9.43.2.0.1 \
1.3.6.1.4.1.9.9.43.1.1.1.0 s "Configuration changed by admin"

Monitor the logs to verify the trap is received and processed correctly.

  • Verify the base path exists and contains the Laravel application
  • Check that the specified port is not already in use
  • Ensure proper permissions for the user running the service
  • Use a higher port number (e.g., 1162) or run as root
  • Configure your network devices to send traps to the alternative port
  • Check error logs: supervisorctl tail rconfig-snmp-trap stderr
  • Verify memory limits are appropriate for your environment
  • Review application logs for PHP errors

For complex issues or advanced configuration needs, please contact rConfig support.