Provided by: libzabbix-api-perl_0.009-1_all
NAME
Zabbix::API::User -- Zabbix user objects
SYNOPSIS
use Zabbix::API::User; # fetch a single user by login ("alias") my $user = $zabbix->fetch('User', params => { filter => { alias => 'luser' } })->[0]; # and delete it $user->delete;
DESCRIPTION
Handles CRUD for Zabbix user objects. This is a subclass of "Zabbix::API::CRUDE"; see there for inherited methods.
METHODS
usergroups() Returns an arrayref of the user's usergroups (possibly empty) as Zabbix::API::UserGroup objects. add_to_usergroup(USERGROUP_OR_NAME) Takes a Zabbix::API::UserGroup instance or a valid usergroup name, and adds the current user to the group. Returns $self. set_usergroups(LIST_OF_USERGROUPS_OR_NAMES) Takes a list of Zabbix::API::UserGroup instances or valid usergroup names, and sets the user/usergroup relationship appropriately. Returns $self. set_password(NEW_PASSWORD) Sets the user's password. The modified user is not pushed automatically to the server. name() Accessor for the user's name (the "alias" attribute). collides() This method returns a list of users colliding (i.e. matching) this one. If there if more than one colliding user found the implementation can not know on which one to perform updates and will bail out.
EXPORTS
User types are implemented as constants: USER_TYPE_USER USER_TYPE_ADMIN USER_TYPE_SUPERADMIN Promote (or demote) users by setting their "$user-"data->{type}> attribute to one of these. Nothing is exported by default; you can use the tag ":user_types" (or import by name).
BUGS AND ODDITIES
Apparently when logging in via the web page Zabbix does not care about the case of your username (e.g. "admin", "Admin" and "ADMIN" will all work). I have not tested this for filtering/searching/colliding users. WHERE'S THE remove_from_usergroup METHOD? This <https://support.zabbix.com/browse/ZBX-6124> is where it is.
SEE ALSO
Zabbix::API::CRUDE.
AUTHOR
Fabrice Gabolde <fabrice.gabolde@uperto.com>
COPYRIGHT AND LICENSE
Copyright (C) 2013 SFR This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.