Nagios Plugin: Request for Comments

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Send me an email, that way I have yours, and it reminds me.. :)

But in all seriousness, I hope to review your code this weekend. But currently I have a few items I'm working on in 0.9.0 that need to get completed before I more forward.

Plugins are serious to me, and to the rest of the developers. We want to make sure that we present a unified interface to plugin developers that make it easy to intergrate with cacti. So, Ian and I have already had some conversation about plugins and the way we want to see it go.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
BrettS
Posts: 24
Joined: Tue Feb 15, 2005 8:49 pm

Post by BrettS »

divagater,

Thnaks for the reply. Ive been mucking around with Nagios and Cacti for a while. At the moment my "integration" is a bit flakey, using rrdread to query the rrds and alert from cacti, this means that, depending on the overall polling cycle it can be some time before an alert. Overall your plugin should help with this and make it a bit easier and responsive, and Im keen to assist you in any way. Im mot much of a coder but I can assist in functinal spec and testing. Ive duplicated our production nagios and cact setup so we can do some fairly rigorous testing if youd like.

thanks

Brett Stevens
aleto
Posts: 39
Joined: Wed May 25, 2005 3:57 am

Post by aleto »

Any progress yet on this module? Or any testing. Id be happy to help out!
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

Sorry for the lack of information last week. Our datacenter lost power (no, thats not supposed to be able to happen) and as a result we lost an important file server. So the whole week was lost to forensics and damage control :(

With the plugin I keep thinking of features that would be cool and start work on them and of course that grows out of control quickly. I need to just pick a spot to stop and solicit some help with testing.

I may need some help from any C programmers out there. I know just enough C to be dangerous. The module that I use to get Nagios data into a database is very good but missing a couple features that I think would be nice to have. Right now I am making up for some of the things it doesn't do, primarliy service groups and comments in the UI. As far as I can tell comments and service groups don't affect backend Nagios logic in any way (acknowledgments do but they are being handled correctly) so implementing them only in the UI may be satisfactory.

Cheers,
Billy
BrettS
Posts: 24
Joined: Tue Feb 15, 2005 8:49 pm

Nagios plug

Post by BrettS »

Just a quick catchup, how are you going with this plugin and is there any thing along the lines of testing I can do to assist.

Also have you thought of adding a config item to link the tholds plugin to nagios via passive alerts?

thanks

Brett Stevens
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

Hi Brett. Development is still moving along. I always seem to over estimate what I can get done between work and personla projects.

Right now the plugin is what I would call alpha. I am running it in my production environment along side Nagios to look for any inconsistencies. 1 other user from this forumn is alos testing it in his environment.

So far its looking really good. I have not had any data inconsistencies. I don't think I have much more to do before releasing it as beta. I have a couple more screens I want to add etc.

I did find one annoying bug that causes NPC not to update if Nagios is configured with state retention and then reloaded or restarted. For now I have just disabled state retention in my Nagios because its not that important to me but others may be unsatisfied with that behavior.

I am still looking for some ideas to add thold data as well. I think I should be able to come up with something creative when I put my mind to it but am also open to suggestions :)

Cheers,
Billy
BrettS
Posts: 24
Joined: Tue Feb 15, 2005 8:49 pm

Post by BrettS »

Thanks for the update. I would be very keen to assist in the testing if you like.

Brett Stevens
BrettS
Posts: 24
Joined: Tue Feb 15, 2005 8:49 pm

Post by BrettS »

divagater, Thold and nagios is key to integrating cacti and nagios, I think.

Ive been working on integrating at that point and should now have some further info by the end of the day. What Im doing is using a log scraper (swatch, logsuerfer SEC) to watch for thold log messages and then pass them over to nagios via passive checks. What would be great is if thold or your nagios plugin to have some form of macro/template so as to correctly format the log messages as well as to provide a destination item to the thold setup pages so we could drop the thold formatted message strait into the nagios pipe, circumventing the need for a log scraper, thus reducing the load on the box. Additionaly as part of your plugin the ability to tag certain graph entries along the lines of "Add this to the nagios alerts for this host" type of thing.
Another one, you are probably looking into this, but its worth checking anyway, do you or will you be linking the "nagios extra info for this check" back to the cacti graphs?

thanks

Brett Stevens
RampeStamp
Posts: 2
Joined: Thu Jun 30, 2005 10:47 am

Post by RampeStamp »

I was also wondering how the status of your plugin is.

I thought about to make it myself, but then I found your thread in this forum. Can you share the plugin with me, maybe we can develop it with more people.
Otherwise I think of develop it myself anyway, because I tried several options, but this option (Nagios together with cacti) seems the best combination in existence.

I hope I hear from you ..
mball_th
Posts: 1
Joined: Wed Jul 20, 2005 4:14 am

Status of your plugin

Post by mball_th »

้ำHej guys......
What is status of your plugin (Nagios in Cacti)?..
Could you zip all the necessary that would be help our friend here?

Waiting your reply....
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

I've just started looking at thold, but it seems to me that this should be fairly simple. Can anyone think of any reason why this shouldn't be a simple as adding a "Nagios" notification method to thold that will send a passive alert to the Nagios named pipe?
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

Ok, I finally have this up and running, attached is my patch to add Nagios NSCA support to the thold plugin. Applying this patch will add additional information to the "Nagios Notification Options" in the thold settings, you will need to set the following:
  • Nagios Service Name Prefix - the services submitted to NSCA will have this prefix, so if you were to put cacti_threshold here, and had a threshold called watchmaillog, the service in Nagios that receives the alert would be cacti_threshold_watchmaillog
  • Nagios Send NSCA Path - the full path to the NSCA application on the cacti server
  • Nagios Host to Send NSCA - the Nagios server that will receive the NCSA message
  • NSCA Configuration file - the send_nsca.cfg file
I would appreciate hearing from anyone who gives this a try and if you have any suggestions for how to make it better. It works for me, your mileage may vary.... :)

Jimmy, if folks find this useful, is there any chance of adding it to the next thold release?
Attachments
thold-nagios.patch
(14.21 KiB) Downloaded 393 times
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

You replied to yourself almost 3 years later lol. As an FYI the version of NPC in this thread from 2005 is no more. The latest 2.x version is referenced here: http://forums.cacti.net/viewtopic.php?t=26540

Cheers,
Billy
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

Well, I did write the patch almost a year ago, I only just had time to get it working all the way recently (i.e. something broke that we could have caught earlier had we linked the cacti thresholds into Nagios :).

Just to be clear this is a patch against the threshold plugin, it is independent of NPC. Unfortunately I can't run NPC in my environment as my Cacti and Nagios servers have to run on separate machines. The two systems can barely keep up as it is, if there were on the same system there is no chance either would ever be up to date (60,000 rrd files in Cacti and 550/3500 hosts/services in Nagios). It's an I/O issue so there isn't an easy way to make it all run on the same box.
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
flukester
Posts: 17
Joined: Fri Jan 16, 2009 3:01 pm
Location: Montreal, QC, Canada

Post by flukester »

Dan, I had a quick look at your patch and it looks like the diff file is incomplete. I haven't tried it yet but here are my first comments.

Your diff printed the following warnings:

Only in thold: graph_thold.php
Only in thold: nagios.php
Only in thold: nagios-test.php
Only in thold: nsca.php

Three of these files are referenced elsewhere in your code (include directives) so I'm guessing they are simply missing from the patch. I didn't find any reference to the graph_thold.php file but maybe one of the other missing files is referencing it?

Could you please recreate the patch using "diff -ruN" so that diff will include the contents of the new files as well?

Thank you very much!
Antoine
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests