lukecyca/pyzabbix

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error

aoberest opened this issue · 3 comments

Hello.
Thank for your module.

Can you help me understand what this means?
I try export templates from zabbix to directory.

===========================
Zabbix Version: 4.4.10

EXPORT function!
Template_App_Zabbix_Server_Stress_1k_active_C.xml file has been created
Template_JMX_Generic.xml file has been created
Template_IPMI_Intel_SR1530.xml file has been created
Template_SNMP_OS_Linux.xml file has been created
TemplateWallarmTarantoolAllocate.xml file has been created
Template_SNMP_Interfaces.xml file has been created
Template_Virt_VMware_Guest.xml file has been created
Template_App_Zabbix_Server_Stress_1k_passive_D.xml file has been created
web_mon.xml file has been created
Template_App_NTP_Service.xml file has been created
Template_IPMI_Intel_SR1630.xml file has been created
Template_JMX_NIO_Kafka.xml file has been created
Template_OS_Solaris.xml file has been created
Template_ICMP_Ping.xml file has been created
Traceback (most recent call last):
File "Export_Templates_from_Zabbix.py", line 321, in
main()
File "Export_Templates_from_Zabbix.py", line 289, in main
export_templates(zabbix__host, zabbix__user, zabbix__password, templates_dir)
File "Export_Templates_from_Zabbix.py", line 110, in export_templates
format='xml'
File "/usr/lib/python3.6/site-packages/pyzabbix/init.py", line 192, in fn
args or kwargs
File "/usr/lib/python3.6/site-packages/pyzabbix/init.py", line 144, in do_request
response.raise_for_status()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 928, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://zabbix.someserver.com/zabbix/api_jsonrpc.php

ciao,
that's a server error, I don't believe it has anything to do with this module, but you can find additional info looking at your zabbix server frontend error logs. It's very likely your php memory_limit setting is too low to allow exporting all templates, especially if you have a lot of them, you should find a relative error in zabbix frontend (apache or nginx) logs.

Thank you for fast the answer.
I'll check everything and write later.

Hello,
In my case
I have standalone server zabbix web (UI).
Nginx + php-fpm
I increased param php_admin_value[memory_limit] = 256M in /etc/php-fpm.d/www.conf and my script ran without errors
Thank for help.