You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,6 +17,14 @@ The application supports authenticating with an API or session token. API tokens
17
17
!!! info "Session vs API token"
18
18
Semantically, a session token and API token are the same thing from an API authentication perspective. They are both sent as the `auth` parameter in the Zabbix API requests.
19
19
20
+
### Environment variables
21
+
22
+
The API token can be set as an environment variable:
23
+
24
+
```bash
25
+
export ZABBIX_API_TOKEN="API TOKEN"
26
+
```
27
+
20
28
### Config file
21
29
22
30
The token can be set directly in the config file:
@@ -26,14 +34,6 @@ The token can be set directly in the config file:
26
34
auth_token = "API_TOKEN"
27
35
```
28
36
29
-
### Environment variables
30
-
31
-
The API token can be set as an environment variable:
32
-
33
-
```bash
34
-
export ZABBIX_API_TOKEN="API TOKEN"
35
-
```
36
-
37
37
### Auth token file
38
38
39
39
The application can store and reuse session tokens between runs. This feature is enabled by default and configurable via the following options:
@@ -62,6 +62,15 @@ When `allow_insecure_auth_file` is set to `false`, the application will attempt
62
62
63
63
The application supports authenticating with a username and password. The password can be set in the config file, an auth file, as environment variables, or prompted for when starting the application.
64
64
65
+
### Environment variables
66
+
67
+
The username and password can be set as environment variables:
68
+
69
+
```bash
70
+
export ZABBIX_USERNAME="Admin"
71
+
export ZABBIX_PASSWORD="zabbix"
72
+
```
73
+
65
74
### Config file
66
75
67
76
The password can be set directly in the config file:
@@ -87,20 +96,45 @@ The location of the auth file file can be changed in the config file:
87
96
auth_file = "~/.zabbix-cli_auth"
88
97
```
89
98
90
-
### Environment variables
99
+
### Prompt
91
100
92
-
The username and password can be set as environment variables:
101
+
When all other authentication methods fail, the application will prompt for a username and password. The default username in the prompt can be configured:
93
102
94
-
```bash
95
-
export ZABBIX_USERNAME="Admin"
96
-
export ZABBIX_PASSWORD="zabbix"
103
+
```toml
104
+
[api]
105
+
username = "Admin"
97
106
```
98
107
99
-
### Prompt
108
+
##URL
100
109
101
-
When all other authentication methods fail, the application will prompt for a username and password. The default username in the prompt can be configured:
110
+
The URL of the Zabbix API can be set in the config file, as an environment variable, or prompted for when starting the application.
"zabbix_cli.exceptions.ZabbixAPILoginError: Failed to log in to Zabbix: Failed to send request to http://some-url-that-will-fail.gg/api_jsonrpc.php (user.login) with params {'username': 'username', 'password': 'password'}"
"zabbix_cli.exceptions.ZabbixAPILogoutError: Failed to log out of Zabbix: Failed to send request to http://some-url-that-will-fail.gg/api_jsonrpc.php (user.logout) with params {}"
0 commit comments