User
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
remove_user
Remove a user.
Arguments
USERNAME
Username to remove.
Type: text
Required: ✅
show_user
Show a user.
Arguments
USERNAME
Username of user
Type: text
Required: ✅
show_users
Show all 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