How to Monitor CI/CD Pipeline Health on Linux
How to Monitor CI/CD Pipeline Health on Linux
Need to monitor CI/CD pipeline health on your Linux server? Want to track pipeline execution, monitor build success rates, and detect pipeline failures? This guide shows you how to monitor CI/CD pipeline health using pipeline APIs and set up automated monitoring with Zuzia.app.
For comprehensive CI/CD monitoring strategies, see CI/CD Pipeline Health Monitoring Guide. For troubleshooting CI/CD issues, see CI/CD Pipeline Failures.
Why Monitoring CI/CD Pipeline Health Matters
CI/CD pipeline health monitoring helps you detect pipeline failures immediately, track build success rates, monitor deployment status, ensure reliable automation, and respond quickly to pipeline issues. Regular health monitoring prevents deployment failures from going undetected.
Method 1: Check Pipeline Execution Status
Monitor pipeline runs:
Check Pipeline Status
# Check Jenkins pipeline status (if using Jenkins)
curl -s http://jenkins:8080/api/json | jq '.jobs[] | {name: .name, color: .color}'
# Check GitLab CI pipeline status (if using GitLab CI)
curl -s --header "PRIVATE-TOKEN: token" https://gitlab.com/api/v4/projects/PROJECT_ID/pipelines | jq '.[0] | {status: .status, ref: .ref}'
# Check GitHub Actions status (if using GitHub Actions)
# Requires GitHub API access
curl -s -H "Authorization: token TOKEN" https://api.github.com/repos/OWNER/REPO/actions/runs | jq '.workflow_runs[0] | {status: .status, conclusion: .conclusion}'
# Monitor pipeline execution
watch -n 30 'curl -s http://jenkins:8080/api/json | jq ".jobs[] | .color"'
Pipeline status checking shows execution state.
Method 2: Monitor Build Success Rates
Track build success and failure rates:
Check Build Statistics
# Count successful builds (Jenkins example)
SUCCESSFUL=$(curl -s http://jenkins:8080/api/json | jq '.jobs[] | select(.color == "blue" or .color == "blue_anime")' | jq -s 'length')
echo "Successful builds: $SUCCESSFUL"
# Count failed builds
FAILED=$(curl -s http://jenkins:8080/api/json | jq '.jobs[] | select(.color == "red" or .color == "red_anime")' | jq -s 'length')
echo "Failed builds: $FAILED"
# Calculate success rate
TOTAL=$((SUCCESSFUL + FAILED))
if [ $TOTAL -gt 0 ]; then
SUCCESS_RATE=$(echo "scale=2; $SUCCESSFUL * 100 / $TOTAL" | bc)
echo "Build success rate: ${SUCCESS_RATE}%"
fi
Build statistics monitoring shows pipeline reliability.
Method 3: Monitor Pipeline Execution Time
Track pipeline duration:
Check Pipeline Duration
# Check last pipeline duration (Jenkins example)
LAST_BUILD=$(curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq '.duration')
echo "Last build duration: ${LAST_BUILD}ms"
# Calculate average build time
# (Requires historical data from Zuzia.app)
# Monitor build times
watch -n 60 'curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq ".duration"'
Pipeline duration monitoring shows execution performance.
Method 4: Check Pipeline Artifacts
Verify pipeline outputs:
Check Artifact Status
# List pipeline artifacts (Jenkins example)
curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq '.artifacts[] | .fileName'
# Check artifact availability
ARTIFACTS=$(curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq '.artifacts | length')
echo "Artifacts generated: $ARTIFACTS"
# Verify artifact integrity
# (Check artifact checksums or signatures)
Artifact checking verifies pipeline outputs.
Method 5: Automated CI/CD Pipeline Health Monitoring with Zuzia.app
Manual checks work while you are looking. To keep running them without you, Zuzia uses its agent and scheduled tasks.
How it works in Zuzia
- Install the Zuzia agent on the server with one command. CPU, RAM, disk, load and network metrics start reporting on their own, with alerts on a threshold, on drift from the server's normal, or on a disk fill-up forecast.
- Save the commands from this guide as a scheduled task and choose how often it runs, from every minute to once a year. The agent runs it on every host you pick.
- If a command fails, you get an alert right away by email, Slack, Discord, push (through your Pushover account) or SMS (through your Vonage account).
- The output of every run is kept, so you can look back at what changed. On paid plans, AI can read the output and alert you only when it spots a problem.
Setting it up
- Add the server in the Zuzia dashboard and install the agent.
- Create a scheduled task with the check commands below, then choose the hosts and how often it runs.
- Choose your notification channels. Turn on maintenance mode during planned work so it doesn't trigger alerts.
Best Practices for Monitoring CI/CD Pipeline Health
1. Monitor CI/CD Pipeline Health Continuously
Monitor CI/CD pipeline health every 5-15 minutes. Pipeline failures can occur at any time, so frequent monitoring helps detect issues immediately. Use Zuzia.app automated monitoring to monitor CI/CD pipeline health continuously without manual intervention.
2. Monitor Both Success Rates and Execution Time
Monitor at multiple levels: pipeline execution status, build success rates, execution time, and artifact generation. Comprehensive monitoring provides full visibility into pipeline health.
3. Track Pipeline Trends
Monitor pipeline health trends over time to identify degradation patterns. Use historical data to predict pipeline issues and plan pipeline improvements proactively.
4. Set Appropriate Alert Thresholds
Configure alerts based on your pipeline requirements. Warning at success rate < 95%, critical at success rate < 90%. Execution time: warning at > 2x average, critical at > 3x average.
5. Plan Pipeline Improvements
Use CI/CD pipeline health data for planning improvements. Analyze pipeline trends, identify bottlenecks, and plan pipeline optimizations.
Troubleshooting Common CI/CD Pipeline Health Issues
Pipeline Failures
If pipeline failures occur:
# Check pipeline status
curl -s http://jenkins:8080/api/json | jq '.jobs[] | select(.color == "red")'
# Review pipeline logs
# (Access pipeline logs through CI/CD system)
# Check build artifacts
curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq '.artifacts'
# Investigate failure cause
Pipeline failures require investigation and resolution.
High Execution Times
If execution times are high:
# Check pipeline duration
curl -s http://jenkins:8080/job/PIPELINE_NAME/lastBuild/api/json | jq '.duration'
# Review pipeline stages
# (Check which stages are slow)
# Optimize pipeline configuration
High execution times require optimization.
FAQ: Common Questions About Monitoring CI/CD Pipeline Health
How often should I monitor CI/CD pipeline health on my Linux server?
We recommend monitoring CI/CD pipeline health every 5-15 minutes. Pipeline failures can occur at any time, so frequent monitoring helps detect issues immediately. For critical pipelines, monitor more frequently. Use Zuzia.app automated monitoring to monitor CI/CD pipeline health continuously without manual intervention.
What should I do when CI/CD pipeline health shows failures?
When CI/CD pipeline health shows failures, first check pipeline status to identify failed pipelines. Review pipeline logs for errors. Check build artifacts. Investigate failure cause and fix pipeline issues.
Can I monitor CI/CD pipeline health without affecting pipelines?
Yes, monitoring CI/CD pipeline health is read-only and doesn't affect pipelines. Commands like curl to pipeline APIs only query pipeline status. However, avoid checking too frequently to minimize impact.
How do I identify which pipeline has health issues?
Use CI/CD pipeline health checks to identify problematic pipelines. Check pipeline status, build success rates, and execution times for each pipeline. Review pipeline logs. Zuzia.app tracks CI/CD pipeline health and can help identify problematic pipelines.
Why is monitoring CI/CD pipeline health important?
Monitoring CI/CD pipeline health helps detect pipeline failures immediately, track build success rates, monitor deployment status, ensure reliable automation, and respond quickly to pipeline issues. Pipeline failures can prevent deployments, so tracking CI/CD pipeline health is essential for maintaining deployment reliability.
How do I compare CI/CD pipeline health across multiple pipelines?
Use Zuzia.app to monitor CI/CD pipeline health across multiple pipelines simultaneously. Each pipeline executes health checks independently, and all results are stored in Zuzia.app's database for centralized comparison and analysis. You can view CI/CD pipeline health for all pipelines in a single dashboard.
Does Zuzia.app track CI/CD pipeline health changes over time?
Yes, Zuzia.app stores all command outputs in its database, allowing you to track CI/CD pipeline health over time and identify when pipeline failures or performance issues occur. You can view historical data to see pipeline health trends, identify failure patterns, and verify that pipeline improvements were successful.
Related guides, recipes, and problems
Related guides
- CI/CD Pipeline Health Monitoring Guide
- Terraform Drift Monitoring
- Microservices Health Monitoring
Related recipes
Related problems
- CI/CD Pipeline Failures
- Infrastructure as Code Drift Failures