Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Fri Sep 19, 2014 10:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Nagios and Cacti Integration
PostPosted: Wed May 25, 2005 10:15 am 
Offline

Joined: Wed May 25, 2005 10:11 am
Posts: 2
Location: Birmingham UK
All,

I am currently implementing a central Nagios system to monitor approximately 60 linux/aix servers and then approximately 50+(possibly as many as 300) Windows servers with the Windows OS' running Windows 2000 and Windows 2003 Standard to Enterprise.

I have got Nagios carrying out all the monitoring but would like Cacti to use the performance data it is generating. Is there a way for Cacti to act on the performance data that is being logged to a file or for Nagios to use a named pipe to feed data directly into Cacti?

TIA.

Gavin


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 11:19 am 
Offline
Cacti User

Joined: Mon Nov 29, 2004 11:43 am
Posts: 53
The only check in nagios that i know that exist for cacti is:

check_mrtg

but i can't explain you how it works...


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 11:31 am 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
You can't "feed" data into cacti. Cacti is designed to poll it.

That being said, you could have Nagios "feed" the data into files and cacti pick it up.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 2:06 am 
Offline

Joined: Wed May 25, 2005 10:11 am
Posts: 2
Location: Birmingham UK
rony wrote:
You can't "feed" data into cacti. Cacti is designed to poll it.

That being said, you could have Nagios "feed" the data into files and cacti pick it up.


Rony,

Thanks for the prompt reply. As Nagios uses both a configurable and standard way of storing it's performance data

http://nagios.sourceforge.net/docs/2_0/ ... e_template

http://nagios.sourceforge.net/docs/2_0/ ... e_template

Are you aware of any existing Cacti script that is able to poll these performance files and then plot it accordingly.

Thanks,

Gavin


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 7:45 am 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
I'm extremely familar with Nagios.. :)

No, I don't know of any such scripts. But I would suggest checking out the Scripts and Addons section of these forums.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject: Side by Side
PostPosted: Thu May 26, 2005 4:28 pm 
Offline

Joined: Mon Dec 13, 2004 10:09 am
Posts: 18
This is something I would like to do as well. I was about to start testing Nagios but of course things came up and i haven't had time to play with it. Is there any issues running them on the same server? Anyone know of a write-up that talk about installing them both? I would be interested in any information about using them together - shoot me a mail. toddtowles[~at~]brookshires.com

-Todd


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 5:05 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
No issues running them together. Other than watching that you don't kill the system.. :)

I had a number of installations running Nagios and Cacti number 300+ nodes monitored. And the only problem I had, before switching to cactid, was high loads durning cacti polling.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 2:46 pm 
Offline
Cacti User
User avatar

Joined: Tue Nov 25, 2003 3:58 pm
Posts: 164
Location: Buffalo, NY
I know that Big Brother (and HOBBIT?) use LARRD to gather the data that is being displayed for that test and puts it in an RRD, and generates the graph to go inside that test page.

...other than that, it seems like you'll need to write a script to parse data files and stick the data in an RRD. To do this from another machine is to have a link to those cfgfiles on a webserver and use curl in the script to get the data. This is not the best way, but is a good way to get it done - in a duct tape sort of way :wink:


Top
 Profile  
 
 Post subject: Nagios - Cacti integration
PostPosted: Tue May 31, 2005 12:36 pm 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
(please forgive the randomness, I'm thinking out loud)

Someone help me out if I am wrong. I haven't worked with cacti in a while. The polling that's done, is really only to feed the rrd files.

Nagios uses plugins to get status data from nodes it monitors. I would assume that there is a way to write a "wrapper" (probably in perl) for the plugins.

Nagios calls the plugin
The plugin gets data
The plugin stuffs the data into an rrd file
The plugin reports to nagios the status data

So your service command might be "cacti_wrapper!check_http!myhost.rrd".

I guess the big trick is to find out how to put that data into the rrd file.

As long as the rrd files get updated, you don't need to have cacti poll. It's just going to display what's in the file. How that data gets there doesn't matter.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 12:45 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
Could do it the other way around... :)

Cacti polls, and stores the data. Plugin for Nagios gets the RRD file and returns the last value to Nagios... :)

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 12:56 pm 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
rony wrote:
Could do it the other way around... :)

Cacti polls, and stores the data. Plugin for Nagios gets the RRD file and returns the last value to Nagios... :)


That's true. Nagios also supports passive checks, so you can have cacti tell nagios the status.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 1:10 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
Correct, you could have a script that runs right after the poller that would push the data, via passive checks to nagios.

Which, probably would be the easiest and less taxing way to do this.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 10:20 am 
Offline

Joined: Fri Jun 03, 2005 10:08 am
Posts: 2
I am also interested in doing this. It seems to me that there are 4 ways this could be done.

1. Cacti does the monitoring and somehow sends the data to nagios via passive checks

2. Cacti does the monitoring and nagios reads the rrd files with a plugin

3. Nagios does the monitoring and sends the data to an external file that cacti reads with some kind of data input script

4. Nagios does the monitoring and puts the data directly into the rrd files

I would be interested to hear what people think are the pros and cons of these options.

It concerns me that I will end up with some things monitored by nagios, some by cacti and it will all get a bit confusing.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:22 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
Quote:
1. Cacti does the monitoring and somehow sends the data to nagios via passive checks


I think this is the best option, from the stand point of not having Nagios work overtime to poll the data. Depending on check times, and intervals, this could be an issue. But, this option would allow you to run the cacti poller, then have a script that would run right after the poller. This script would read a configuration file, or something, and then would submit passive checks to the Nagios Command Pipe. This way, you don't have nagios and the poller competing for processor, at least as much as they would in other senarios.

Plus, the only complication with this method is the configuration of the passive services and what cacti metrics are passed to nagios. The script would read the database, get the rrd file, read the value, format it and submit it to nagios.

I would suggest that the configration be easy. What I mean by that, you would have the host (same on both systems), the service, the Cacti DS_ID and the Cacti DS value. The DS value, would have to support some sort of calculation syntax, so that you could do simple calculations, IE, percent. Then the script would use the Cacti DS ID to look up the RRD file path, then call RRD, retrieve the values, process the defined calculations and finally submit the passive check to Nagios.

Not that I haven't thought about this in the past.. :D

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:45 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
Quote:
3. Nagios does the monitoring and sends the data to an external file that cacti reads with some kind of data input script
4. Nagios does the monitoring and puts the data directly into the rrd files


Not a good option, because of the way service and host checks work in Nagios. You can't even be sure that it will check it with in the typical 60 seconds. To much is unknown concerning the interval that you are polling.

Quote:
2. Cacti does the monitoring and nagios reads the rrd files with a plugin


More doable, but again, you would have nagios hitting the RRD file every minute or so, this does not scale well. :(

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group