From 03bead438c63d35b46a563280c4e7f59048a9776 Mon Sep 17 00:00:00 2001 From: Lorenzo Milesi Date: Thu, 16 Apr 2015 16:18:42 +0200 Subject: [PATCH] Maintenance check fixes --- README.md | 2 ++ js/zabbix-api.js | 3 ++- manifest.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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 de88ec0..3518d93 100644 --- a/js/zabbix-api.js +++ b/js/zabbix-api.js @@ -438,6 +438,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; @@ -471,7 +472,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",