diff --git a/javascript/zabbix.mailGraph.js b/javascript/zabbix.mailGraph.js index fd42bfd..d81a341 100644 --- a/javascript/zabbix.mailGraph.js +++ b/javascript/zabbix.mailGraph.js @@ -1,4 +1,4 @@ -// mailGraph v2.13 +// mailGraph v2.14 try { // Pickup parameters params = JSON.parse(value), @@ -16,7 +16,7 @@ try { // Declare output type req.addHeader('Content-Type: application/json'); - // Must have fields + // Pick up fields relevant for mailGraph API level call fields.itemId = params.itemId * 1; fields.eventId = params.eventId * 1; fields.recipient = params.recipient; diff --git a/mailGraph.php b/mailGraph.php index d575784..8ad1244 100644 --- a/mailGraph.php +++ b/mailGraph.php @@ -57,6 +57,7 @@ // Adding ACK_URL for utilization in the template to point to Ack page // Small refactor on itemId variable processing (no longer mandatory) // Additional logic added to random eventId to explain in case of issues + // Fixed missing flag for fetching web url related items // ------------------------------------------------------------------------------------------------------ // // (C) M.J.Oudsen, mark.oudsen@puzzl.nl @@ -638,6 +639,19 @@ $z_tmp_cookies = $z_path.'tmp/'; $z_log_path = $z_path.'log/'; + // If tmp or log does not exist, create them + if (!is_dir($z_tmp_cookies)) + { + mkdir($z_tmp_cookies); + _log('+ created TMP directory "'.$z_tmp_cookies.'"'); + } + + if (!is_dir($z_log_path)) + { + mkdir($z_log_path); + _log('+ created LOG directory "'.$z_log_path.'"'); + } + // Zabbix user (requires Super Admin access rights to access image generator script) $z_user = $config['zabbix_user']; $z_pass = $config['zabbix_user_pwd']; @@ -933,7 +947,8 @@ $request = array('jsonrpc'=>'2.0', 'method'=>'item.get', 'params'=>array('itemids'=>$p_itemId, - 'output'=>'extend'), + 'webitems'=>'true', + 'output'=>'extend'), 'auth'=>$token, 'id'=>nextRequestID()); @@ -1407,7 +1422,10 @@ $mailData['LOG_HTML'] = str_replace($cCRLF,'
',$mailData['LOG_HTML']); $mailData['LOG_HTML'] = str_replace('
','
'.$cCRLF,$mailData['LOG_HTML']); - $mailData['LOG_HTML'] = ''.$cCRLF. + $mailData['LOG_HTML'] = ''.$cCRLF. + ''.$cCRLF. ''.$cCRLF. $mailData['LOG_HTML'].$cCRLF. ''.$cCRLF. diff --git a/mailGraph.xml b/mailGraph.xml index adf8625..94359bd 100755 --- a/mailGraph.xml +++ b/mailGraph.xml @@ -35,10 +35,6 @@ infoTest Test - - itemId - {ITEM.ID} - periods 10m,4h,1d,7d @@ -64,7 +60,7 @@ https://myzabbix.example.com/mailGraph.php -