mirror of
https://github.com/Akkadius/glass-isc-dhcp.git
synced 2025-07-28 08:04:56 +02:00
Alerting cleanup
This commit is contained in:
parent
f43616c86b
commit
88cba6d48a
14
app.js
14
app.js
@ -371,11 +371,11 @@ alert_check_timer = setInterval(function(){
|
|||||||
console.log("[Timer] lpm: %s lpm_th: %s", leases_per_minute, glass_config.leases_per_minute_threshold);
|
console.log("[Timer] lpm: %s lpm_th: %s", leases_per_minute, glass_config.leases_per_minute_threshold);
|
||||||
if (leases_per_minute <= glass_config.leases_per_minute_threshold && alert_status['leases_per_minute'] == 0) {
|
if (leases_per_minute <= glass_config.leases_per_minute_threshold && alert_status['leases_per_minute'] == 0) {
|
||||||
alert_status['leases_per_minute'] = 1;
|
alert_status['leases_per_minute'] = 1;
|
||||||
slack_message(":warning: WARNING: DHCP leases per minute have dropped below critical threshold (" + glass_config.leases_per_minute_threshold.toLocaleString('en') + ") Current LP/s (" + leases_per_minute.toLocaleString('en') + ")");
|
slack_message(":warning: WARNING: DHCP leases per minute have dropped below critical threshold (" + parseInt(glass_config.leases_per_minute_threshold).toLocaleString('en') + ") Current (" + parseInt(leases_per_minute).toLocaleString('en') + ")");
|
||||||
}
|
}
|
||||||
else if (leases_per_minute >= glass_config.leases_per_minute_threshold && alert_status['leases_per_minute'] == 1) {
|
else if (leases_per_minute >= glass_config.leases_per_minute_threshold && alert_status['leases_per_minute'] == 1) {
|
||||||
alert_status['leases_per_minute'] = 0;
|
alert_status['leases_per_minute'] = 0;
|
||||||
slack_message(":white_check_mark: CLEAR: DHCP leases per minute have returned to above the critical threshold (" + glass_config.leases_per_minute_threshold.toLocaleString('en') + ") Current LP/s (" + leases_per_minute.toLocaleString('en') + ")");
|
slack_message(":white_check_mark: CLEAR: DHCP leases per minute have returned to above the critical threshold (" + parseInt(glass_config.leases_per_minute_threshold).toLocaleString('en') + ") Current (" + parseInt(leases_per_minute).toLocaleString('en') + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, (60 * 1000));
|
}, (60 * 1000));
|
||||||
@ -408,12 +408,14 @@ alert_subnet_check_timer = setInterval(function(){
|
|||||||
if(typeof alert_status_networks_critical[dhcp_data['shared-networks'][i].location] === "undefined")
|
if(typeof alert_status_networks_critical[dhcp_data['shared-networks'][i].location] === "undefined")
|
||||||
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 0;
|
alert_status_networks_critical[dhcp_data['shared-networks'][i].location] = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
console.log("Location: %s", dhcp_data['shared-networks'][i].location);
|
console.log("Location: %s", dhcp_data['shared-networks'][i].location);
|
||||||
console.log("Used: %s", dhcp_data['shared-networks'][i].used.toLocaleString('en'));
|
console.log("Used: %s", dhcp_data['shared-networks'][i].used.toLocaleString('en'));
|
||||||
console.log("Defined: %s", dhcp_data['shared-networks'][i].defined.toLocaleString('en'));
|
console.log("Defined: %s", dhcp_data['shared-networks'][i].defined.toLocaleString('en'));
|
||||||
console.log("Free: %s", dhcp_data['shared-networks'][i].free.toLocaleString('en'));
|
console.log("Free: %s", dhcp_data['shared-networks'][i].free.toLocaleString('en'));
|
||||||
console.log("Utilization: %s", utilization);
|
console.log("Utilization: %s", utilization);
|
||||||
console.log(" \n");
|
console.log(" \n");
|
||||||
|
*/
|
||||||
|
|
||||||
/* Check Warnings */
|
/* Check Warnings */
|
||||||
if(glass_config.shared_network_warning_threshold > 0) {
|
if(glass_config.shared_network_warning_threshold > 0) {
|
||||||
@ -424,7 +426,7 @@ alert_subnet_check_timer = setInterval(function(){
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
alert_status_networks_warning[dhcp_data['shared-networks'][i].location] = 1;
|
alert_status_networks_warning[dhcp_data['shared-networks'][i].location] = 1;
|
||||||
slack_message(":warning: WARNING: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + ") Threshold: (" + glass_config.shared_network_warning_threshold + ")");
|
slack_message(":warning: WARNING: DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + "%) Threshold: (" + glass_config.shared_network_warning_threshold + "%)");
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
utilization <= glass_config.shared_network_warning_threshold &&
|
utilization <= glass_config.shared_network_warning_threshold &&
|
||||||
@ -432,7 +434,7 @@ alert_subnet_check_timer = setInterval(function(){
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
alert_status_networks_warning[dhcp_data['shared-networks'][i].location] = 0;
|
alert_status_networks_warning[dhcp_data['shared-networks'][i].location] = 0;
|
||||||
slack_message(":white_check_mark: CLEAR: Warning DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + ") Threshold: (" + glass_config.shared_network_warning_threshold + ")");
|
slack_message(":white_check_mark: CLEAR: Warning DHCP shared network utilization (" + dhcp_data['shared-networks'][i].location + ") Current: (" + utilization + "%) Threshold: (" + glass_config.shared_network_warning_threshold + "%)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,7 +446,7 @@ alert_subnet_check_timer = setInterval(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 + "%)");
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
utilization <= glass_config.shared_network_critical_threshold &&
|
utilization <= glass_config.shared_network_critical_threshold &&
|
||||||
@ -452,7 +454,7 @@ alert_subnet_check_timer = setInterval(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 + "%)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user