mirror of
https://github.com/moudsen/mailGraph
synced 2025-01-30 20:01:38 +01:00
v2.14 - Fixed missing flag for fetching web url related items
This commit is contained in:
parent
288b0adaf7
commit
97dba8f197
@ -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;
|
||||
|
@ -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,6 +947,7 @@
|
||||
$request = array('jsonrpc'=>'2.0',
|
||||
'method'=>'item.get',
|
||||
'params'=>array('itemids'=>$p_itemId,
|
||||
'webitems'=>'true',
|
||||
'output'=>'extend'),
|
||||
'auth'=>$token,
|
||||
'id'=>nextRequestID());
|
||||
@ -1407,7 +1422,10 @@
|
||||
$mailData['LOG_HTML'] = str_replace($cCRLF,'<br/>',$mailData['LOG_HTML']);
|
||||
$mailData['LOG_HTML'] = str_replace('<br/>','<br/>'.$cCRLF,$mailData['LOG_HTML']);
|
||||
|
||||
$mailData['LOG_HTML'] = '<html lang="en"><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8">'.$cCRLF.
|
||||
$mailData['LOG_HTML'] = '<html lang="en"><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"></head>'.$cCRLF.
|
||||
'<style type="text/css">'.$cCRLF.
|
||||
'body { font-family: courier, courier new, serif; font-size: 12px; }'.$cCRLF.
|
||||
'</style>'.$cCRLF.
|
||||
'<body>'.$cCRLF.
|
||||
$mailData['LOG_HTML'].$cCRLF.
|
||||
'</body>'.$cCRLF.
|
||||
|
@ -35,10 +35,6 @@
|
||||
<name>infoTest</name>
|
||||
<value>Test</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>itemId</name>
|
||||
<value>{ITEM.ID}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>periods</name>
|
||||
<value>10m,4h,1d,7d</value>
|
||||
@ -64,7 +60,7 @@
|
||||
<value>https://myzabbix.example.com/mailGraph.php</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<script>// mailGraph v2.13
|
||||
<script>// mailGraph v2.14
|
||||
try {
|
||||
// Pickup parameters
|
||||
params = JSON.parse(value),
|
||||
@ -82,7 +78,7 @@ try {
|
||||
// Declare output type
|
||||
req.addHeader('Content-Type: application/json');
|
||||
|
||||
// Must have fields
|
||||
// Pick up relevant fields for mailGraph API level call
|
||||
fields.itemId = params.itemId * 1;
|
||||
fields.eventId = params.eventId * 1;
|
||||
fields.recipient = params.recipient;
|
||||
|
Loading…
x
Reference in New Issue
Block a user