diff --git a/README.md b/README.md index 785081a..2a57843 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ Default setting is 20 seconds. Changelog --------- +* version 2.1.1: + * Bugfix for maintenance checks * version 2.1: * Support Zabbix maintenance time. Author: Author: [Lorenzo Milesi](https://github.com/maxxer) * version 2.0: diff --git a/js/zabbix-api.js b/js/zabbix-api.js index d5171e7..1fafec1 100644 --- a/js/zabbix-api.js +++ b/js/zabbix-api.js @@ -494,6 +494,7 @@ function getAllTrigger(url, token, ckecktime, https_flag) { params.sortfield = "lastchange"; params.sortorder = "DESC"; params.filter = filter; + params.selectHosts = ['maintenance_status']; var dataRequest = new Object(); dataRequest.params = params; dataRequest.auth = token; @@ -527,7 +528,7 @@ function notificationCheck(trigger_data){ var last_checktime = now - background_rate; var msg = ""; // Check if the users wants to be notified for hosts in maintenance - if (maintenance_notification == "Off" && trigger_data["hosts"][0]['host_maintenance'] == "1") + if (maintenance_notification == "Off" && (typeof trigger_data["hosts"] != 'undefined') && trigger_data["hosts"][0]['maintenance_status'] == "1") return; if(last_checktime < trigger_data["lastchange"] ){ msg += trigger_data["host"]; diff --git a/manifest.json b/manifest.json index 0c80d3e..a9ef056 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name":"Chromix", - "version":"2.1.0", + "version":"2.1.1", "manifest_version":2, "background":{"page":"background.html"}, "description":"Zabbix Alert Check Extension",