mirror of
https://github.com/Akkadius/glass-isc-dhcp.git
synced 2025-07-29 16:45:48 +02:00
Subnet utilization email alerts
This commit is contained in:
parent
bb8becdaaa
commit
9555cb3ca9
42
app.js
42
app.js
@ -593,6 +593,13 @@ setTimeout(function(){
|
|||||||
"Current: (" + utilization + "%) " +
|
"Current: (" + utilization + "%) " +
|
||||||
"Threshold: (" + glass_config.shared_network_warning_threshold + "%)"
|
"Threshold: (" + glass_config.shared_network_warning_threshold + "%)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
email_alert("WARNING: DHCP shared network utilization",
|
||||||
|
"WARNING: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") <br><br>" +
|
||||||
|
"Threshold: (" + glass_config.shared_network_warning_threshold + "%) <br>" +
|
||||||
|
"Current: (" + utilization + "%)"
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
utilization <= glass_config.shared_network_warning_threshold &&
|
utilization <= glass_config.shared_network_warning_threshold &&
|
||||||
@ -605,6 +612,13 @@ setTimeout(function(){
|
|||||||
"Current: (" + utilization + "%) " +
|
"Current: (" + utilization + "%) " +
|
||||||
"Threshold: (" + glass_config.shared_network_warning_threshold + "%)"
|
"Threshold: (" + glass_config.shared_network_warning_threshold + "%)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
email_alert("CLEAR: DHCP shared network utilization warning",
|
||||||
|
"CLEAR: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") <br><br>" +
|
||||||
|
"Threshold: (" + glass_config.shared_network_warning_threshold + "%) <br>" +
|
||||||
|
"Current: (" + utilization + "%)"
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,7 +630,17 @@ setTimeout(function(){
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 1;
|
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 1;
|
||||||
slack_message(":fire: CRITICAL: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + "%) Threshold: (" + glass_config.shared_network_critical_threshold + "%)");
|
slack_message(":fire: CRITICAL: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") " +
|
||||||
|
"Current: (" + utilization + "%) " +
|
||||||
|
"Threshold: (" + glass_config.shared_network_critical_threshold + "%)"
|
||||||
|
);
|
||||||
|
|
||||||
|
email_alert("CRITICAL: DHCP shared network utilization",
|
||||||
|
"CRITICAL: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") <br><br>" +
|
||||||
|
"Threshold: (" + glass_config.shared_network_critical_threshold + "%) <br>" +
|
||||||
|
"Current: (" + utilization + "%)"
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
utilization <= glass_config.shared_network_critical_threshold &&
|
utilization <= glass_config.shared_network_critical_threshold &&
|
||||||
@ -624,7 +648,16 @@ setTimeout(function(){
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 0;
|
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 0;
|
||||||
slack_message(":white_check_mark: CLEAR: Critical DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + "%) Threshold: (" + glass_config.shared_network_critical_threshold + "%)");
|
slack_message(":white_check_mark: CLEAR: Critical DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") " +
|
||||||
|
"Current: (" + utilization + "%) " +
|
||||||
|
"Threshold: (" + glass_config.shared_network_critical_threshold + "%)"
|
||||||
|
);
|
||||||
|
|
||||||
|
email_alert("CLEAR: DHCP shared network utilization",
|
||||||
|
"CLEAR: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") <br><br>" +
|
||||||
|
"Threshold: (" + glass_config.shared_network_critical_threshold + "%) <br>" +
|
||||||
|
"Current: (" + utilization + "%)"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -683,9 +716,4 @@ function email_alert(alert_title, alert_message) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
email_alert("CRITICAL: Leases Per Minute Threshold", "DHCP leases per minute dropped below critical threshold <br><br>" +
|
|
||||||
"Threshold: (" + parseInt(glass_config.leases_per_minute_threshold).toLocaleString('en') + ") <br>" +
|
|
||||||
"Current: (" + parseInt(leases_per_minute).toLocaleString('en') + ") <br><br>" +
|
|
||||||
"This is usually indicative of a process or hardware problem and needs to be addressed immediately");
|
|
||||||
|
|
||||||
console.log("[Glass Server] Bootup complete");
|
console.log("[Glass Server] Bootup complete");
|
Loading…
x
Reference in New Issue
Block a user