|
|
| Author |
Message |
MagicOneXXX
Joined: 19 Dec 2006 Posts: 49
|
Posted: Thu Jun 07, 2007 9:53 am Post subject: Nagios integration |
|
|
Hey all:
I'm looking into using nagios at our company, and I'm interested in using the weathermap to display host/service states. I saw there is an existing project called nagvis that does this very nicely, with mouse-over information on host/service problems. I'd like to see this functionality in weathermap, which I've read can be done, but don't see any information on exactly how to go about it.
I assume you can specify a script in the target, though i'm not sure what the script should be returning to weathermap. I also don't know how to go about doing a mouse-over status report - can a script be specified? Should the target script build a mini-html page that is then pointed to from overlib?
Any help would be appreciated! |
|
| Back to top |
|
 |
Livio Zanol
Joined: 23 Feb 2006 Posts: 30
|
Posted: Thu Jun 07, 2007 11:42 am Post subject: |
|
|
Hi,
In my company we are doing some integrations with Nagios and weathermap on this way:
Configuration:
- PHP Weathermap V 0.82
- Nagios 2.5 with NDOtoDB (storing Services, Hosts and their respective states) NDO can be found in the nagios official webpage (www.nagios.org)
- RRDtool graphs using MRTG config files and routers2.cgi as frontend
How to:
The nodes that are on the weathermap are named exactly as they are in Nagios (maybe a "pick from nagios" in the editor will help). In the config file under the nodes section there is a commented out line containing the node services that is part of the weathermap.
Ex.:
NODE SERVER1
LABEL SERVER1
#SERVICES PING,HTTP,FTP,SMTP
weathermap is executed and the links usage are updated. An PHP page is called using the config file as parameter. The PHP script checks out the Nagios database looking out for services that have some kind of problem, if it's a warning the icon is replaced by an yellow like, if It's critical the icon is replaced by an red like. The overlib is used to construct an onmouseover containing services informations for that host.
Here are two examples on how this would look like (still in develop):
 |
|
| Back to top |
|
 |
MagicOneXXX
Joined: 19 Dec 2006 Posts: 49
|
Posted: Thu Jun 07, 2007 12:54 pm Post subject: |
|
|
Very cool. I'd be interested in seeing your php script, since I do have NDO installed (needed it for nagvis when i was playing around with it).
I also thought of writing a perl script that uses the Nagios::Status or Nagios::StatusLog perl modules, but i'm not that familiar with perl. Also, I need some more information on how weathermap digests the scripts, since i've never played around with MRTG.
Howie, would it be possible to code this functionality directly into weathermap? If livio could provide his script, i'm sure it would be easy to parse its input into weathermap. I'd be willing to take a crack at it  |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Thu Jun 07, 2007 1:24 pm Post subject: |
|
|
| MagicOneXXX wrote: | Very cool. I'd be interested in seeing your php script, since I do have NDO installed (needed it for nagvis when i was playing around with it).
I also thought of writing a perl script that uses the Nagios::Status or Nagios::StatusLog perl modules, but i'm not that familiar with perl. Also, I need some more information on how weathermap digests the scripts, since i've never played around with MRTG.
Howie, would it be possible to code this functionality directly into weathermap? If livio could provide his script, i'm sure it would be easy to parse its input into weathermap. I'd be willing to take a crack at it  |
One of the reasons I added the datasource plugin stuff in 0.9 was for exactly this. You can either: get the data into the existing readable formats (RRD, or plain tab-seperated text), or write a new datasource plugin to read the data directly, like the cactihost: data source plugin does.
Personally, I'd go for the quick & easy text file just to test it out.
The popup status is a little trickier. The NOTES command allows you to add static text under (or instead of) the overlib image, but it is static in the config file. You could use some perl to make an image of the popup text - that's not too hard with something like Imager or GD, or you could have a 'master' config and use something like sed or m4 to paste in the current statuses. Finally, you *can* use the {node:this:blah} type of tokens in the NOTES section, so if you wrote a new DS plugin, it could create new variables for use there.
To get all the functionality you are after, a DS plugin would be needed really. I'd be happy to help, although I don't use Nagios myself. I found it to be a bit clunky compared to WhatsUp, although we are about to review our monitoring situation. I'd be interested in working a little on this plugin though. |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|