Originally posted by primos
Ad Widget
Collapse
External items implementation
Collapse
X
-
Not included, but the patch of Sarek in the forum topic Sarek links to two posts up works on 1.1.4. At least the items work. The triggers still give an error on my installation.Originally posted by vpupkindoes anyone know if this patch is already included in 1.1.4?Comment
-
triggers can be created manually with next sql batch. You have to change/review the values of the first 6 variables.
-- START only edit this variables
SET @item_id = 17454; -- Item on which the trigger reacts
SET @priority = 2; -- Not classified = 0, Information = 1, Warning = 2, Average = 3, High = 4, Disaster = 5
SET @description = 'Oracle instance at {HOSTNAME} has rollback segments in offline status.';
SET @function_str = 'last';
SET @parameter = 0; -- parameter of function
SET @expr = '>0';
-- END only edit this variables
SELECT @host_id := hostid FROM items WHERE itemid = @item_id;
START TRANSACTION;
-- insert into triggers
insert into `zabbix`.`triggers` (`description`, `url`, `status`, `value`, `priority`, `comments`, `error`, `templateid`)
values (@description, '', 0, 2, @priority, '', 'Trigger just added. No status update so far.', 0);
-- get last id
SELECT @trig_id := MAX(triggerid) FROM `zabbix`.`triggers`;
-- insert into functions
insert into `zabbix`.`functions`
(`itemid`, `triggerid`, `function`, `parameter`)
values
(@item_id, @trig_id, @function_str, @parameter);
-- get last id
SELECT @func_id:=MAX(functionid) FROM functions;
-- update expression
update triggers
set expression = concat('{',@func_id,'}',@expr)
where triggerid = @trig_id;
COMMIT;Comment
Comment