Yogibaer75 / Check_MK-Things

From check plugins to website extensions
60 stars 19 forks source link

Problems with missing Data on Raritan PDUs #62

Closed nightwatcher74 closed 4 months ago

nightwatcher74 commented 5 months ago

Hi Yogibaer75,

thanks for your addon and the high quality code ;)

After the Conference #10 the first thing he have done is to check the plugin on our 2.3 test site (we are not on 2.3 on production) and found a problem that also exists on the SNMP raritan check. There are several PDU types with no Data on the output side and we habe abour 200-300 from this PDUs. On the SNMP Check the Outlets would unconditionaly discoverd and then is unknown... your check will crash because on a subsewuent fault:

 File "/omd/sites/dev_fb/lib/python3/cmk/base/checkers.py", line 716, in get_aggregated_result
    check_result = check_function(**item_kw, **params_kw, **section_kws)
  File "/omd/sites/dev_fb/lib/python3/cmk/base/checkers.py", line 496, in __check_function
    return _aggregate_results(consume_check_results(check_function(*args, **kw)))
  File "/omd/sites/dev_fb/lib/python3/cmk/base/checkers.py", line 554, in consume_check_results
    for subr in subresults:
  File "/omd/sites/dev_fb/lib/python3/cmk/base/api/agent_based/register/check_plugins.py", line 91, in filtered_generator
    for element in generator(*args, **kwargs):
  File "/omd/sites/dev_fb/local/lib/python3/cmk/plugins/redfish/agent_based/redfish_outlets.py", line 61, in check_redfish_outlets
    yield from check_elphase(
  File "/omd/sites/dev_fb/lib/python3/cmk/plugins/lib/elphase.py", line 120, in check_elphase
    value * factor,

and the local Vars:

{'Bounds': <class 'cmk.plugins.lib.elphase.check_elphase.<locals>.Bounds'>,
 'bound': 0,
 'entry': None,
 'factor': 1,
 'item': '7',
 'levels_lower': None,
 'levels_upper': None,
 'params': Parameters({}),
 'quantity': 'voltage',
 'render_func': <function check_elphase.<locals>.<lambda> at 0x7f9e3a8bb420>,
 'section': {'7': {'current': None,
                   'frequency': None,
                   'power': None,
                   'voltage': None}},
 'state_info': None,
 'title': 'Voltage',
 'value': None}

I on the discovery side there should be checked that the (all?) values are not None. I don't know if it will be enough that one of the values exists or if all values must be existing...

We are using

and you can find the crashdump attached. There is also an very important value missing, I wrote an SNMP Check a few weeks ago: redisuial current (in German Ableitstom). it would be grat if this can be included in the redfish check?! I will open a second ticket for the.

Thanks for your work :)

Frank

Checkmk_Crash_dev_fb_46748d4a-2a4d-11ef-a7b8-005056b3ea1f_2024-06-17_08-47-08.tar.gz

Yogibaer75 commented 5 months ago

Sorry the crash report is broken. It would be good to see the agent output for such a outlet. For myself it is important to know what is written there. It makes no sense to check if there is current or not directly. It is relevant if this outlet is aktive or not, then i can say it is active but no device connected and it will not do the voltage check. I think it is understandable what i mean 😉

nightwatcher74 commented 5 months ago

Hi Andreas,

This Type of PDU has no values per socket, only per fuse and obverall input values (and the residual value overall) On the output side I can only configure the name and see the fuse to wich a socket belongs to. And the outputs are not remote switchable so always aktive.

Here you have the same mockup as in the other ticket (it's the sam PDU Type and the crashdump again and I hope it is readable)

Thanks Frank

PX3-1528-M5P1.tar.gz

Checkmk_Crash_dev_fb_6acd5114-2cc2-11ef-a7b8-005056b3ea1f_2024-06-17_17-59-01.tar.gz

Screenshot 2024-06-17 180052

Yogibaer75 commented 5 months ago

Ok with the mockup i can fix the outlet problem. This should be no bigger task.

Yogibaer75 commented 5 months ago

Outlets are fixed now - no crash anymore. Only the Input needs a little bit more work as your input is multiphase and my dump from first development was single phase. But this will be done the next days i hope. fixed with 555d8db