SAP HANA statistics server always critical

Hi,

I’m monitoring a SAP HANA system using the plugin provided with check_mk. One of the checks is monitoring the statistics server. However, this check is always critical, even though the statistics server is running. From the documentation I get:
If the active state is FALSE or NO, the check state is CRIT, otherwise the check goes OK.
If there are no startet threads the check goes CRIT.

In the output of the check I get:
Output of check plugin CRIT - Active status: yes, Started threads: 2 CRIT

So why does it turn critical? It’s running and has started threads, so far as I’m concerned it should be OK.

I’m running Checkmk 1.6.0p12

1 Like

You encountered a solid bug in the check plugin ~/share/check_mk/checks/sap_hana_ess. :open_mouth: Nice finding. The code says:

...
started_threads = data.get('started')
if started_threads is None or started_threads < 1:
    state = 2
else:
    state = 2
yield state, 'Started threads: %s' % started_threads, [('threads', started_threads)]

That is: no matter the number of threads, the state is always set to 2 (CRIT). I checked with 1.6.0p11.

The code should rather be:

started_threads = data.get('started', 0)
if not started_threads:
    state = 2
else:
    state = 0
yield state, 'Started threads: %s' % started_threads, [('threads', started_threads)]

To fix it yourself, copy the check plugin from ~/share/check_mk/checks/sap_hana_ess to ~/local/share/check_mk/checks/sap_hana_ess and apply my suggested change.

Thanks. I can see how this effects the output of the check. I’ve applied your fix and now the statistics server is indeed monitored correctly.

1 Like

You’re welcome. Glad I could help. Make sure you apply the fix below the local directory because else it gets overwritten with the next update (assuming the bug still exists in p13). When officially fixed, simply remove your fixed copy below local.

Thanks, that’s a good tip.

Thanks @louis & @Dirk
will be fixed with Werk #11034

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.