Command-line tool for NetBird Managed Service Providers to analyze billing usage and plans across all managed tenants.
- Analyze registered users vs billable users across all MSP tenants
- Display billing plan for each tenant (Team, Business)
- Generate human-readable text reports and structured JSON output
- Detailed user information including roles and last login times
- Secure API token handling via environment variables
One-line install (recommended):
curl -sSL https://raw.githubusercontent.com/SunsetDrifter/netbird-msp-billing-analyzer/main/install.sh | bashOptions:
--user- Install to user directory (no sudo required)--help- Show all installation options--uninstall- Remove installation
Features: ✅ Auto-installs dependencies ✅ Works on macOS/Linux ✅ Manages PATH automatically
-
Get your NetBird API token:
- Log into your NetBird MSP dashboard
- Go to Team → Service Users → Create Service User → Create Access Token
- Generate a new API token with Admin permissions
-
Set the token:
export NETBIRD_API_TOKEN="your_token_here"
# Run the analyzer
netbird-msp-analyzer
# Or with inline token
NETBIRD_API_TOKEN="your_token_here" netbird-msp-analyzerThe script generates two types of reports with timestamps:
- Human-readable format with detailed analysis
- Tenant-by-tenant breakdown including billing plans
- User details and role distribution
- Executive summary
- Structured data for all tenants
- Individual user records
- Billing usage breakdown
- Tenant billing plans
{
"executive_summary": {
"total_tenants": 4,
"total_registered_users": 150,
"total_billable_users": 120
},
"tenant_details": [{
"tenant_info": {
"id": "tenant_id",
"name": "Tenant Name",
"billing_plan": "Team"
}
}]
}- Registered Users: Active, unblocked users in NetBird
- Billable Users: Users who connected during the current billing cycle
- Billing Plan: Current subscription tier (Team, Business)
- Compare registered vs billable users to understand actual usage
- Review billing plans across tenants for consistency
- Identify users who haven't logged in recently
- "jq not found": Install jq with
brew install jq(macOS) or your system's package manager - "Token not set": Ensure your
.envfile exists and containsNETBIRD_API_TOKEN=your_token - "Failed to fetch tenants": Check token permissions and NetBird API access
- "Plan detection failed": Verify token has billing subscription access permissions
- HTTP errors: Verify your API token is valid and has necessary permissions
- Never expose your API token in logs, scripts, or version control
- Rotate API tokens regularly according to your security policies
This tool is provided as-is for NetBird MSP customers. Ensure compliance with your NetBird service agreement.
Click to expand manual installation instructions
- Bash, curl, jq
- NetBird MSP account with API access
- Download:
curl -sSL https://raw.githubusercontent.com/SunsetDrifter/netbird-msp-billing-analyzer/main/netbird-msp-comprehensive.sh -o netbird-msp-analyzer - Make executable:
chmod +x netbird-msp-analyzer - Optionally move to PATH:
sudo mv netbird-msp-analyzer /usr/local/bin/ - Set API token:
export NETBIRD_API_TOKEN="your_token"
- NetBird API issues: Contact NetBird support
- Tool issues: Check the troubleshooting section