Sentinel Agent HTTP API
The Mugnsoft Sentinel Agent REST API provides endpoints for triggering discovery, querying system and process metrics, managing thresholds, and configuring notifications. Version 3.0.0
discovery_agent.
Introduction
The Sentinel Agent API allows you to:
- Trigger on-demand system and process discovery
- Query real-time and historical metrics (CPU, memory, I/O, network traffic)
- Configure thresholds and auto-baselines
- Manage users and authentication
- Access log files and backups
- Monitor agent health
Base URL: https://<agent-ip>:8070
Protocol: HTTPS with mTLS (mutual TLS)
Authentication
Login
curl -k -X POST https://192.168.1.100:8070/api/auth \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "your_password"
}'
Response (200 OK):
{
"code": 200,
"expire": "2025-10-11T12:15:00Z",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Token Types
| Endpoint | Lifetime | Use Case |
|---|---|---|
POST /api/auth |
15 minutes | User API access |
POST /loginComponent |
15 minutes | Component communication |
POST /loginComponent1Year |
1 year | Long-lived automation |
POST /loginComponent15Years |
15 years | Permanent integrations |
Token Refresh
curl -k -X GET https://192.168.1.100:8070/refresh_token \
-H "Authorization: Bearer <your_current_token>"
Discovery Operations
Trigger Immediate Discovery
curl -k -X GET https://192.168.1.100:8070/runDiscovery \
-H "Authorization: Bearer <token>"
Triggers an immediate metrics collection cycle (system + process + network). Results are stored in the KV store and written to data/discover_metrics.json.
Get Process by Port
curl -k -X GET https://192.168.1.100:8070/getProcessByPort/3306 \
-H "Authorization: Bearer <token>"
Returns information about the process listening on the specified TCP port.
Compute Auto-Thresholds
curl -k -X POST https://192.168.1.100:8070/computeThreshold \
-H "Authorization: Bearer <token>"
Recalculates auto-baseline thresholds for all monitored metrics based on historical data.
Metrics Retrieval
Current System Metrics
curl -k -X GET https://192.168.1.100:8070/api/metrics \
-H "Authorization: Bearer <token>"
Returns current CPU, memory, load average, and uptime.
System Metrics Graph
curl -k -X GET "https://192.168.1.100:8070/api/reportSysMetricsGraph/1728565200000/1728651600000" \
-H "Authorization: Bearer <token>"
Path Parameters:
startTime- Unix timestamp in millisecondsendTime- Unix timestamp in milliseconds
Process Metrics Graph
curl -k -X GET "https://192.168.1.100:8070/process/reportGraph/nginx/1728565200000/1728651600000" \
-H "Authorization: Bearer <token>"
Path Parameters:
type- Metric type (e.g.,process,system)key- Process name or metric identifierstartTime/endTime- Time range (Unix ms)
Get Specific Metric from KV Store
curl -k -X GET https://192.168.1.100:8070/api/db/discovery/bucket/STATUS/key/nginx_cpu \
-H "Authorization: Bearer <token>"
Get All Data from a Bucket
curl -k -X GET https://192.168.1.100:8070/v1/db/discovery/bucket/STATUS/allJSON \
-H "Authorization: Bearer <token>"
Settings Management
Get Settings
curl -k -X GET https://192.168.1.100:8070/api/setting \
-H "Authorization: Bearer <token>"
Update Settings
curl -k -X POST https://192.168.1.100:8070/updateSetting \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"logLevel": "info",
"sched": "5MIN",
"discoCPUGFixedThreshCri": "95",
"discoCPUGFixedThreshMaj": "85",
"discoCPUGFixedThreshMin": "75",
"discoCPUGMonEnabled": "true",
"processes": "nginx,mysqld,java",
"ports": "80,443,3306"
}'
Configure SMTP
curl -k -X POST https://192.168.1.100:8070/setsmtp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"smtpEnabled": "true",
"smtpServerName": "smtp.example.com",
"smtpPort": "587",
"smtpUsername": "alerts@example.com",
"smtpPwd": "password",
"smtpTLS": "true"
}'
Test Integrator Connectivity
curl -k -X POST https://192.168.1.100:8070/checkConnectIntegrators \
-H "Authorization: Bearer <token>"
Log Files
Stream Recent Logs
curl -k -X GET https://192.168.1.100:8070/partServerlogfile/10000 \
-H "Authorization: Bearer <token>"
Returns the last N bytes of the current server log.
Download Log File
curl -k -X GET https://192.168.1.100:8070/discovery/logfile/server/discovery_agent.log \
-H "Authorization: Bearer <token>" -o discovery.log
Download Log Archive
curl -k -X GET https://192.168.1.100:8070/serverlogfiles/discovery_agent.log.gz \
-H "Authorization: Bearer <token>" -o discovery.log.gz
Database Operations
Backup
curl -k -X POST https://192.168.1.100:8070/backupDatabase \
-H "Authorization: Bearer <token>"
Reinitialize
curl -k -X POST https://192.168.1.100:8070/reinitDatabase \
-H "Authorization: Bearer <token>"
Database Statistics
curl -k -X GET https://192.168.1.100:8070/v1/db/discovery/stats \
-H "Authorization: Bearer <token>"
User Management
List Users
curl -k -X GET https://192.168.1.100:8070/api/users \
-H "Authorization: Bearer <token>"
Create User
curl -k -X POST https://192.168.1.100:8070/api/users \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"username": "operator",
"password": "securepass",
"fullname": "Ops Team",
"group": "admin",
"enabled": "true"
}'
Delete User
curl -k -X DELETE https://192.168.1.100:8070/api/users/operator \
-H "Authorization: Bearer <token>"
Certificate Management
Reload Certificates
curl -k -X GET https://192.168.1.100:8070/reloadCertificates \
-H "Authorization: Bearer <token>"
Get Certificate
curl -k -X GET https://192.168.1.100:8070/getCert -o discovery_agent.crt
Health Check
curl -k https://192.168.1.100:8070/ping
Response:
{
"message": "pong"
}
No authentication required.
Swagger Documentation
Access the interactive Swagger UI at: https://<agent-ip>:8070/docs/index.html
Response Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid JWT token |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource not found |
| 500 | Internal Server Error | Server error |