CheckMK Local Check Details Output not working

So it is as Robert said: for multiline output in a local check you have to print a literal \n.
That’s two characters: a backslash and a single n, not an escaped newline character.

In Python that would be:

print('P "My service" humidity=37;40;60;30;70 My service output\\nA line with details\\nAnother line with details')
                                                               ^^^                   ^^^

In shell (echo command) no such double backslash is needed because the echo command doesn’t know about such special characters anyway and doesn’t interpret them. So there echo "...\n..." is sufficient to print a literal backslash followed by a literal n.


Btw: the numbers in the metric must all be separated by semicolons. The colons in the original post were wrong:

Wrong: `humidity=37;40:60;30:70`
                      ^     ^

Right: `humidity=37;40;60;30;70`

Update: forget about this statement about colons and semicolons.