User
add_user_to_usergroup
Add users to usergroups.
Ignores users not in user groups. Users and groups must exist.
Arguments
USERNAMES
Usernames to add. Comma-separated.
Type: text
Required: ✅
USERGROUPS
User groups to add the users to. Comma-separated.
Type: text
Required: ✅
add_usergroup_permissions
Give a user group permissions to host/template groups.
Run show_hostgroups
to get a list of host groups, and
show_templategroups --no-templates
to get a list of template groups.
Arguments
USERGROUP
User group to give permissions to.
Type: text
Required: ✅
Options
--hostgroup
<HOSTGROUPS>
Comma-separated list of host group names.
Type: text
--templategroup
<TEMPLATEGROUPS>
Comma-separated list of template group names.
Type: text
--permission
<PERMISSION>
Permission to give to the user group.
Type: choice
Choices: deny
, ro
, rw
, 0
, 2
, 3
create_notification_user
Create a notification user.
Notification users can be used to send notifications when a Zabbix event happens.
Sometimes we need to send a notification to a place not owned by any user in particular, e.g. an email list or jabber channel but Zabbix does not provide a way to define a media for a user group.
This is the reason we use notification users. They are users nobody owns, but that can be used by other users to send notifications to the media defined in the notification user profile.
Run show_media_types
to get a list of available media types.
Uses the default notification user group defined in the configuration file
if no user groups are specified with --usergroups
.
Examples
Create a notification user for email reporting
Arguments
SENDTO
Email address, SMS number, jabber address, etc.
Type: text
Required: ✅
MEDIATYPE
A media type name or ID defined in Zabbix. Case-sensitive.
Type: text
Required: ✅
Options
--remarks
<REMARKS>
Remarks about the notification user to include in username (max 20 chars).
Type: text
--username
<USERNAME>
Override generated username. Ignores --remarks.
Type: text
--usergroups
<USERGROUPS>
Comma-separated list of usergroups to add the user to. Overrides user groups in config file.
Type: text
create_user
Create a user.
Arguments
USERNAME
Username of the user to create.
Type: text
Required: ✅
Options
--firstname
<FIRST_NAME>
First name of the user to create.
Type: text
--lastname
, --surname
<LAST_NAME>
Last name of the user to create.
Type: text
--passwd
<PASSWORD>
Password of the user to create. Set to '-' to prompt for password. Generates random password if omitted.
Type: text
--role
<ROLE>
Role of the user.
Type: choice
Choices: user
, admin
, superadmin
, guest
, 1
, 2
, 3
, 4
Default: user
--autologin
/--no-autologin
Enable auto-login for the user.
Type: boolean
Default: False
--autologout
<AUTOLOGOUT>
User session lifetime in seconds. Set to 0 to never expire. Can be a time unit with suffix (0s, 15m, 1h, 1d, etc.)
Type: text
Default: 86400
--groups
<GROUPS>
Comma-separated list of group IDs to add the user to.
Type: text
create_usergroup
Create a user group.
Arguments
USERGROUP
Name of the user group to create.
Type: text
Required: ✅
Options
--gui
<GUI_ACCESS>
GUI access for the group.
Type: choice
Choices: default
, internal
, ldap
, disable
, 0
, 1
, 2
, 3
Default: default
--disabled
Create the user group in a disabled state.
Type: boolean
Default: False
remove_user
Remove a user.
Arguments
USERNAME
Username to remove.
Type: text
Required: ✅
remove_user_from_usergroup
Remove users from usergroups.
Ignores users not in user groups. Users and groups must exist.
Arguments
USERNAMES
Usernames to remove. Comma-separated.
Type: text
Required: ✅
USERGROUPS
User groups to remove the users from. Comma-separated.
Type: text
Required: ✅
show_media_types
Show all available media types.
show_user
Show a user.
Arguments
USERNAME
Username of user
Type: text
Required: ✅
show_usergroup
Show one or more user groups by name or ID.
Examples
Show user group 'Admins'
Show user groups 'Admins' and 'Operators'
Show all user groups containing 'web' sorted by ID
Arguments
USERGROUP
Name or ID of the user group(s) to show. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--sort
<SORT>
Sort by field.
Type: choice
Choices: name
, id
, users
Default: name
show_usergroup_permissions
Show permissions for one or more user groups.
Examples
Show permissions for user group 'Admins'
Show permissions for user groups 'Admins' and 'Operators'
Show permissions for all user groups sorted by ID
Arguments
USERGROUP
Name of user group. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--sort
<SORT>
Sort by field.
Type: choice
Choices: name
, id
, users
Default: name
show_usergroups
Show user groups.
Can be filtered by name or ID.
Examples
Show all user groups
Show user groups 'Admins' and 'Operators'
Show all user groups containing 'web' sorted by ID
Arguments
USERGROUP
Name or ID of the user group(s) to show. Comma-separated. Supports wildcards.
Type: text
Options
--sort
<SORT>
Sort by field.
Type: choice
Choices: name
, id
, users
Default: name
--limit
, -n
<LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0
show_users
Show users.
Users can be filtered by name, ID, or role.
Arguments
USERNAME_OR_ID
Filter by username or ID. Supports wildcards.
Type: text
Options
--role
<ROLE>
Filter by role.
Type: choice
Choices: user
, admin
, superadmin
, guest
, 1
, 2
, 3
, 4
--limit
<LIMIT>
Limit the number of users shown.
Type: integer
--sort
<SORT>
Sort by field.
Type: choice
Choices: name
, id
, role
Default: name
update_user
Update a user.
Use add_user_to_usergroup
and remove_user_from_usergroup
to manage user groups.
Examples
Assign new first and last name
Promote user to admin
Update user's password, prompt for passwords
Update user's password, generate random new password
Disable autologin for user
Arguments
USERNAME
Username of the user to update
Type: text
Required: ✅
Options
--firstname
<FIRST_NAME>
New first name.
Type: text
--lastname
<LAST_NAME>
New last name.
Type: text
--passwd
, --new-passwd
<NEW_PASSWORD>
New password for user. Set to '-' to prompt for password, '?' to generate a random password.
Type: text
--old-passwd
<OLD_PASSWORD>
Existing password, required if --passwd is used. Set to '-' to prompt for password.
Type: text
--role
<ROLE>
User role.
Type: choice
Choices: user
, admin
, superadmin
, guest
, 1
, 2
, 3
, 4
--autologin
/--no-autologin
Enable/disable auto-login
Type: boolean
--autologout
<AUTOLOGOUT>
User session lifetime in seconds. Set to 0 to never expire. Can be a time unit with suffix (0s, 15m, 1h, 1d, etc.)
Type: text
update_usergroup_permissions
Give a user group permissions to host/template groups.
Run show_hostgroups
to get a list of host groups, and
show_templategroups --no-templates
to get a list of template groups.
Arguments
USERGROUP
User group to give permissions to.
Type: text
Required: ✅
Options
--hostgroup
<HOSTGROUPS>
Comma-separated list of host group names.
Type: text
--templategroup
<TEMPLATEGROUPS>
Comma-separated list of template group names.
Type: text
--permission
<PERMISSION>
Permission to give to the user group.
Type: choice
Choices: deny
, ro
, rw
, 0
, 2
, 3