I am using pyzabbix module to use the Zabbix API, but is there any way to login the Zabbix API without giving the username and password in Python script? Like any API token which serves the purpose.
Asked
Active
Viewed 367 times
3 Answers
0
There is not, but you should use an environment variable (see environment variable in python) to store the password/token anyway, in order to avoid having it inside the code in cleartext. The environment is visible to the user only, and is usually initialized from a protected file (0600 permission in unix style), or a masked CI/CD variable.
Iron Bishop
- 1,749
- 1
- 7
- 16
0
I am using Zabbix 5.4.7 There is a section API tokens under:
Administration -> General -> API tokens
heroedeleyenda
- 143
- 4
-
I then put it on the auth value in the json request – heroedeleyenda Jun 24 '22 at 20:09
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 27 '22 at 17:28