Cacti + nagios(nsclient)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
s16pt
Posts: 17
Joined: Mon Sep 12, 2005 12:03 am

Cacti + nagios(nsclient)

Post by s16pt »

Hello ,
I've searched for all topics about nagios or nsclient.But I still don't understand how to use nsclient to show trend chart in Cacti.
For examples, I installed nsclient on remote NT machine and works fine in Nagios. What steps is the NEXT?
Create queries file(xml) or host templates(xml)?

Did anyone contribute your config and set procedure ?

*****________________**********

Any advise could highly appreciated.
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

Do you want Cacti to poll the machines, or do you want to graph the data that Nagios is already collecting ?
jef
Posts: 17
Joined: Thu Aug 25, 2005 3:27 pm
Location: ./

Post by jef »

I'm looking into this also,
in my case i'd like Nagios to poll and forward to Cacti,
so that alarming is done before graphing.

Jef
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

You need to put the data in .rrd file.

Enable performance data gathering in Nagios, and use a script such as Nagiosgraph to build the .rrd
You will also want to build some custom templates for graph and datasources, based on the way you created the .rrd.
olivier
Posts: 2
Joined: Tue Aug 30, 2005 7:54 am

Post by olivier »

I'm looking for this too. I saw several persons who suggest to poll data with Nagios and create rrd files with it. I'have done this part of work. Now I need to create the graphs with Cacti based on these rrd files.

Exo7, can you help me on this point ? Can you explain me step by step the way to create templates for graphs and datasources to use this rrd files ?

Olive
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

Here is how I proceed :

* create a custom data input method
> name : "polled by Nagios"
> input type : script/command
> input string : <nothing>
> no input or output field
This data input method will be used by our custom templates for rrds build by Nagios. It will be easier to distinguish them among others.

* create a data template for each type of service you monitor in Nagios and you want to graph. example for ping :
> data template name : "Nagios - Ping host"
> name : |host_description| - Ping Host
> data input method : "polled by Nagios"
> step : 300
> data source active : no
data source must not be active, because we don't want Cacti to update those .rrd.
> create one data source item with the name you gave it in the "map" file of Nagiosgraph.

* create a graph template for each type of service you want to graph (you will have 1 graph template for each data source template you created)
there is nothing special in graph template creation, use the normal method. You may want to use the custom data source template you just created in the "graph template item data source" field.
olivier
Posts: 2
Joined: Tue Aug 30, 2005 7:54 am

Post by olivier »

I forgot to thank you for your help. It's done now :-)
s16pt
Posts: 17
Joined: Mon Sep 12, 2005 12:03 am

Post by s16pt »

Did anyone provide SOP(Step-by-step)? I still don't understand ho to use nsclient to graph in cacti.Please give me a hand.Thanks.
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

NSclient is a service installed on a windows boxes so that you can call a specific plugin (called check_nt) from Nagios.

Once you get correct monitoring values from Nagios, you can install Nagiosgraph and tune the map file, in order to create rrd files with the values returned by check_nt.
s16pt
Posts: 17
Joined: Mon Sep 12, 2005 12:03 am

Post by s16pt »

I found a excellent template here. Hope it's helpful.
http://forums.cacti.net/viewtopic.php?p=47327#47327
koaps
Posts: 12
Joined: Thu Feb 15, 2007 1:37 pm

DS Name

Post by koaps »

Hello all,

I'm working on getting Nagios, Nagiosgraph, and Cacti working together and I wanted to ask a question about one of the steps listed..

" > create one data source item with the name you gave it in the "map" file of Nagiosgraph. "

Is that the DB-Name or the internal DS Name in the map file?

For example

# Service type: ping
# output:PING OK - Packet loss = 0%, RTA = 0.00 ms
/output:PING.*?(\d+)%.+?([.\d]+)\sms/
and push @s, [ ping,
[ losspct, GAUGE, $1 ],
[ rta, GAUGE, $2/1000 ] ];


Do I use ping? or losspct, rta and create two data source items for the Nagios - Ping data template?

I was also curious if this method will store information in MySQL for data retention.

Thanks for any help,
-C
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

It is the internal DS name
Do I use ping? or losspct, rta and create two data source items for the Nagios - Ping data template?
=> The two data source items you have to define are "losspct" & "rta".

nagios mysql data retention is another story, you could do both at the same time as it doesn't interfere.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests