API Reference
PUT
update_server_monitoring_settings/:serverIdUpdate Server Monitoring Settings
Update Server Monitoring Settings is a PUT request to https://api.sharkcluster.com/update_server_monitoring_settings/:serverId in the Server Management section of the SharkCluster API. Updates the monitoring configuration (such as alert thresholds and notification emails) for a specific server. It takes 2 parameters, 2 required (serverId and monitoring_settings).
Request URL
PUT
https://api.sharkcluster.com/update_server_monitoring_settings/:serverIdHow do you call Update Server Monitoring Settings?
- 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
- 2Send a PUT request to https://api.sharkcluster.com/update_server_monitoring_settings/:serverId, replacing {serverId} in the path with your own value.
- 3Include the required parameter: monitoring_settings.
Request parameters
| Parameter | Type | Description |
|---|---|---|
serverIdRequired | string | The unique identifier or Instance ID of the server. |
monitoring_settingsRequired | object | The full configuration object containing all monitoring flags and integration keys. |
What does Update Server Monitoring Settings return?
A successful call returns a JSON object with the fields message and monitoring_settings. A failed call explains the problem in the body, for example "Server not found".
Request sample
const axios = require('axios');
async function updateMonitoringSettings(serverId, settings, token) {
try {
const response = await axios.put(`https://api.sharkcluster.com/update_server_monitoring_settings/${serverId}`, {
monitoring_settings: settings
}, {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
console.log('Success:', response.data.message);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
// Example usage with your specific payload
const monitoringPayload = {
Debug: false,
Alerts: false,
Manual: false,
diskIo: false,
Network: false,
Database: false,
Profiling: false,
alertRecipients: "[email protected]",
alertThreshold80: "80%",
alertThreshold85: "85%",
alertThreshold1000: "1000 MS",
appResponseTime: "XX MS",
blackfireClientId: "****",
blackfireClientToken: "****",
blackfireSubscriptionType: "Free",
blackfireToggle: false,
cpuUsage: false,
ecpuUsage: "30 Sec",
logStoragePath: "/var/log/newrelic.log",
manualMode: false,
memoryUsage: false,
newRelicLicenseKey: "****",
newRelicToggle: false,
profileRetention: "7 Days",
profilingFrequency: "30 Sec",
serverNameNewRelic: "demo",
slowFunctionAlerts: false,
slowFunctionThreshold: "200 MS",
subscriptionType: "Free"
};
updateMonitoringSettings('server_123', monitoringPayload, 'your_auth_token_here');
Response
{
"message": "Monitoring settings updated successfully",
"monitoring_settings": {
"Debug": false,
"Alerts": false,
"Manual": false,
"diskIo": false,
"Network": false,
"Database": false,
"cpuUsage": false,
"Profiling": false,
"ecpuUsage": "30 Sec",
"manualMode": false,
"memoryUsage": false,
"logStoragePath": "/var/log/newrelic.log",
"newRelicToggle": false,
"alertRecipients": "[email protected]",
"appResponseTime": "XX MS",
"blackfireToggle": false,
"alertThreshold80": "80%",
"alertThreshold85": "85%",
"profileRetention": "7 Days",
"subscriptionType": "Free",
"blackfireClientId": "****",
"alertThreshold1000": "1000 MS",
"newRelicLicenseKey": "****",
"profilingFrequency": "30 Sec",
"serverNameNewRelic": "demo",
"slowFunctionAlerts": false,
"blackfireClientToken": "****",
"slowFunctionThreshold": "200 MS",
"blackfireSubscriptionType": "Free"
}
}Related Server Management endpoints
- POST
varnish-logsGet Varnish Logs - POST
upload-varnish-vclUpload Varnish VCL - GET
get_server_monitoring_settings/:serverIdGet Server Monitoring Settings - GET
get_server_other_services_config/:serverIdGet Server Other Services Config - POST
install-elasticsearchInstall Elasticsearch - POST
restart-elasticsearchRestart Elasticsearch
Stuck on an integration?
Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.