The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Zabbix2::API::HostInterface -- Zabbix host interface objects

SYNOPSIS

  # create it with the host
  my $new_host = Zabbix2::API::Host->new(
      root => $zabbix,
      data => {
          host => 'the internal zabbix hostname',
          name => 'the name displayed in most places',
          groups => [ { groupid => 4 } ],
          interfaces => [
              { dns => 'some hostname',
                ip => '',
                useip => 0,
                main => 1,
                port => 10000,
                type => Zabbix2::API::HostInterface::INTERFACE_TYPE_AGENT,
              } ] });
  $new_host->create;
  
  # create it later
  my $new_interface = Zabbix2::API::HostInterface->new(
      root => $zabbix,
      data => {
          dns => 'some other hostname',
          ip => '',
          useip => 0,
          main => 1,
          port => 10001,
          type => Zabbix2::API::HostInterface::INTERFACE_TYPE_AGENT,
          hostid => $new_host->id
      });
  $new_interface->create;

DESCRIPTION

Handles CRUD for Zabbix interface objects.

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

Zabbix2::API::HostInterface objects will be automatically created from a Zabbix2::API::Host object's properties whenever it is pulled from the server. Conversely, if you add interfaces manually to a Zabbix2::API::Host object, the Zabbix2::API::HostInterface objects will be automatically turned into properties just before a call to create or update, causing the relevant host interface objects to be created or updated on the server.

ATTRIBUTES

host

(read-only Zabbix2::API::Host object)

This attribute is lazily populated with the interface's host from the server.

EXPORTS

Some constants:

  INTERFACE_TYPE_UNKNOWN
  INTERFACE_TYPE_AGENT
  INTERFACE_TYPE_SNMP
  INTERFACE_TYPE_IPMI
  INTERFACE_TYPE_JMX
  INTERFACE_TYPE_ANY

They are not exported by default, only on request; or you could import the :interface_types tag.

SEE ALSO

Zabbix2::API::CRUDE, Zabbix2::API::Host

AUTHOR

Fabrice Gabolde <fga@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2014 Fabrice Gabolde

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.