Bug 54968 - fix some failures in monitoring alert scripts
Summary: fix some failures in monitoring alert scripts
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Monitoring (Prometheus or Nagios)
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-2-errata
Assignee: Florian Best
QA Contact: Siavash Sefid Rodi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-11 11:31 CEST by Florian Best
Modified: 2024-12-17 11:37 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2022-07-11 11:31:22 CEST
1. some scripts are executed on server roles which don't measure the script result, but nevetheless the execution causes tracebacks which cause error mails by cron:

    Traceback (most recent call last):
      File "/usr/share/univention-monitoring-client/scripts//check_univention_ldap", line 54, in <module>
        LDAP.main()
      File "/usr/lib/python3/dist-packages/univention/monitoring/__init__.py", line 74, in main
        self.write_metrics()
      File "/usr/share/univention-monitoring-client/scripts//check_univention_ldap", line 40, in write_metrics
        slapd_port = ucr['slapd/port'].split(',')[0]
    AttributeError: 'NoneType' object has no attribute 'split'
    run-parts: /usr/share/univention-monitoring-client/scripts//check_univention_ldap exited with return code 1
    mdb_env_open failed, error 2 No such file or directory

same for check_univention_mdb_maxsize and check_univention_ssl_certificate

2. relicts from nagios in check_univention_nfsstatus:
    Traceback (most recent call last):
      File "/usr/share/univention-monitoring-client/scripts//check_univention_nfsstatus", line 93, in <module>
        FSMountCheck.main()
      File "/usr/lib/python3/dist-packages/univention/monitoring/__init__.py", line 74, in main
        self.write_metrics()
      File "/usr/share/univention-monitoring-client/scripts//check_univention_nfsstatus", line 86, in write_metrics
        msg = '%s OK, %s %s - %s' % (mounted, umounted, self.errorstate, msg)
    AttributeError: 'FSMountCheck' object has no attribute 'errorstate'
    run-parts: /usr/share/univention-monitoring-client/scripts//check_univention_nfsstatus exited with return code 1

3. UNIVENTION_ADCONNECTOR_METRIC_MISSING is missing to check one metric
Comment 1 Florian Best univentionstaff 2022-07-11 12:26:46 CEST
All points addressed in:

univention-monitoring-client.yaml
c92dbb5666d6 | Bug #54968: changelog

univention-monitoring-client (1.0.0-4)
cbd882d5088f | Bug #54968: restrict check execution to valid system roles
ab8ea52ca45c | Bug #54968: fix leftover nagios reference in check_univention_nfsstatus
fd7c10ae5425 | Bug #54968: add missing metric to UNIVENTION_ADCONNECTOR_METRIC_MISSING query
c92dbb5666d6 | Bug #54968: changelog
Comment 2 Siavash Sefid Rodi univentionstaff 2022-07-13 16:06:25 CEST
OK: cbd882d5088f | Bug #54968: restrict check execution to valid system roles
OK: ab8ea52ca45c | Bug #54968: fix leftover nagios reference in check_univention_nfsstatus
OK: fd7c10ae5425 | Bug #54968: add missing metric to UNIVENTION_ADCONNECTOR_METRIC_MISSING query
OK: c92dbb5666d6 | Bug #54968: changelog