Usually i use 0,1,2 but for this post i just copied the code from the official documentation.
My Service goes to warning and works but the detail output is missing
If you pass the letter P instead of a number in the first field of the output that determines the state, the service’s status will be calculated on the basis of the threshold as provided.
@aeckstein the code is just an example. My problem is just the missing Details Output. Not sure why it isnt working anymore. Instead of writing the Details into the check, the monitoring tries to create another service instead.
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:
These define the thresholds for the calucation of the check status :
Some parameters have not only an upper threshold but also a lower threshold. An example is humidity. For such cases the local check has the option of passing two threshold values each for the states WARN and CRIT. They are separated by a colon and represent the lower and the upper threshold value respectively.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.