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

  my $new_host = Zabbix2::API::Host->new(root => $zabber,
                                         data => { host => 'Another Server',
                                                   ip => '255.255.255.255',
                                                   useip => 1,
                                                   groups => [ { groupid => 4 } ] });
  $new_host->interfaces([ Zabbix2::API::HostInterface->new(
                              root => $zabber,
                              data => {
                                  dns => 'localhost',
                                  ip => '',
                                  main => 1,
                                  port => 10000,
                                  type => Zabbix2::API::HostInterface::INTERFACE_TYPE_AGENT,
                                  useip => 0,
                              }) ]);
  $new_host->create;

DESCRIPTION

While technically a subclass of Zabbix2::API::CRUDE, this class does not actually implement all methods necessary to behave as a full-fledged Zabbix object. Instead, we recommend using Zabbix2::API::HostInterface objects via their parent Zabbix2::API::Host object. Calls to unimplemented methods will throw an exception.

Unlike Zabbix2::API::GraphItem objects, for which the usual API methods are not all implemented on the server, this is mostly a case of laziness of our part, so patches are welcome.

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.

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.