I haven't run this in production yet, but it seems to me from reading the bash script that it will only return one status for the entire dump of data and one message. In our case, certain checks should be polled at certain intervals, and also we'd want different escalation depending on which check it was.
Am I missing something or does this script basically just set a status in Nagios and then dump the entire string?
How would you implement a more specific check? Should the data be parsed in the plugin? Or would you recommend different endpoints?
Also, why did you decide to use the format you did? Doesn't it make more sense to use a known serialization format like XML, JSON, YAML, etc?
Best,
Jacob
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | specific_check_and_documentation_update.patch | 6.64 KB | JacobSingh |
| #1 | specific_check_and_documentation_update.patch | 4.15 KB | JacobSingh |
Comments
Comment #1
JacobSingh commentedI've created a patch which gets this working. Also, I was updating the docs and decided to move them to nagios.api.php which I believe is the common format these days. It's more or less the same, but I added the new param there to the hook definition.
I also removed the $skip_invoke stuff because it didn't seem like it was doing anything.
is the gist of it.
Comment #2
kbahey commentedI am still not clear on what the problem was that this patch fixes, but see that if no module is specified, it will still work as it always did via invoke all.
The patch does not include the nagios.api.php file. Please attach it as a .txt and I will add it.
Comment #3
JacobSingh commentedSorry if the point wasn't clear. The problem is:
Perhaps we want to run a bunch of different checks, but get the status of each one individually because we would escalate them differently. We also want to run some checks every minute, but some are more intensive or don't want constant alerts, so we run them every hour.
Bad, generic example:
Say we've got 10 checks we want to run. I can't think of great examples, but let's called them c1...c10
We want to check c1 every minute, and if it fails, throw a CRIT
We want to check c2, c3 and c4 every 5 minutes, they all have different error levels they might throw.
With the current code, there is no way to do this. With my patch, we can setup 5-6 services in Nagios and tune them to just check what we need to check when. And of course, the original functionality hasn't changed as you noted.
My bad on the new file. f*!@#@ing CVS.
Attached the new patch.
Thanks!
Comment #4
kbahey commentedCommitted.
It is backward compatible, so safe, even if it adds a new feature.
Shukrya hein ...
Comment #5
JacobSingh commentedKoi baat nahi :) Shukriya
I didn't know you spoke Urdu! how did you learn? Or is it the same in Egyptian Arabic? I don't know, but I think it's Shukran in Arabic
We should chat sometime about nagios. I'm trying to figure out how to build something with rrdtool to do performance monitoring (send perf stats to nagios and build tables and graphs). If you have any ideas in this area, I'd appreciate it.
Best,
J
Comment #6
kbahey commentedI don't speak Urdu/Hindi. Just know a few words/expressions, and as you said, there is a lot of borrowing from Arabic. So some of it sticks out.
Open a new issue for graphic nagios performance data. Seems like something interesting to do.
Comment #8
xcession commentedAs far as I can tell the nagios.api.php example file that JacobSingh provided in his second patch file - which is vital for anyone trying to roll their own nagios-enabled modules - is still missing from the stable release, despite the other changes in this ticket being merged (namely the removal of the api documenation from the README).
As a result there is currently no api documentation.
I've altered the component of this issue to be "Documentation" accordingly.
Comment #10
greg.harveyHmm, I'm confused by the status of this. It's open under D6, but something was committed to the D8 branch?
Comment #11
greg.harveyRight, I think the above was just the commit bot having a "moment". This is seems well obsolete now. Closing.
Comment #12
greg.harveyActually, I realised the comment in #8 is still valid, the README was changed the API documentation file was not added.
I've added it now, as all the other code is in. I imagine this is still valid for Drupal 8 as well, however I noted Drupal 8 has a kind of hybrid README file, so the docs need checking before this gets merged through.
Comment #13
greg.harveyCommit bot isn't showing the commit, so for reference it's here: http://cgit.drupalcode.org/nagios/commit/?id=27a7400
Comment #14
gogowitsch commentedI added the API documentation in Commit a6733b5a.
Also, both Drupal 7 and 8 now allow the HTTP status page to return information on a single module, and pass an
$idtohook_nagios().On the Jacob's question about the format: it is the classical Nagios format. If someone needs a new format, you are very welcome to open a new issue. Thanks!