Grafana dashboards for Vicidial® — operational visibility
Vicidial® has decent built-in real-time stats, but the views are HTML pages designed for individual agents/supervisors, not for "what's the state of the whole call center right now" wall displays. Grafana fills that gap — pull from Vicidial's MariaDB directly, build dashboards for queue lengths, agents available, drops per hour, abandons, calls per agent.
The data sources
Vicidial stores everything operational in its MariaDB database. Key tables:
vicidial_live_agents— every agent currently logged in, their state (READY, INCALL, PAUSED).vicidial_auto_calls— calls currently being dialed by the predictive engine.vicidial_closer_log— historical call records, dispositions, talk time, wait time.vicidial_log— historical outbound call detail.vicidial_drop_log— abandoned/dropped calls (the FCC-regulated 3% number).vicidial_lists— list metadata.
Grafana can query MariaDB directly; no Prometheus exporter or middleware needed for basic dashboards.
Grafana install
# Easiest: Docker on the Vicidial VPS or a separate one
docker run -d --name=grafana -p 3000:3000 \
-v /opt/grafana/data:/var/lib/grafana \
grafana/grafana
Reverse proxy + TLS as usual. Initial login admin/admin, change immediately.
Wiring the MariaDB data source
In Grafana, Configuration → Data Sources → Add → MySQL.
- Host: 127.0.0.1:3306 (or whatever the Vicidial DB host is)
- Database: asterisk
- User: dedicated read-only user (don't reuse Vicidial's app user)
- Password: that user's password
Create the read-only user on the Vicidial DB first:
mysql -u root
CREATE USER 'grafana'@'localhost' IDENTIFIED BY 'STRONG_PW';
GRANT SELECT ON asterisk.* TO 'grafana'@'localhost';
FLUSH PRIVILEGES;
Key panel queries
Agents currently logged in:
SELECT COUNT(*) FROM vicidial_live_agents WHERE last_update_time > NOW() - INTERVAL 30 SECOND;
Agents in each state:
SELECT status, COUNT(*) FROM vicidial_live_agents
WHERE last_update_time > NOW() - INTERVAL 30 SECOND
GROUP BY status;
Calls dialed per hour today:
SELECT DATE_FORMAT(call_date, '%H:00') AS hour, COUNT(*) AS calls
FROM vicidial_log
WHERE call_date >= CURDATE()
GROUP BY hour
ORDER BY hour;
Drops today (TCPA-critical):
SELECT COUNT(*) FROM vicidial_drop_log WHERE drop_date >= CURDATE();
-- Drop rate as %
SELECT (SELECT COUNT(*) FROM vicidial_drop_log WHERE drop_date >= CURDATE()) /
(SELECT COUNT(*) FROM vicidial_log WHERE call_date >= CURDATE() AND status IN ('A','PU','PR')) * 100;
Avg talk time, last 24 hours, per campaign:
SELECT campaign_id, AVG(length_in_sec) AS avg_talk_secs
FROM vicidial_log
WHERE call_date > NOW() - INTERVAL 24 HOUR AND status = 'A'
GROUP BY campaign_id;
Dashboard suggestions
Build separate dashboards for different audiences:
- Supervisor real-time: agents by state (pie chart), live queue depth, current drop rate, avg wait time. Refreshes every 5 seconds.
- Daily summary: calls per hour, calls per agent, dispositions breakdown, list penetration rate, hour-of-day patterns. Refreshes every 5 minutes.
- Compliance: drop rate vs 3% FCC ceiling (large alert if breached), per-state call volume, time-zone violation count (calls outside allowed hours per recipient state). Hourly refresh.
- Trends: 30-day rolling drop rate, list-penetration over time, agents-per-call ratio. Daily refresh.
Alerting
Grafana's built-in alerting (Settings → Alerting) can fire when:
- Drop rate exceeds 2.5% (early warning before 3% violation).
- No agents have been READY for > 5 minutes (nobody logged in / something broken).
- Asterisk® live channels drop to 0 during business hours (Asterisk crashed).
- Database connection fails (Vicidial wouldn't work either; you'd find out fast).
Push alerts to email, Slack, PagerDuty, or a webhook. See the alerting article in the linux-vps category for the integration patterns.
Resource sizing
Grafana itself is small (200 MB RAM). The DB queries are the cost — most are well-indexed in Vicidial's schema, but make sure the dashboard panels' refresh rates aren't too aggressive on a busy production call center. 5-second refresh on a 10-panel real-time dashboard equals 600 queries/minute against the database — keep an eye on MariaDB CPU.
Also Read
Powered by WHMCompleteSolution