Nagstamon icon indicating copy to clipboard operation
Nagstamon copied to clipboard

TypeError

Open balykin95 opened this issue 1 year ago • 1 comments

Hello!

When i starting nagstamon from Startup Nagstamon just always showing "OK" (there are some problems in zabbix) When I trying to start nagstamon from console with zabbix server i get Python TypeError:

Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/Nagstamon/QUI/init.py", line 4008, in get_status status = self.server.GetStatus() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Generic.py", line 877, in GetStatus status = self._get_status() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Zabbix.py", line 329, in _get_status status = self.statemap.get(service['lastEvent']['severity'], service['lastEvent']['severity']) TypeError: list indices must be integers or slices, not str

Zabbix Server 5.0 Fedora 36 plasmashell 5.25.3 nagstamon-3.9.20220710.fedora36-1.noarch

balykin95 avatar Aug 01 '22 06:08 balykin95

Still with latest testing release?

HenriWahl avatar Aug 14 '22 14:08 HenriWahl

Still with latest testing release?

Yeah, I've tried nagstamon-3.9.20220815.fedora36-1.noarch.rpm

Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/Nagstamon/QUI/init.py", line 4024, in get_status status = self.server.GetStatus() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Generic.py", line 877, in GetStatus status = self._get_status() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Zabbix.py", line 349, in _get_status status = self.statemap.get(service['lastEvent']['severity'], service['lastEvent']['severity']) TypeError: list indices must be integers or slices, not str

balykin95 avatar Aug 16 '22 06:08 balykin95

@balykin95 please enable debugging and provide some output.

HenriWahl avatar Aug 16 '22 07:08 HenriWahl

@mprenditore @hunsbea any idea? I would assume that Zabbix 5.0 is a little bit outfated?

HenriWahl avatar Aug 16 '22 14:08 HenriWahl

@balykin95 you should edit your post to remove your password. @HenriWahl it appears to be a difference in API return format for the trigger.get endpoint. According to this error, it looks like Zabbix 5.0 is returning a list of events for the lastEvent property, while 5.4 is returning a single event. I may or may not have time to set up a 5.0 instance and debug this over the next few days. Technically 5.0 is still a supported version of Zabbix, so I feel some obligation to try to fix this.

hunsbea avatar Aug 16 '22 15:08 hunsbea

@hunsbea thanx for tip. I only saw one 'user.login'. @HenriWahl will you make fix or i need to update zabbix server?

balykin95 avatar Aug 17 '22 06:08 balykin95

I deleted last post because edit.log still shown changes. [mbalykin@mb-office ~]$ nagstamon --output QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout 20: url: https://zabbix-aero.caravan.ru/api_jsonrpc.php 10: Trying to login with 'mbalykin':'md5(0e77563a32a466b5523d3ad7609d7647)' 10: json_obj: {'jsonrpc': '2.0', 'method': 'user.login', 'params': {'user': 'user', 'password': 'user'}, 'id': 0} 20: Sending: {"jsonrpc": "2.0", "method": "user.login", "params": {"user": "user", "password": "user"}, "id": 0} 10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} DEBUG: 2022-08-16 10:56:27.652223 Saving configuration to file /home/mbalykin/.nagstamon/nagstamon.conf DEBUG: 2022-08-16 10:56:27.970450 C Created server. DEBUG: Initializing SystemTrayIcon DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58160> for state "OK" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a580d0> for state "INFORMATION" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a581f0> for state "UNKNOWN" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58280> for state "WARNING" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58310> for state "AVERAGE" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a583a0> for state "HIGH" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58430> for state "CRITICAL" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a584c0> for state "DISASTER" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58550> for state "UNREACHABLE" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a585e0> for state "DOWN" DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f0da8a58670> for state "ERROR" DEBUG: SystemTrayIcon initial icon: <PyQt5.QtGui.QIcon object at 0x7f0da89f25f0> 20: Response Code: 200 10: Response Body: {'jsonrpc': '2.0', 'result': 'e86a325ec182ec513db02f1ffa4a6e36', 'id': 0} 10: json_obj: {'jsonrpc': '2.0', 'method': 'apiinfo.version', 'params': {}, 'id': 1} 20: Sending: {"jsonrpc": "2.0", "method": "apiinfo.version", "params": {}, "id": 1} 10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} 20: Response Code: 200 10: Response Body: {'jsonrpc': '2.0', 'result': '5.0.5', 'id': 1} 10: json_obj: {'jsonrpc': '2.0', 'method': 'maintenance.get', 'params': {'output': ['active_since', 'active_till', 'tags'], 'selectTags': 'extend'}, 'auth': 'e86a325ec182ec513db02f1ffa4a6e36', 'id': 2} 20: Sending: {"jsonrpc": "2.0", "method": "maintenance.get", "params": {"output": ["active_since", "active_till", "tags"], "selectTags": "extend"}, "auth": "e86a325ec182ec513db02f1ffa4a6e36", "id": 2} 10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} 20: Response Code: 200 10: Response Body: {'jsonrpc': '2.0', 'result': [], 'id': 2} 10: json_obj: {'jsonrpc': '2.0', 'method': 'trigger.get', 'params': {'only_true': True, 'skipDependent': True, 'monitored': True, 'active': True, 'output': ['triggerid', 'description', 'lastchange', 'manual_close'], 'selectLastEvent': ['eventid', 'name', 'ns', 'clock', 'acknowledged', 'value', 'severity'], 'selectHosts': ['hostid', 'host', 'name', 'status', 'available', 'maintenance_status', 'maintenance_from'], 'selectItems': ['name', 'lastvalue', 'state', 'lastclock'], 'filter': {'value': 1}}, 'auth': 'e86a325ec182ec513db02f1ffa4a6e36', 'id': 3} 20: Sending: {"jsonrpc": "2.0", "method": "trigger.get", "params": {"only_true": true, "skipDependent": true, "monitored": true, "active": true, "output": ["triggerid", "description", "lastchange", "manual_close"], "selectLastEvent": ["eventid", "name", "ns", "clock", "acknowledged", "value", "severity"], "selectHosts": ["hostid", "host", "name", "status", "available", "maintenance_status", "maintenance_from"], "selectItems": ["name", "lastvalue", "state", "lastclock"], "filter": {"value": 1}}, "auth": "e86a325ec182ec513db02f1ffa4a6e36", "id": 3} 10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} 20: Response Code: 200 10: Response Body: {'jsonrpc': '2.0', 'result': [{'triggerid': '52558', 'description': 'Disk SEQ performance (READ) is low', 'lastchange': '1463385948', 'manual_close': '0', 'hosts': [{'hostid': '14110', 'host': 'pcs10', 'name': 'pcs10', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '97728', 'name': 'Disk BW (READ - sequential) inside test CT', 'state': '0', 'lastclock': '0', 'lastvalue': ''}], 'lastEvent':[]}, {'triggerid': '84233', 'description': 'Bond1 if2 failed', 'lastchange': '1633015120', 'manual_close': '0', 'hosts': [{'hostid': '14113', 'host': 'pcs13', 'name': 'pcs13', 'status': '0', 'available': '1', 'maintenance_status': '0','maintenance_from': '0'}], 'items': [{'itemid': '148965', 'name': 'Bond1 status if2', 'state': '0', 'lastclock': '1660636545', 'lastvalue': '1'}], 'lastEvent': {'ns': '626933364', 'eventid': '26269566', 'name': 'Bond1 if2 failed', 'clock': '1633015120', 'acknowledged': '1', 'value': '1', 'severity': '3'}}, {'triggerid': '84272', 'description': 'Bond1 if3 failed', 'lastchange': '1633017805', 'manual_close': '0', 'hosts': [{'hostid': '14113', 'host': 'pcs13', 'name': 'pcs13', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '149004', 'name': 'Bond1 status if3', 'state': '0', 'lastclock': '1660636584', 'lastvalue': '1'}], 'lastEvent': {'ns': '62988314', 'eventid': '26269840', 'name': 'Bond1 if3 failed', 'clock': '1633017805', 'acknowledged': '1', 'value': '1', 'severity': '3'}}, {'triggerid': '40285', 'description': 'Po27 low bandwidth', 'lastchange': '1633413411', 'manual_close': '0', 'hosts': [{'hostid': '14002', 'host': 'csw', 'name': 'csw', 'status': '0', 'available': '0', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '83278', 'name': 'Po27-Hispeed', 'state': '1', 'lastclock': '0', 'lastvalue': '0'}], 'lastEvent': {'ns': '962334274', 'eventid': '26286103', 'name': 'Po27 low bandwidth', 'clock': '1633413411', 'acknowledged': '1', 'value': '1', 'severity': '1'}}, {'triggerid': '86766', 'description': '{ITEM.VALUE} problem(s) with mVPS backups', 'lastchange': '1660540110', 'manual_close': '0', 'hosts': [{'hostid': '14109', 'host': 'pcs9', 'name': 'pcs9', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}],'items': [{'itemid': '154710', 'name': 'VH backup status', 'state': '0', 'lastclock': '1660636110', 'lastvalue': '1'}], 'lastEvent': {'ns': '775586717', 'eventid': '28013294', 'name': '2 problem(s) with mVPS backups', 'clock': '1660540110', 'acknowledged': '0', 'value': '1', 'severity': '1'}}, {'triggerid': '73342', 'description': 'High IOPS', 'lastchange': '1660636528', 'manual_close': '0', 'hosts': [{'hostid': '16315', 'host': 'vz0fco', 'name': 'vz0fco', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '135266', 'name': 'Storage IOPS read', 'state': '0', 'lastclock': '1660636587', 'lastvalue': '4992'}, {'itemid': '135267', 'name': 'Storage IOPS write', 'state': '0', 'lastclock': '1660636588', 'lastvalue': '36205'}], 'lastEvent': {'ns': '176031676', 'eventid': '28023882', 'name': 'High IOPS', 'clock': '1660636528', 'acknowledged': '0', 'value': '1', 'severity': '1'}}], 'id': 3} 10: json_obj: {'jsonrpc': '2.0', 'method': 'host.get', 'params': {'output': ['hostid', 'host', 'name', 'status', 'available', 'error', 'errors_from', 'snmp_available', 'snmp_error', 'snmp_errors_from', 'ipmi_available', 'ipmi_error', 'ipmi_errors_from', 'jmx_available', 'jmx_error', 'jmx_errors_from', 'maintenance_status', 'maintenance_from'], 'selectInterfaces': ['ip'], 'filter': {}}, 'auth': 'e86a325ec182ec513db02f1ffa4a6e36', 'id': 4} 20: Sending: {"jsonrpc": "2.0", "method": "host.get", "params": {"output": ["hostid", "host", "name", "status", "available", "error", "errors_from", "snmp_available", "snmp_error", "snmp_errors_from", "ipmi_available", "ipmi_error", "ipmi_errors_from", "jmx_available", "jmx_error", "jmx_errors_from", "maintenance_status", "maintenance_from"], "selectInterfaces": ["ip"], "filter": {}}, "auth": "e86a325ec182ec513db02f1ffa4a6e36", "id": 4} 10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'} 20: Response Code: 200 10: Response Body: {'jsonrpc': '2.0', 'result': [{'hostid': '10946', 'host': 'zabbix-master-s', 'name': 'zabbix-master-s', 'status': '0', 'available': '1', 'error': '', 'errors_from': '0', 'snmp_available': '0', 'snmp_error': '', 'snmp_errors_from': '0', 'ipmi_available': '0', 'ipmi_error': '', 'ipmi_errors_from': '0', 'jmx_available': '0', 'jmx_error': '', 'jmx_errors_from': '0', 'maintenance_status': '0', 'maintenance_from': '0', 'interfaces': [{'ip': '10.10.0.19'}]}, {'hostid': '14002', 'host': 'csw', 'name': 'csw', 'status': '0', 'available': '0', 'error': '', 'errors_from': '0', 'snmp_available': '1', 'snmp_error': '', 'snmp_errors_from': '0', 'ipmi_available': '0', 'ipmi_error': '', 'ipmi_errors_from': '0', 'jmx_available': '0', 'jmx_error': '', 'jmx_errors_from': '0', 'maintenance_status': '0', 'maintenance_from': '0', 'interfaces': [{'ip': '10.10.0.210'}, {'ip': '10.10.0.210'}]} ... ]}], 'id': 4}

Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/Nagstamon/QUI/init.py", line 4024, in get_status status = self.server.GetStatus() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Generic.py", line 877, in GetStatus status = self._get_status() File "/usr/lib/python3.10/site-packages/Nagstamon/Servers/Zabbix.py", line 349, in _get_status status = self.statemap.get(service['lastEvent']['severity'], service['lastEvent']['severity']) TypeError: list indices must be integers or slices, not str DEBUG: 2022-08-16 10:56:28.510648 C FetchURL: https://nagstamon.de/version/unstable CGI Data: None

balykin95 avatar Aug 17 '22 06:08 balykin95

@balykin95 quite likely an update could fix this, but @hunsbea wants to check the 5.0 compatibility.

HenriWahl avatar Aug 17 '22 06:08 HenriWahl

@balykin95 quite likely an update could fix this, but @hunsbea wants to check the 5.0 compatibility.

I just worry not all other employees in my company would have possibility to update to latest nagstamon (if their outdated nagstamon versions wouldn't be able to work with 5.4)

balykin95 avatar Aug 17 '22 06:08 balykin95

I set up a Zabbix Server 5.0 instance just now using the following docker commands:

docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
docker run --network=zabbix-net --name postgres-server -t -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD="zabbix_pwd" -e POSTGRES_DB="zabbix" -p 5432:5432 -d postgres:latest
docker run --network=zabbix-net --name zabbix-server-pgsql -t -e DB_SERVER_HOST="postgres-server" -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD="zabbix_pwd" -e POSTGRES_DB="zabbix" -p 10051:10051 -d zabbix/zabbix-server-pgsql:alpine-5.0-latest
docker run --network=zabbix-net --name zabbix-web-nginx-pgsql -t -e ZBX_SERVER_HOST="zabbix-server-pgsql" -e DB_SERVER_HOST="postgres-server" -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD="zabbix_pwd" -e POSTGRES_DB="zabbix" -p 8443:8443 -p 8080:8080 -d zabbix/zabbix-web-nginx-pgsql:alpine-5.0-latest

I then added a test host, and added the Zabbix instance to my Nagstamon config.

image

So the basic functionality works, but I can see above in @balykin95 's new debug output:

'lastEvent':[]

So that confirms the issue. Apparently if there are somehow no events associated with a trigger, it will return an empty list. I will code a hypothetical fix and raise a PR, although I won't be able to fully test it.

hunsbea avatar Aug 17 '22 07:08 hunsbea

That should do the trick, @HenriWahl you can let me know if you have any concern about that.

hunsbea avatar Aug 17 '22 10:08 hunsbea

@balykin95 so this is fixed now?

HenriWahl avatar Aug 17 '22 20:08 HenriWahl

@balykin95 so this is fixed now?

I'm confused :( I replaced the content of the file Nagstamon/Servers/Zabbix.py from db0b302 commit, but now when I start nagstamon, the floating window disappears. I'm not sure if this is a KDE problem:

Layout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a layout
20: url: https://zabbix-aero.caravan.ru/api_jsonrpc.php
10: Trying to login with 'mbalykin':'md5(0e77563a32a466b5523d3ad7609d7647)'
10: json_obj: {'jsonrpc': '2.0', 'method': 'user.login', 'params': {'user': 'user', 'password': 'password'}, 'id': 0}
20: Sending: {"jsonrpc": "2.0", "method": "user.login", "params": {"user": "user", "password": "password"}, "id": 0}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
DEBUG: 2022-08-18 09:50:37.602013 Saving configuration to file /home/mbalykin/.nagstamon/nagstamon.conf
DEBUG: 2022-08-18 09:50:37.927140 C Created server.
DEBUG: Initializing SystemTrayIcon
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f041f0> for state "OK"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04160> for state "INFORMATION"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04280> for state "UNKNOWN"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04310> for state "WARNING"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f043a0> for state "AVERAGE"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04430> for state "HIGH"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f044c0> for state "CRITICAL"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04550> for state "DISASTER"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f045e0> for state "UNREACHABLE"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04670> for state "DOWN"
DEBUG: SystemTrayIcon created icon <Nagstamon.QUI.QIconWithFilename object at 0x7f6ce3f04700> for state "ERROR"
DEBUG: SystemTrayIcon initial icon: <PyQt5.QtGui.QIcon object at 0x7f6ce3f04790>
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': '95c9df103aaa7c448ca051d7625f73bb', 'id': 0}
10: json_obj: {'jsonrpc': '2.0', 'method': 'apiinfo.version', 'params': {}, 'id': 1}
20: Sending: {"jsonrpc": "2.0", "method": "apiinfo.version", "params": {}, "id": 1}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': '5.0.5', 'id': 1}
10: json_obj: {'jsonrpc': '2.0', 'method': 'maintenance.get', 'params': {'output': ['active_since', 'active_till', 'tags'], 'selectTags': 'extend'}, 'auth': '95c9df103aaa7c448ca051d7625f73bb', 'id': 2}
20: Sending: {"jsonrpc": "2.0", "method": "maintenance.get", "params": {"output": ["active_since", "active_till", "tags"], "selectTags": "extend"}, "auth": "95c9df103aaa7c448ca051d7625f73bb", "id": 2}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': [], 'id': 2}
10: json_obj: {'jsonrpc': '2.0', 'method': 'trigger.get', 'params': {'only_true': True, 'skipDependent': True, 'monitored': True, 'active': True, 'output': ['triggerid', 'description', 'lastchange', 'manual_close'], 'selectLastEvent': ['eventid', 'name', 'ns', 'clock', 'acknowledged', 'value', 'severity'], 'selectHosts': ['hostid', 'host', 'name', 'status', 'available', 'maintenance_status', 'maintenance_from'], 'selectItems': ['name', 'lastvalue', 'state', 'lastclock'], 'filter': {'value': 1}}, 'auth': '95c9df103aaa7c448ca051d7625f73bb', 'id': 3}
20: Sending: {"jsonrpc": "2.0", "method": "trigger.get", "params": {"only_true": true, "skipDependent": true, "monitored": true, "active": true, "output": ["triggerid", "description", "lastchange", "manual_close"], "selectLastEvent": ["eventid", "name", "ns", "clock", "acknowledged", "value", "severity"], "selectHosts": ["hostid", "host", "name", "status", "available", "maintenance_status", "maintenance_from"], "selectItems": ["name", "lastvalue", "state", "lastclock"], "filter": {"value": 1}}, "auth": "95c9df103aaa7c448ca051d7625f73bb", "id": 3}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': [{'triggerid': '52558', 'description': 'Disk SEQ performance (READ) is low', 'lastchange': '1463385948', 'manual_close': '0', 'hosts': [{'hostid': '14110', 'host': 'pcs10', 'name': 'pcs10', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '97728', 'name': 'Disk BW (READ - sequential) inside test CT', 'state': '0', 'lastclock': '0', 'lastvalue': ''}], 'lastEvent':[]}, {'triggerid': '84233', 'description': 'Bond1 if2 failed', 'lastchange': '1633015120', 'manual_close': '0', 'hosts': [{'hostid': '14113', 'host': 'pcs13', 'name': 'pcs13', 'status': '0', 'available': '1', 'maintenance_status': '0','maintenance_from': '0'}], 'items': [{'itemid': '148965', 'name': 'Bond1 status if2', 'state': '0', 'lastclock': '1660799505', 'lastvalue': '1'}], 'lastEvent': {'ns': '626933364', 'eventid': '26269566', 'name': 'Bond1 if2 failed', 'clock': '1633015120', 'acknowledged': '1', 'value': '1', 'severity': '3'}}, {'triggerid': '84272', 'description': 'Bond1 if3 failed', 'lastchange': '1633017805', 'manual_close': '0', 'hosts': [{'hostid': '14113', 'host': 'pcs13', 'name': 'pcs13', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '149004', 'name': 'Bond1 status if3', 'state': '0', 'lastclock': '1660803204', 'lastvalue': '1'}], 'lastEvent': {'ns': '62988314', 'eventid': '26269840', 'name': 'Bond1 if3 failed', 'clock': '1633017805', 'acknowledged': '1', 'value': '1', 'severity': '3'}}, {'triggerid': '40285', 'description': 'Po27 low bandwidth', 'lastchange': '1633413411', 'manual_close': '0', 'hosts': [{'hostid': '14002', 'host': 'csw', 'name': 'csw', 'status': '0', 'available': '0', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '83278', 'name': 'Po27-Hispeed', 'state': '1', 'lastclock': '0', 'lastvalue': '0'}], 'lastEvent': {'ns': '962334274', 'eventid': '26286103', 'name': 'Po27 low bandwidth', 'clock': '1633413411', 'acknowledged': '1', 'value': '1', 'severity': '1'}}, {'triggerid': '52499', 'description': 'CPU perf is at bad level', 'lastchange': '1660788614', 'manual_close': '0', 'hosts': [{'hostid': '14109', 'host': 'pcs9', 'name': 'pcs9', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '97414', 'name': 'CPU performance inside test CT', 'state': '0', 'lastclock': '1660767011', 'lastvalue': '8.4238'}], 'lastEvent': {'ns': '54060105', 'eventid': '28035123', 'name': 'CPU perf is at bad level', 'clock': '1660788614', 'acknowledged': '0', 'value': '1', 'severity': '1'}}, {'triggerid': '86764', 'description': '{ITEM.VALUE} problem(s) with mVPS backups', 'lastchange': '1660799311', 'manual_close': '0', 'hosts': [{'hostid': '14110', 'host': 'pcs10', 'name': 'pcs10', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '154711', 'name': 'VH backup status', 'state': '0', 'lastclock': '1660769911', 'lastvalue': '0'}], 'lastEvent': {'ns': '942128897', 'eventid': '28035846', 'name': '1 problem(s) with mVPS backups', 'clock': '1660799311', 'acknowledged': '0', 'value': '1', 'severity': '1'}}, {'triggerid': '86760', 'description': '{ITEM.VALUE} problem(s) with mVPS backups', 'lastchange': '1660799313', 'manual_close': '0', 'hosts': [{'hostid': '14113', 'host': 'pcs13', 'name': 'pcs13', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '154713', 'name': 'VH backup status', 'state': '0', 'lastclock': '1660769913', 'lastvalue': '0'}], 'lastEvent': {'ns': '112902622', 'eventid': '28035847', 'name': '1 problem(s) with mVPS backups', 'clock': '1660799313', 'acknowledged': '0', 'value': '1', 'severity': '1'}}, {'triggerid': '120491', 'description': 'Disk I/O is overloaded on {HOST.NAME}', 'lastchange': '1660805084', 'manual_close': '0', 'hosts': [{'hostid': '24711', 'host': 'hw206', 'name': 'hw206', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '339404', 'name': 'CPU $2 time', 'state': '0', 'lastclock': '1660769984', 'lastvalue': '0.002085'}], 'lastEvent': {'ns': '548292683', 'eventid': '28036198', 'name': 'Disk I/O is overloaded on hw206', 'clock': '1660805084', 'acknowledged': '0', 'value': '1', 'severity': '3'}}, {'triggerid': '118729', 'description': 'Disk I/O is overloaded on {HOST.NAME}', 'lastchange': '1660805241', 'manual_close': '0', 'hosts': [{'hostid': '24567', 'host': 'store.rusonyx.ru', 'name': 'store.rusonyx.ru', 'status': '0', 'available': '1', 'maintenance_status': '0', 'maintenance_from': '0'}], 'items': [{'itemid': '333441', 'name': 'CPU $2 time', 'state': '0', 'lastclock': '1660769961', 'lastvalue': '0.045958'}], 'lastEvent': {'ns': '374923025', 'eventid': '28036201', 'name': 'Disk I/O is overloaded on store.rusonyx.ru', 'clock': '1660805241', 'acknowledged':'0', 'value': '1', 'severity': '3'}}], 'id': 3}
10: json_obj: {'jsonrpc': '2.0', 'method': 'host.get', 'params': {'output': ['hostid', 'host', 'name', 'status', 'available', 'error', 'errors_from', 'snmp_available', 'snmp_error', 'snmp_errors_from', 'ipmi_available', 'ipmi_error', 'ipmi_errors_from', 'jmx_available', 'jmx_error', 'jmx_errors_from', 'maintenance_status', 'maintenance_from'], 'selectInterfaces': ['ip'], 'filter': {}}, 'auth': '95c9df103aaa7c448ca051d7625f73bb', 'id': 4}
20: Sending: {"jsonrpc": "2.0", "method": "host.get", "params": {"output": ["hostid", "host", "name", "status", "available", "error", "errors_from", "snmp_available", "snmp_error", "snmp_errors_from", "ipmi_available", "ipmi_error", "ipmi_errors_from", "jmx_available", "jmx_error", "jmx_errors_from", "maintenance_status", "maintenance_from"], "selectInterfaces": ["ip"], "filter": {}}, "auth": "95c9df103aaa7c448ca051d7625f73bb", "id": 4}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': [{'hostid': '10946', 'host': 'zabbix-master-s', 'name': 'zabbix-master-s', 'status': '0', 'available': '1', 'error': '', 'errors_from': '0', 'snmp_available': '0', 'snmp_error': '', 'snmp_errors_from': '0', 'ipmi_available': '0', 'ipmi_error': '', 'ipmi_errors_from': '0', 'jmx_available': '0', 'jmx_error': '', 'jmx_errors_from': '0', 'maintenance_status': '0', 'maintenance_from': '0', 'interfaces': [{'ip': '10.10.0.19'}]}, {'hostid': '14002', 'host': 'csw', 'name': 'csw', 'status': '0', 'available': '0', 'error': '', 'errors_from': '0', 'snmp_available': '1', 'snmp_error': '', 'snmp_errors_from': '0', 'ipmi_available': '0', 'ipmi_error': '', 'ipmi_errors_from': '0', 'jmx_available': '0', 'jmx_error': '', 'jmx_errors_from': '0', 'maintenance_status': '0', 'maintenance_from': '0', 'interfaces': [{'ip': '10.10.0.210'}, {'ip': '10.10.0.210'}]}, ...]}

DEBUG: 2022-08-18 09:50:38.566852 C FetchURL: https://nagstamon.de/version/unstable CGI Data: None
DEBUG: 2022-08-18 09:50:39.449582 C Adding new service[52558] **Disk SEQ performance (READ) is low**
DEBUG: 2022-08-18 09:50:39.449610 C Adding new service[84233] **Bond1 if2 failed**
DEBUG: 2022-08-18 09:50:39.449629 C Adding new service[84272] **Bond1 if3 failed**
DEBUG: 2022-08-18 09:50:39.449647 C Adding new service[40285] **Po27 low bandwidth**
DEBUG: 2022-08-18 09:50:39.449664 C Adding new service[52499] **CPU perf is at bad level**
DEBUG: 2022-08-18 09:50:39.449684 C Adding new service[86764] **1 problem(s) with mVPS backups**
DEBUG: 2022-08-18 09:50:39.449701 C Adding new service[86760] **1 problem(s) with mVPS backups**
DEBUG: 2022-08-18 09:50:39.449718 C Adding new service[120491] **Disk I/O is overloaded on hw206**
DEBUG: 2022-08-18 09:50:39.449734 C Adding new service[118729] **Disk I/O is overloaded on store.rusonyx.ru**

balykin95 avatar Aug 18 '22 06:08 balykin95

As a general rule, when I see some weird behavior, I do the following:

  • Restart my computer
  • Rename/move my .nagstamon config directory and let Nagstamon create a new one with fresh settings
  • Pull a fresh copy of the git repo

hunsbea avatar Aug 18 '22 07:08 hunsbea

As a general rule, when I see some weird behavior, I do the following:

  • Restart my computer
  • Rename/move my .nagstamon config directory and let Nagstamon create a new one with fresh settings
  • Pull a fresh copy of the git repo

Sure. I made all of this. I have tried all Display Appearences, and when i try Floating statusbar it's just showing for 1-2 seconds and disappear then. (But the process of nagstamon is still live)

balykin95 avatar Aug 18 '22 08:08 balykin95

Well on the bright side, it sounds like you get past the previous crash you were experiencing due to Zabbix API.

Maybe this warrants opening a separate issue. If you are running this from source, there could be some incompatibility with the versions of the python packages you have installed. @HenriWahl can you send @balykin95 the output of the following command, run from your Fedora build machine?

pip freeze

Then @balykin95 can install these exact versions, retest, and rule out pip package versions as a problem source. I have encountered package version issues on Windows, although normally there is some error ... without any error, this is quite hard to debug.

hunsbea avatar Aug 18 '22 13:08 hunsbea

Here are the package versions I'm using:

$ pip freeze
altgraph==0.17
arrow==1.1.1
astroid==2.6.6
beautifulsoup4==4.9.3
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.4
colorama==0.4.4
cryptography==3.2.1
future==0.18.2
icinga2api==0.6.1
idna==3.2
importlib-metadata==4.6.3
isort==5.9.3
keyring==23.0.1
lazy-object-proxy==1.6.0
lxml==4.6.3
mccabe==0.6.1
pefile==2021.5.24
psutil==5.8.0
pycparser==2.20
pyinstaller==4.5.1
pyinstaller-hooks-contrib==2021.2
pylint==2.9.6
pypiwin32==223
PyQt5==5.15.4
PyQt5-Qt5==5.15.2
PyQt5-sip==12.9.0
PySocks==1.7.1
python-dateutil==2.8.2
pywin32==301
pywin32-ctypes==0.2.0
requests==2.26.0
requests-ecp==0.2.2
requests-kerberos==0.12.0
six==1.16.0
soupsieve==2.2.1
toml==0.10.2
typed-ast==1.4.3
typing-extensions==3.10.0.0
urllib3==1.26.6
winkerberos==0.8.0
wrapt==1.12.1
zabbix-api==0.5.4
zipp==3.5.0

hunsbea avatar Aug 18 '22 13:08 hunsbea

Sure, Zabbix API err fixed.

Trying to debug floating window. Got error qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2452, resource id: 16790020, major code: 40 (TranslateCoords), minor code: 0

Need I to close this thread and start new one when will get more info?

balykin95 avatar Aug 19 '22 06:08 balykin95

@balykin95 yes a new thread would be better

HenriWahl avatar Aug 19 '22 06:08 HenriWahl