SMS Notifications
SMS notifications provide immediate, direct alerts for critical monitoring events via text messages. This integration uses Twilio’s SMS service to ensure you receive urgent alerts even when you’re away from your computer.
Quick Setup
Section titled “Quick Setup”-
Set Up Twilio Account
- Create a Twilio account at twilio.com
- Verify your phone number
- Purchase a Twilio phone number
- Note your Account SID and Auth Token
-
Configure in 9n9s
- Go to Organization Settings > Notification Channels
- Click “Add Channel” → “SMS”
- Enter your Twilio credentials and phone numbers
- Click “Create Channel”
-
Test SMS Delivery
- Click “Send Test SMS”
- Verify message is received on your phone
- Check message format and sender information
Prerequisites
Section titled “Prerequisites”Twilio Account Requirements
Section titled “Twilio Account Requirements”- Twilio Account: Free or paid Twilio account
- Phone Number: Twilio phone number for sending messages
- Verified Recipients: Phone numbers verified in Twilio (trial accounts)
- SMS Capability: Ensure your Twilio number supports SMS
9n9s Requirements
Section titled “9n9s Requirements”- Organization Admin: Admin role to configure notification channels
- Active Subscription: SMS notifications available on paid plans
- Rate Limits: Understand SMS costs and rate limiting
Setting Up Twilio Integration
Section titled “Setting Up Twilio Integration”Step 1: Configure Twilio Account
Section titled “Step 1: Configure Twilio Account”-
Create Twilio Account
- Sign up at console.twilio.com
- Complete phone number verification
- Access your Twilio Console Dashboard
-
Get Account Credentials
- Copy your Account SID from the dashboard
- Copy your Auth Token (click to reveal)
- Save these credentials securely
-
Purchase Phone Number
- Go to Phone Numbers → Manage → Buy a number
- Choose a number with SMS capabilities
- Complete the purchase
- Note the purchased phone number
-
Verify Recipient Numbers (Trial Accounts)
- Go to Phone Numbers → Manage → Verified Caller IDs
- Add and verify each phone number that will receive SMS alerts
- Complete verification process for each number
Step 2: Add SMS Channel in 9n9s
Section titled “Step 2: Add SMS Channel in 9n9s”-
Navigate to Notification Channels
- Log into app.9n9s.com
- Go to Organization Settings
- Click “Notification Channels”
-
Create SMS Channel
- Click “Add Channel” button
- Select “SMS” from integration types
- Enter Twilio configuration details
-
SMS Configuration
- Channel Name: “Critical SMS Alerts” (internal reference)
- Provider: Twilio (currently the only supported provider)
- Account SID: Your Twilio Account SID
- Auth Token: Your Twilio Auth Token
- From Number: Your Twilio phone number (with country code)
- To Numbers: Recipient phone numbers (comma-separated)
Step 3: Configure Message Settings
Section titled “Step 3: Configure Message Settings”-
Message Format
- Template: Choose concise, informative message template
- Character Limit: SMS messages limited to 160 characters
- Critical Info Only: Include only essential alert information
- URL Shortening: Automatic shortening of monitor links
-
Delivery Options
- Rate Limiting: Control SMS frequency to manage costs
- Quiet Hours: Suppress non-critical SMS during specified times
- Emergency Override: Allow critical alerts during quiet hours
- Duplicate Prevention: Avoid sending duplicate messages
Message Format and Limitations
Section titled “Message Format and Limitations”SMS Character Limits
Section titled “SMS Character Limits”SMS messages have strict character limitations:
- Standard SMS: 160 characters maximum
- Long SMS: Split into multiple messages (additional cost)
- Unicode Characters: Reduce limit to 70 characters
- Cost Consideration: Each message segment costs separately
Message Templates
Section titled “Message Templates”Critical Alert Template (Short):
🚨 CRITICAL: {{monitor.name}} DOWN{{incident.duration}}{{links.short_url}}Standard Alert Template:
⚠️ {{monitor.name}} is {{monitor.status}}Duration: {{incident.duration}}Env: {{tags.environment}}View: {{links.short_url}}Recovery Template:
✅ RESOLVED: {{monitor.name}} is UPDowntime: {{incident.total_duration}}Smart Message Compression
Section titled “Smart Message Compression”9n9s automatically optimizes SMS content:
- Abbreviations: Common terms shortened (e.g., “prod” for “production”)
- URL Shortening: Monitor links automatically shortened
- Priority Content: Most important information prioritized
- Multiple Recipients: Same message sent to all configured numbers
Advanced Configuration
Section titled “Advanced Configuration”Multiple Recipient Management
Section titled “Multiple Recipient Management”Configure different phone numbers for different alert types:
sms_routing: critical_alerts: numbers: ["+1234567890", "+1987654321"] # Primary and backup conditions: ["criticality:critical", "status:DOWN"]
business_hours: numbers: ["+1234567890"] # Primary contact only conditions: ["time:09:00-17:00"]
after_hours: numbers: ["+1987654321"] # On-call contact conditions: ["time:17:00-09:00", "criticality:high"]Cost Management
Section titled “Cost Management”SMS notifications can incur costs. Manage expenses with:
-
Rate Limiting
- Maximum messages per hour
- Burst protection for incident storms
- Cost budgets and alerts
-
Smart Filtering
- Only critical alerts via SMS
- Use escalation (Slack → Email → SMS)
- Deduplication to prevent spam
-
Geographic Considerations
- International SMS costs higher
- Local Twilio numbers reduce costs
- Consider regional Twilio services
Twilio Configuration
Section titled “Twilio Configuration”Production Configuration:
{ "account_sid": "AC1234567890abcdef1234567890abcdef", "auth_token": "your-auth-token", "from_number": "+1234567890", "to_numbers": ["+1987654321", "+1555123456"], "message_service_sid": "MG1234567890abcdef1234567890abcdef", "rate_limit": { "per_minute": 3, "per_hour": 10, "per_day": 50 }, "quiet_hours": { "enabled": true, "start": "22:00", "end": "08:00", "timezone": "America/New_York", "emergency_override": true }}International SMS
Section titled “International SMS”For international recipients:
-
Phone Number Format
- Always include country code (e.g., +44 for UK)
- Use E.164 format (+1234567890)
- Verify numbers are SMS-capable
-
Regulatory Compliance
- Check local SMS regulations
- Some countries require opt-in consent
- Consider business vs. personal numbers
-
Cost Considerations
- International rates vary significantly
- Consider local Twilio numbers
- Review Twilio’s international pricing
Security and Compliance
Section titled “Security and Compliance”Phone Number Protection
Section titled “Phone Number Protection”-
Data Security
- Phone numbers encrypted at rest
- Secure transmission to Twilio
- Regular credential rotation
-
Access Control
- Limit who can configure SMS channels
- Audit trail for phone number changes
- Approval process for new recipients
Privacy Considerations
Section titled “Privacy Considerations”-
Consent Management
- Obtain explicit consent for SMS alerts
- Provide opt-out mechanisms
- Document consent for compliance
-
Data Minimization
- Include only necessary information
- Avoid sensitive data in SMS
- Use monitor IDs instead of detailed info
Regulatory Compliance
Section titled “Regulatory Compliance”-
TCPA Compliance (US)
- Obtain prior express consent
- Provide clear opt-out instructions
- Maintain consent records
-
GDPR Compliance (EU)
- Lawful basis for processing
- Data subject rights
- Cross-border transfer considerations
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”SMS Not Delivered:
-
Twilio Account Issues
- Verify Account SID and Auth Token
- Check Twilio account balance
- Ensure phone number is active
-
Phone Number Problems
- Verify recipient number format (+1234567890)
- Check if number is SMS-capable
- Verify number with carrier
-
Regulatory Blocks
- Check if carrier blocks automated SMS
- Verify sender number is not blacklisted
- Review content for spam triggers
Delayed Delivery:
-
Carrier Delays
- SMS delivery can take several minutes
- Network congestion affects delivery
- International messages may be slower
-
Rate Limiting
- Check 9n9s rate limiting settings
- Review Twilio rate limits
- Verify message queue status
High Costs:
-
Message Optimization
- Review message templates for length
- Enable message compression
- Use abbreviations and short URLs
-
Frequency Control
- Implement proper rate limiting
- Use escalation instead of immediate SMS
- Monitor usage and costs regularly
Twilio Error Codes
Section titled “Twilio Error Codes”Common Twilio error responses:
20003: Authentication Error - Invalid credentials21211: Invalid To Number - Phone number format issue21614: To number not verified - Trial account restriction30001: Message Queue Full - Too many messages queued30002: Account Suspended - Twilio account issue
Testing and Validation
Section titled “Testing and Validation”Test your SMS integration:
# Test via Twilio API directlycurl -X POST "https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Messages.json" \ --data-urlencode "From=+1234567890" \ --data-urlencode "To=+1987654321" \ --data-urlencode "Body=Test message from 9n9s" \ -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKENBest Practices
Section titled “Best Practices”Message Design
Section titled “Message Design”-
Concise Content
- Lead with most important information
- Use abbreviations where clear
- Include only essential details
-
Actionable Information
- Include monitor name and status
- Add short URL for details
- Specify urgency level
Cost Optimization
Section titled “Cost Optimization”-
Strategic Use
- Reserve SMS for critical alerts only
- Use other channels for warnings
- Implement escalation chains
-
Message Efficiency
- Optimize templates for character count
- Use URL shorteners
- Avoid Unicode characters when possible
Reliability
Section titled “Reliability”-
Multiple Recipients
- Configure backup phone numbers
- Use different carriers if possible
- Test delivery regularly
-
Monitoring SMS Health
- Track delivery success rates
- Monitor Twilio account status
- Set up backup notification methods
Integration Patterns
Section titled “Integration Patterns”-
Escalation Chain
Monitor Failure → Slack (immediate)→ Email (2 minutes)→ SMS (5 minutes)→ Phone Call (10 minutes) -
Time-Based Routing
Business Hours: Slack + EmailAfter Hours: SMS + EmailWeekends: SMS only (critical)
SMS notifications ensure you receive critical alerts immediately, regardless of your location or internet connectivity. Use them strategically for the most important alerts to balance urgency with cost-effectiveness.