Answer the question
In order to leave comments, you need to log in
How to log in to Zabbix python requests?
You need to log in to zabbix to get the image of the charts using python. Before upgrading to 5.4, I logged in by passing zbx_sessionid. Now zbx_session is being transmitted in which various data is encrypted in base64.
{"sessionid":"a94b746df946a291da9ff434127ea64061","sign":"4fce0b085b49200765644c27e63ac8ebf1296561529ee02aa099e82394ae8e12ea"}
Answer the question
In order to leave comments, you need to log in
Solved the issue through the basic authorization of requests.post
session = requests.Session()
session.post('http://zabbix.local', {
'name': 'mylogin',
'password': 'mypassword',
'autologin': 1,
'enter': 'Sign in'
})
result = session.get('http://zabbix.local/zabbix.php?action=problem.view.csv', headers=session.headers).content
print(result)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question