Spoolfolder documentation might use an update #469
Replies: 1 comment
-
I guess some refresh of the documentation would be not too bad, feel free to send over a pull request :)
Yes, Naemon will simply ignore all files where the filename length is != 7 and the first char is not a naemon-core/src/naemon/checks.c Lines 246 to 247 in 22f0fb6 This is probably from back in the (very) old days, when the spool files where used by Nagios for internal communication between the forked processes. The files where created using The Naemon fork uses the query handler for this since day 1 AFAIK. You do not need to use a hash or something like this. I did it this way:
The naemon-core/src/naemon/checks.c Lines 391 to 393 in 22f0fb6 My best guess is, that this is for humans debugging the files back in the day when this feature got used internally.
That's true, naemon-core/src/naemon/defaults.h Line 23 in 22f0fb6 I'm not so sure about the naemon-core/src/naemon/checks.c Lines 279 to 283 in 22f0fb6 The second one checks the value of naemon-core/src/naemon/checks.c Lines 417 to 425 in 22f0fb6 The comment says it's important that that the So i would say, yes it's better to add the header to your files.
That's true, there is an open pull request that fixes this. From my understanding the naemon-core/src/naemon/checks.c Lines 442 to 448 in 22f0fb6 and Naemon will go with the default of 0 for start_time if it is missing.naemon-core/src/naemon/checks.c Lines 519 to 520 in 22f0fb6 So i guess its better to make sure you always have I always set // Edit |
Beta Was this translation helpful? Give feedback.
-
The spoolfolder documentation page fails to be clear about certain things.
Is this really so? I found it hard to hash names given so few characters; a hash is pretty much necessary for my usage case. I've managed to solve it and my hash seems to work, but it would have been nice to have a larger namespace to work with.
The page offers an example of what a proper spoolfolder queue file should look like internally:
But in the example at the bottom of the page, this header is omitted. So, is this header really required? And is the comment-looking first line required to be that exact string (###Active Check Result File###)?
Just after this, the doc indicates
Trouble is, I can not find much if any documentation on this
max_check_result_file_age
. It seems to be hardcoded into naemon (strings -a on the binary shows it is indeed in the code). Again, the example at the bottom of the page does not include the header with this information, so is it really necessary?The example at the bottom of the page has this set to 0, which means it will be discarded. For hours and days, I could not understand why my check spool files were not getting processed! Might be better to illustrate it as "1" (the more normal case), or otherwise comment within the lower example that this file will be discarded.
The example at the bottom shows both of these having ".0" as the fractional part of the time--is this fraction actually required? Or does the doc imply they are optional? In my case, fractions are usually available with the checks I am generating. In other cases, I just add that ".0" literally to the end of both time strings. However, I have noticed that this fraction does not seem to matter and, in fact, when I have forgotten to generate these times, the checks still worked! (Maybe I just got lucky, idk.)
All of this might be obvious to the more veterate users of naemon, but it is confusing and frustrating for at least one user. That said, I do have all of this working after a long struggle. The spoolfolder is a powerful and (very much!) necessary part of naemon; without it, long output lines (with option perfdata) will not make it through the naemon.cmd pipe in one piece if there are multiple lines, in my own experience at least.
Given the necessity and usefulness of this facility, I think a doc update is warranted. Keep up the good work, thanks!
Beta Was this translation helpful? Give feedback.
All reactions