Bug 51869 - Regression: false positive warning in nagios check of ad-connector
Regression: false positive warning in nagios check of ad-connector
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: AD Connector
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Julia Bremer
Felix Botner
:
Depends on: 49981
Blocks: 53340
  Show dependency treegraph
 
Reported: 2020-08-21 09:53 CEST by Andreas Peichert
Modified: 2021-06-02 17:09 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: Ticket#2020081721000369
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Peichert univentionstaff 2020-08-21 09:53:46 CEST
With the changes in Bug #49168 and Bug #50676 the nagios check for univention-ad-connector will report false positive warning if more the one ad connector is running, which having a different --configbase

root@backup131:~# ps auxf | grep univention.connector.ad.main | grep -v grep
root     30748  0.0  5.8 611756 60024 ?        S    22:31   0:00 /usr/bin/python2.7 -W ignore -m univention.connector.ad.main --configbase connector-gym-4
root     30800  0.0  5.8 611148 59552 ?        S    22:31   0:00 /usr/bin/python2.7 -W ignore -m univention.connector.ad.main --configbase connector-gym-3

root@backup131:~# /usr/lib/nagios/plugins/check_univention_ad_connector
ADCONNECTOR CRITICAL: AD connector is not running!

I propose to change the check for the processes in L92

from
/usr/lib/nagios/plugins/check_procs -w :1 -c 1: --ereg-argument-array "^([^ ]+)?python.*univention.connector.ad.main(.py)?\$" >/dev/null 2>&1

to
/usr/lib/nagios/plugins/check_procs -w 1: -c 1: --ereg-argument-array "^([^ ]+)?python.*univention.connector.ad.main(.py)?.*\$" >/dev/null 2>&1

→ warn on min 1 (instead of max 1)
→ allow multiple ad connector instances (after .py)
Comment 1 Florian Best univentionstaff 2020-08-21 10:16:25 CEST
Note that this is only happening in the customer environment because it has a forked version of the univention-ad-connector?!
At least --configbase is not given by default and I don't see that it is anywhere configurable.

+ Think about: Fixing Bug #49981 and get rid of the customer fork, if possible.
Comment 2 Andreas Peichert univentionstaff 2020-08-21 17:43:13 CEST
(In reply to Florian Best from comment #1)
> Note that this is only happening in the customer environment because it has
> a forked version of the univention-ad-connector?!
> At least --configbase is not given by default and I don't see that it is
> anywhere configurable.

Yes, this happens in a customer environment, but not by a fork. For the customer there are some extras added (by sperate py files).

No, the option --configbase is always set if an additional ad connector is configured. See L149 in ./services/univention-ad-connector/scripts/prepare-new-instance

> + Think about: Fixing Bug #49981 and get rid of the customer fork, if
> possible.

sounds great :-)
Comment 4 Julia Bremer univentionstaff 2021-05-18 18:05:57 CEST
successful build
Package: univention-nagios-ad-connector
Version: 8.0.1-3A~4.4.0.202105181752
Branch: ucs_4.4-0-errata4.4-8
Scope: errata4.4-8

1f9a75f13e Bug #51869: yaml
58ab67099f Bug #51869: False positive in nagios check if adcon is started with flags

Waiting for test results
Comment 5 Julia Bremer univentionstaff 2021-05-19 08:43:22 CEST
Tests were successful, created merge request
https://git.knut.univention.de/univention/ucs/-/merge_requests/96
Comment 6 Julia Bremer univentionstaff 2021-05-26 12:20:10 CEST
Package: univention-nagios-ad-connector
Version: 8.0.1-5A~4.4.0.202105261216
Branch: ucs_4.4-0
Scope: errata4.4-8

3d45b5f1c5 Bug #51869: yaml update
aed11294d0 Bug #51869: Check how many ad connectors are configured and if they are in autostart

The tool now checks how many different connectors were configured (additionalbasenames) and if they are in autostart to determine the correct number of ad connectors that are supposed to be running.
Comment 7 Felix Botner univentionstaff 2021-05-26 15:52:54 CEST
as discussed, remove the autostart (all init script use the same variable connector/ad/autostart)
Comment 8 Julia Bremer univentionstaff 2021-05-27 08:41:41 CEST
Ok

a4157b89a7 Bug #51869: yaml up
84e4d50b65 Bug #51869: version bump
50d9360dec Bug #51869: Dont evaluate autostart
 

Package: univention-nagios-ad-connector
Version: 8.0.1-6A~4.4.0.202105261601
Branch: ucs_4.4-0
Scope: errata4.4-8
Comment 9 Felix Botner univentionstaff 2021-05-27 13:31:38 CEST
as discussed should be critical if no (of two) connector is running (currently ADCONNECTOR WARNING: Not all 2 AD connectors are running!)
Comment 10 Julia Bremer univentionstaff 2021-05-27 16:47:50 CEST
And again. Sry

a807f799cc Bug #51869: yaml up
f3e3b3d38c Bug #51869: Raise critical if no adconnector is running
Comment 11 Felix Botner univentionstaff 2021-05-28 10:02:14 CEST
looks good,

test with 2 connector instances

OK both are running - ADCONNECTOR OK: System operational.
OK only one - ADCONNECTOR WARNING: Less than the 2 configured AD connectors are running!
OK more are running - ADCONNECTOR WARNING: More than the 1 configured AD connectors are running!
OK no connector is running - ADCONNECTOR CRITICAL: No AD connector is running!

OK - yaml