Skip to content

It is impossible to add a Zabbix server #1115

@ogarcia

Description

@ogarcia

Steps to reproduce:

  1. Open nagstamon without previous configuration.
  2. The program asks if you want to add a server. Click on “Create new server”.
  3. Fill in the data and press OK.
  4. After a few seconds the program crashes.

This happens both in the latest version and in the git master version.

Log:

$ nagstamon 
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
qt.multimedia.gstreamer: Using Qt multimedia with GStreamer version: "GStreamer 1.26.2"
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/Nagstamon/QUI/__init__.py", line 4085, in get_status
    status = self.server.get_status()
  File "/usr/lib/python3.13/site-packages/Nagstamon/Servers/Generic.py", line 925, in get_status
    status = self._get_status()
  File "/usr/lib/python3.13/site-packages/Nagstamon/Servers/Zabbix.py", line 372, in _get_status
    'host': service['hosts'][0]['host'],
            ~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Aborted (core dumped)

If at startup I tell it that I don't want to add server and I try to add it from the settings it also crashes, but the error is different:

$ nagstamon 
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
qt.multimedia.gstreamer: Using Qt multimedia with GStreamer version: "GStreamer 1.26.2"
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
(<class 'AttributeError'>, AttributeError("'NoneType' object has no attribute 'maintenance'"), <traceback object at 0x7f5980660bc0>)
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/Nagstamon/QUI/__init__.py", line 4085, in get_status
    status = self.server.get_status()
  File "/usr/lib/python3.13/site-packages/Nagstamon/Servers/Generic.py", line 925, in get_status
    status = self._get_status()
  File "/usr/lib/python3.13/site-packages/Nagstamon/Servers/Zabbix.py", line 157, in _get_status
    services = self.zapi.trigger.get({'only_true': True,
               ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'trigger'
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions