Nagios Plugin for Cacti (NPC) 2.x - Preview
Moderators: Developers, Moderators
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
TFC wrote:Existing NPC versions can support Nagios 3.x ?
Yes
http://trac2.assembla.com/npcTFC wrote:Which NPC version is latest one and where is it?
Cheers,
Billy
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
No. ndoutils gets installed as a nagios module. if for some reason it made your nagios stop working then just remove the module although ndoutils is written by nagios author and works well with nagios.TFC wrote:Ok. thanx..
But, I have another question.
I have a nagios 3.x and I still use it.
But I didnt install ndoutil at begining. If I install now, will be any problem existin my nagios structure?
Cheers,
Billy
Hi,
I install ndo2db and set config files etc. acording to nagios' and your documents But nothing change in npc tab on cacti. I look at the nagios.log
I see that:
But my cacti runs on another server. Should I change to db_servertype as cacti server IP address instead of localhost?
...
Ok change it . But still same error I get:
.....
I select 127.0.0.1 and in nagios.log something changes:
In nagios machine there is no nagios db. Should I create?
What is wrong?
I install ndo2db and set config files etc. acording to nagios' and your documents But nothing change in npc tab on cacti. I look at the nagios.log
I see that:
and in ndo2db.cfg file, there is a config like that:ndomod: Still unable to connect to data sink. 17736 items lost, 5000 queued items to flush.
Code: Select all
db_servertype=mysql
db_host=localhost
...
Ok change it . But still same error I get:
Then , I check ndomod.cfg:[1226393109] ndomod: Shutdown complete.
[1226393109] Event broker module '/usr/local/nagios/bin/ndomod-3x.o' deinitialized successfully.
[1226393109] ndomod: NDOMOD 1.4b7 (10-31-2007) Copyright (c) 2005-2007 Ethan Galstad (nagios@nagios.org)
[1226393109] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[1226393109] Event broker module '/usr/local/nagios/bin/ndomod-3x.o' initialized successfully.
[1226393125] ndomod: Still unable to connect to data sink. 7261 items lost, 5000 queued items to flush.
[1226393141] ndomod: Still unable to connect to data sink. 7461 items lost, 5000 queued items to flush.
SO we use tcpsocket, and my cacti runs on another server; is this IP address must be cacti server IP address?# OUTPUT
# This option determines the name and path of the file or UNIX domain
# socket to which output will be sent if the output type option specified
# above is "file" or "unixsocket", respectively. If the output type
# option is "tcpsocket", this option is used to specify the IP address
# of fully qualified domain name of the host that the module should
# connect to for sending output.
#output=/usr/local/nagios/var/ndo.dat
output=127.0.0.1
#output=/usr/local/nagios/var/ndo.sock
.....
I select 127.0.0.1 and in nagios.log something changes:
Note that:[1226395444] ndomod: Successfully reconnected to data sink! 363 items lost, 5000 queued items to flush.
[1226395444] ndomod: Error writing to data sink! Some output may get lost. 4584 queued items to flush.
In nagios machine there is no nagios db. Should I create?
What is wrong?
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
It is fine that the cacti database is on another host. Just make sure that the IP address and credentials are correct in ndo2db.cfg.
Here is the data flow:
Nagios -> ndomod (nagios module) -> ndo2db (daemon) -> MySQL
Nagios communicates to ndomod via the event broker api and is configured in nagios.cfg. ndomod should be talking to ndo2db via tcp socket on the localhost port 5668. ndo2db should be listening on localhost port 5668. It does not matter where the cacti database is as long as it is accessible on the network.
Now you need to be sure to start ndo2db. I had problems with it dying so I put it under control of init and I show this in the last couple steps of the quick start guide.
Hope this helps,
Billy
The datasink that ndomod is referring to in the log entry above is not the database but rather the ndo2db daemon. Is ndo2db started?[1226393125] ndomod: Still unable to connect to data sink. 7261 items lost, 5000 queued items to flush.
Here is the data flow:
Nagios -> ndomod (nagios module) -> ndo2db (daemon) -> MySQL
Nagios communicates to ndomod via the event broker api and is configured in nagios.cfg. ndomod should be talking to ndo2db via tcp socket on the localhost port 5668. ndo2db should be listening on localhost port 5668. It does not matter where the cacti database is as long as it is accessible on the network.
Now you need to be sure to start ndo2db. I had problems with it dying so I put it under control of init and I show this in the last couple steps of the quick start guide.
[07:08:40 - bgunn@exlap600 - monitor: ~]$ ps -ef | grep ndo2db
nagios 27324 1 0 Aug04 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
Hope this helps,
Billy
I use ubuntu 8.04.But i am not mater about linux.oot@yonyim1:/usr/local/nagios/var# /usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
Could not bind socket: Address already in use
And u wrote down in quick start installation:
I dont know how to do these steps in ubuntu actually.NOTE: I had some problems with the ndo2db process dying (regularly) on Fedora Core 7. To get around that I setup the process to respawn via init. If you have trouble with the daemon dying you can add the following line to /etc/inittab
ndo:345:respawn:/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
After editing inittab issue the following command:
telinit Q
You may see messages like the following in your syslog when using init to respawn ndo2db:
Apr 19 11:11:55 acid init: Id "ndo" respawning too fast: disabled for 5 minutes
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
Do this:
If its running already then thats why the port is in use. Kill and restart ndo2db. You need to make sure the daemon starts successfully. Before restarting it enable debugging in ndo2db.cfg. Make sure to specify the logfile path.
After restarting ndo2db watch the debug log for any errors.
Code: Select all
ps -ef | grep ndo2b
After restarting ndo2db watch the debug log for any errors.
Here is my output:
And here is nagios.log:
I didnt see any item in my dashboard. I can see statusmap. But no host no service etc.
Note again: I have only one db called cacti on cacti server.
As you see debug file is empty!root@yonyim1:/home/awtadm# /usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
root@yonyim1:/home/awtadm# ps -ef |grep ndo2db
nagios 12102 1 0 16:15 ? 00:00:00 /usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
root 12176 8536 0 16:15 pts/0 00:00:00 grep ndo2db
root@yonyim1:/home/awtadm# tail -f /usr/local/nagios/var/ndo2db.debug
And here is nagios.log:
And here is my ndo2db.cfg file:root@yonyim1:/home/awtadm# tail -f /usr/local/nagios/var/nagios.log |grep ndomod
[1226412967] ndomod: Successfully reconnected to data sink! 28 items lost, 5000 queued items to flush.
[1226412967] ndomod: Error writing to data sink! Some output may get lost. 4375 queued items to flush.
And finally here is my ndomod.cfg file:ndo2db_user=nagios
ndo2db_group=nagios
socket_type=tcp
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
db_servertype=mysql
db_host=10.65.8.48 << my cacti server
db_port=3306
db_name=cacti
db_prefix=npc_
db_user=cacti
db_pass=cacti123
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
debug_level=-1
debug_verbosity=1
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000
Is there any incorrect item in these files?instance_name=default
output_type=tcpsocket
output=127.0.0.1 << my nagios server (should be cacti server?)
tcp_port=5668
output_buffer_items=5000
buffer_file=/usr/local/nagios/var/ndomod.tmp
file_rotation_interval=14400
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
data_processing_options=-1
config_output_options=2
I didnt see any item in my dashboard. I can see statusmap. But no host no service etc.
Note again: I have only one db called cacti on cacti server.
SOLVED!
Ok I found the error source.
Nagios couldn't connect to cacti DB.
Then, in /etc/mysql/my.cnf, I commented out the line
After that everything is ok now
For ubuntu this link has very good installation directives:
http://www.howtoforge.com/perfect_setup_ubuntu_6.06_p4
Ok I found the error source.
Nagios couldn't connect to cacti DB.
Then, in /etc/mysql/my.cnf, I commented out the line
Code: Select all
[...]
#bind-address = 127.0.0.1
[...]
For ubuntu this link has very good installation directives:
http://www.howtoforge.com/perfect_setup_ubuntu_6.06_p4
So, I am having difficulty understanding how to get NPC to read the database entries that ndo2db is writing. I have ndoutils setup, and I have verified that there is data getting written properly to mysql. I have cacti setup, and the plugin architecture installed with NPC as a plugin. NPC is installed, but I have an empty dashboard which would seem to indicate that NPC doesn't know where to read the database information.
Is there somewhere to configure the database, login, password, etc so that NPC knows where to look for it's data?
This project looks amazing, and I'd really like to take advantage of it. Any help is greatly appreciated.
EDIT: Nevermind. I didn't realize that the cacti database was modified with the required tables, prefixed with npc_. I was using a different database, and that was causing the problem.
Is there somewhere to configure the database, login, password, etc so that NPC knows where to look for it's data?
This project looks amazing, and I'd really like to take advantage of it. Any help is greatly appreciated.
EDIT: Nevermind. I didn't realize that the cacti database was modified with the required tables, prefixed with npc_. I was using a different database, and that was causing the problem.
-
- Posts: 2
- Joined: Tue Nov 18, 2008 5:12 am
n2c cant's see templates
I have everything installed and working (nagios, ndoutils, cacti) and I can see the hosts
in npc.
If I try to use n2c to import hosts, I can see the hostgroups but no templates are visible.
I'm assuming that the standard Cacti templates would be visible - or do I have to create my own?
in npc.
If I try to use n2c to import hosts, I can see the hostgroups but no templates are visible.
I'm assuming that the standard Cacti templates would be visible - or do I have to create my own?
Hello divagater, first thanks for the good work, the plugin is really nice work and integrates nicely with Cacti.
I haven't used it much, but I gave your plugin a try because I wanted to be able to graph all the data collected by nagios instead of using a seperate tool such as zabbix.
It seems to me that right now it's not possible to directly graph the data collected by nagios, am I right or am I missing something?
Is this a feature? or a future goal?
* Must import (graph) Nagios performance data (semi-auto)
Thanks for your time and effort!
Nick
I haven't used it much, but I gave your plugin a try because I wanted to be able to graph all the data collected by nagios instead of using a seperate tool such as zabbix.
It seems to me that right now it's not possible to directly graph the data collected by nagios, am I right or am I missing something?
Is this a feature? or a future goal?
* Must import (graph) Nagios performance data (semi-auto)
Thanks for your time and effort!
Nick
Re: n2c cant's see templates
Have you tried using Internet Explorer? I had issues with the N2C with chrome and Firefox 3, the one that worked best was IE8...tumutbound wrote:I have everything installed and working (nagios, ndoutils, cacti) and I can see the hosts
in npc.
If I try to use n2c to import hosts, I can see the hostgroups but no templates are visible.
I'm assuming that the standard Cacti templates would be visible - or do I have to create my own?
An arrow with a dropdown box should appear when you click under template next to a hostgroup...
Who is online
Users browsing this forum: No registered users and 0 guests