Fabrice Gabolde

NAME

Zabbix2::API::Trigger -- Zabbix trigger objects

SYNOPSIS

  use Zabbix2::API::Trigger;
  
  # fetch a single trigger...
  my $trigger = $zabbix->fetch_single('Trigger', params => { triggerids => [ 22379 ] });
  
  # manipulate its properties: make it "average" severity
  $trigger->data->{priority} = 3;
  
  # and update the properties on the server.
  $trigger->update;
  
  # create a new trigger
  my $new_trigger = Zabbix2::API::Trigger->new(
      root => $zabbix,
      data => {
          description => 'some trigger',
          expression => '{Zabbix server:system.uptime.last(0)}<600',
      });
  $new_trigger->create;
  
  # get the triggers that have been triggered and not acked yet, and
  # their parent hosts' IDs in the "hosts" property
  my $triggers = $zabbix->fetch(
      'Trigger',
      params => {
          filter => { value => 1 },
          withLastEventUnacknowledged => 1,
          selectHosts => ['hostid'],
      });

DESCRIPTION

Handles CRUD for Zabbix trigger objects.

This is a subclass of Zabbix2::API::CRUDE; see there for inherited methods.

BUGS AND LIMITATIONS

Zabbix::API::Trigger used to have rudimentary dependency support; this version doesn't, because I don't need it right now. Patches welcome.

SEE ALSO

Zabbix2::API::CRUDE.

AUTHOR

Fabrice Gabolde <fga@cpan.org>

Constants provided by Ray Link.

COPYRIGHT AND LICENSE

Copyright (C) 2011, 2014 Devoteam

This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.