Ad Widget

Collapse

External items implementation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vpupkin
    Junior Member
    • Nov 2006
    • 3

    #16
    Originally posted by primos
    I've added the external patch (by hand) and fixed triggers for 1.1alpha12 (coppied cvs files for server code 23/8/05) so for testing until beta is released this is a working code for me. If you want the source code download it and try it!

    http://gajba.gorkic.com/zabbix-1.1al...nal_items.diff -- > diff from araw , if you wish patch for alpha10 I have it too

    http://gajba.gorkic.com/zabbix-1.1alpha12.zip -- > php gui is not fixed (I think, but the server code works as expected)

    ps triggers work well but not shure for actions and mailing(for me it does not matter for the time being, I count on all of this to work out of box in beta1)!
    does anyone know if this patch is already included in 1.1.4?

    Comment

    • napel25
      Junior Member
      • Nov 2006
      • 18

      #17
      Originally posted by vpupkin
      does anyone know if this patch is already included in 1.1.4?
      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.

      Comment

      • napel25
        Junior Member
        • Nov 2006
        • 18

        #18
        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

        Working...