DSBB001-DLBB088-pc1 11221 1552630476
DSBB001-DLBB088-pc1 version_1.12.21 1547829876
DSBB002-DLBB097-pc1 11219 1562075187
DSBB002-DLBB097-pc1 version_1.12.19 1547831827
DSBB004-DLBB003-pc1 11221 1562073266
DSBB004-DLBB003-pc1 version_1.10.3 1545553585
DSBB004-DLBB003-pc1 version_1.12.21 1547831668
DSBB004-DLBB004-pc1 11221 1551416515
DSBB004-DLBB004-pc1 1160 1562072516
SELECT hosts.name,history_text.value,max(history_text.clock)
FROM hosts
LEFT JOIN (items, hosts_groups, history_text) ON (items.hostid=hosts.hostid AND hosts_groups.hostid=hosts.hostid AND history_text.itemid=items.itemid)
WHERE hosts_groups.groupid ="$group_id" AND items.name="ComplexVersion"
GROUP BY hosts.name,hosts_groups.hostid,items.itemid,history_text.value
SELECT hosts.name,hosts_groups.hostid,items.itemid,history_text.value,max(history_text.clock)
FROM hosts
inner JOIN hosts_groups ON (hosts.hostid=hosts_groups.hostid AND hosts_groups.groupid = "77")
inner JOIN items ON (hosts.hostid=items.hostid AND items.name = "CertExpDate_complex")
inner JOIN history_text ON history_text.itemid=items.itemid GROUP BY name
Array
(
[event] => ONTASKUPDATE
[data] => Array
(
[FIELDS_BEFORE] => Array
(
[ID] => 17267
)
[FIELDS_AFTER] => Array
(
[ID] => 17267
)
[IS_ACCESSIBLE_BEFORE] => undefined
[IS_ACCESSIBLE_AFTER] => undefined
)
[ts] => 1535715542
[auth] => Array
(
[domain] => xxxx.bitrix24.ru
[client_endpoint] => https://xxxxx.bitrix24.ru/rest/
[server_endpoint] => https://oauth.bitrix.info/rest/
[member_id] => ec5fa65423d3c8f10cf8c2a6b9235318
[application_token] => 31rfw93yax4enys7zyzjkqfah9qgv98h
)
<?php
print_r($_REQUEST);
writeToLog($_REQUEST);
$var=$_REQUEST["data"]["FIELD_BEFORE"]["ID"];
$cmd="/usr/share/zabbix/log/get.sh $var";
$output=array();
exec($cmd,$output,$return);
function writeToLog($data, $title = '') {
$log = print($var);
// $log .= "\n------------------------\n";
file_put_contents(getcwd() . '/log/hook.log', $log, FILE_APPEND);
return true;
}
]
#!/bin/bash
echo "this is $1" > list
hosts
hosts_groups
items
history_text