View Full Version : nagios works, centreon not
jonaskellens
09-22-2008, 01:02 PM
I've added al my hosts and services by editting the .cfg-files in /usr/local/nagios/etc
Normally I should be able to add hosts and services via the centreon-webinterface, but when I add a host there nothing happens.
It's like centreon and nagios are not communicating with each other.
I've installed centreon via the setup-guide and everything has been installed fine. Only problem : I am unable to use centreon for monitoring !
Any one has an idea of what could be wrong ??
Any suggestion or remark will do !
Ronan_
09-22-2008, 01:10 PM
You say you added your hosts and services on centreon-web, and nothing happened?
Did you go to "Configuration > Nagios" and checked generate and move and restarted nagios ?
jonaskellens
09-22-2008, 01:33 PM
You say you added your hosts and services on centreon-web, and nothing happened?
Did you go to "Configuration > Nagios" and checked generate and move and restarted nagios ?
When I add my linux-server (junon) by editting the nagios .cfg-files, everything works.
This 1 host that I monitor, I've configured in junon.cfg.
In nagios.cfg I added a line that nagios also has to look at junon.cfg.
Now I put that line in comment (so junon.cfg is no longer used by nagios)
I add the host junon via the centreon-webinterface with the same options (only here I have the nice graphical interface to add the options and the template)
I restart nagios (via the centreon-webinterface like U say above, or via the command-line) and when I then go to 'home' or 'monitoring' in Centreon he tells me that there are 0 hosts.
Ronan_
09-22-2008, 02:35 PM
Does centreon generate the config files correctly?
You shouldn't need to touch your config files once you got centreon setup properly.
jonaskellens
09-22-2008, 02:53 PM
Does centreon generate the config files correctly?
You shouldn't need to touch your config files once you got centreon setup properly.
And which config-files would that be ? Where does centreon places these config-files ?
Ronan_
09-22-2008, 02:59 PM
It first generates the config files in /usr/local/centreon/filesGeneration/nagiosCFG/, and then they are moved to the nagios config directory (default is /usr/local/nagios/etc/).
BTW, check that the apache user (or www-data, depends on your distro), can overwrite files in the nagios conf dir.
jonaskellens
09-22-2008, 03:14 PM
It first generates the config files in /usr/local/centreon/filesGeneration/nagiosCFG/, and then they are moved to the nagios config directory (default is /usr/local/nagios/etc/).
BTW, check that the apache user (or www-data, depends on your distro), can overwrite files in the nagios conf dir.
My Nagios reads the config-files in /usr/local/nagios/etc/objects
There is no line in nagios.cfg that says to look in /usr/local/nagios/etc/, neither did centreon on installation adjusted the file to go and look there.
I've made no user 'apache', just a user 'nagios' as was mentionned in the fedora install-guide.
With ls -al I see that 'apache' is owner of all the files in my /usr/local/nagios/etc-directory.
-rwxrwxr-x 1 apache apache 10458 2008-09-15 13:56 cgi.cfg
-rwxrwxr-x 1 apache apache 125 2008-09-19 14:21 command.cfg
-rwxrwxr-x 1 apache apache 26 2008-09-19 10:22 htpasswd.users
-rwxrwxr-x 1 apache apache 42595 2008-09-22 12:20 nagios.cfg
-rwxrwxr-x 1 apache apache 3856 2008-09-22 10:13 ndo2db.cfg
drwxrwxr-x 2 nagios nagios 4096 2008-09-22 09:50 objects
-rwxrwxr-x 1 apache apache 1340 2008-09-15 13:56 resource.cfg
/objects :
-rwxrwxr-x 1 apache apache 7714 2008-09-15 13:56 commands.cfg
-rwxrwxr-x 1 apache apache 2166 2008-09-15 13:56 contacts.cfg
-rwxr-xr-x 1 apache apache 5070 2008-09-22 09:50 junon.cfg
-rwxr-xr-x 1 root root 5402 2008-09-19 15:46 localhost.cfg
-rwxrwxr-x 1 apache apache 3124 2008-09-15 13:56 printer.cfg
-rwxrwxr-x 1 apache apache 3293 2008-09-15 13:56 switch.cfg
-rwxrwxr-x 1 apache apache 10812 2008-09-15 13:56 templates.cfg
-rwxrwxr-x 1 apache apache 3209 2008-09-15 13:56 timeperiods.cfg
-rwxrwxr-x 1 apache apache 4007 2008-09-15 13:56 windows.cfg
When you add a host, which file then does centreon changes ? Where does it put the host-definition ?
Ronan_
09-22-2008, 03:29 PM
When centreon manages the configuration, the /usr/local/nagios/etc directory looks like that :
-rwxrwxr-x 1 apache apache 1851 sep 22 09:17 cgi.cfg
-rwxrwxr-x 1 apache apache 8317 sep 22 09:17 checkcommands.cfg
-rwxrwxr-x 1 apache apache 1956 sep 22 09:17 contactgroups.cfg
-rwxrwxr-x 1 apache apache 4713 sep 22 09:17 contacts.cfg
-rwxrwxr-x 1 apache apache 12625 sep 22 09:17 dependencies.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 escalations.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 hostextinfo.cfg
-rwxrwxr-x 1 apache apache 8961 sep 22 09:17 hostgroups.cfg
-rwxrwxr-x 1 apache apache 24998 sep 22 09:17 hosts.cfg
-rwxrwxr-x 1 apache apache 1561 sep 22 09:17 meta_commands.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_contact.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_contactgroup.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_dependencies.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_escalations.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_host.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_hostgroup.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 meta_services.cfg
-rwxrwxr-x 1 apache apache 1341 sep 22 09:17 meta_timeperiod.cfg
-rwxrwxr-x 1 apache apache 4243 sep 22 09:17 misccommands.cfg
-rwxrwxr-x 1 apache apache 4171 sep 22 09:17 nagios.cfg
-rwxrwxr-x 1 apache apache 1434 sep 22 09:17 ndo2db.cfg
-rwxrwxr-x 1 apache apache 1347 sep 22 09:17 ndomod.cfg
-rwxrwxr-x 1 apache apache 5359 sep 9 10:34 nsca.cfg
-rwxrwxr-x 1 apache apache 1139 sep 22 09:17 resource.cfg
-rwxrwxr-x 1 apache apache 1089 sep 22 09:17 serviceextinfo.cfg
-rwxrwxr-x 1 apache apache 4625 sep 22 09:17 servicegroups.cfg
-rwxrwxr-x 1 apache apache 59544 sep 22 09:17 services.cfg
-rwxrwxr-x 1 apache apache 1924 sep 22 09:17 timeperiods.cfg
I do not have an objects/ directory, and it looks like your configuration has not been generated. Centreon should tell you what's happenning when it generates the config files (on the bottom of the "Configuration > Nagios" page, once you've told it to restart), could you show us what it says?
jonaskellens
09-23-2008, 08:57 AM
Indeed seems that you have a totally different config.
What I did was follow the guide : I first installed nagios to up a certain point, then the prerequisites and then centreon (who told me that he found every necessary file and directory at setup).
When configuration > nagios > all nagios servers + generate configuration files + run nagios debug + restart nagios :
I get no output at all !
What do I do : reïnstall nagios + centreon ? Have you also followed the guide http://en.doc.centreon.com/Setup:Centreon2LinuxDistributionUseRPM ??
Ronan_
09-23-2008, 10:16 AM
I followed the exact same guide, and I'm quite surprised you get no output at all !
Maybe you should check your nagios.cfg (in centreon, same page as to generate the config, in the left menu), but I don't really know where this problem can come from...
jonaskellens
09-23-2008, 10:30 AM
I followed the exact same guide, and I'm quite surprised you get no output at all !
Maybe you should check your nagios.cfg (in centreon, same page as to generate the config, in the left menu), but I don't really know where this problem can come from...
Well, I have a Nagios CFG 1-file. I guess centreon has made it's own config... As it supposed to do.
Can you tell me ? What's the goal of centreon ? Does it not only simplify the host/service-creation but also the installation of nagios ?
Or do you still need to manually setup nagios and afterwards put centreon on top of it ?
Have you installed nagios first, before installing centreon ? Have you configured anything to nagios before installing centreon ?
jonaskellens
09-23-2008, 01:48 PM
I see now that all the files you posted earlier are in a different directory. I did not put them there. All the files that should be in /usr/local/nagios/etc are in /usr/local/centreon
Ronan_
09-23-2008, 02:36 PM
Or do you still need to manually setup nagios and afterwards put centreon on top of it ?
You could completely erase the config files and Centreon would recreate all of them.
Have you installed nagios first, before installing centreon ? Have you configured anything to nagios before installing centreon ?
I installed nagios first, and the only things I had to configure were done by the centreon install script... (apart from a few NDO params)
You should check the config files in /etc/centreon, maybe there's a bad path in there.
jonaskellens
09-23-2008, 03:17 PM
I've just installed nagios and centreon from square. The first thing that I do after loggin' in in centreon webinterface is go to configuration > nagios > generate configuration files + restart nagios > export
Result I get :
PollerPrincipal
Status
nothing.
/usr/local/nagios :
drwxrwxr-x 2 nagios nagios 4096 2008-09-23 13:09 bin
drwxrwxr-x 3 nagios apache 4096 2008-09-23 14:03 etc
drwxrwxr-x 2 nagios nagios 4096 2008-09-23 13:19 libexec
drwxrwxr-x 2 nagios nagios 4096 2008-09-23 13:02 sbin
drwxrwxr-x 9 nagios nagios 4096 2008-09-23 13:05 share
drwxrwxr-x 5 nagios nagios 4096 2008-09-23 14:11 var
/usr/local/nagios/etc :
-rwxrwxr-x 1 apache apache 10458 2008-09-23 13:03 cgi.cfg
-rwxrwxr-x 1 apache apache 42546 2008-09-23 13:03 nagios.cfg
-rwxrwxr-x 1 apache apache 3859 2008-09-23 14:03 ndo2db.cfg
drwxrwxr-x 2 nagios nagios 4096 2008-09-23 13:03 objects
-rwxrwxr-x 1 apache apache 1340 2008-09-23 13:03 resource.cfg
/usr/local/centreon :
drwxr-xr-x 2 root root 4096 2008-09-23 13:19 bin
drwxr-xr-x 4 nagios apache 4096 2008-09-23 13:18 cron
drwxr-xr-x 4 root apache 4096 2008-09-23 13:17 doc
drwxr-xr-x 2 root root 4096 2008-09-23 13:19 examples
drwxr-xr-x 3 root root 4096 2008-09-23 13:18 filesGeneration
drwxr-xr-x 3 root root 4096 2008-09-23 13:18 filesUpload
drwxr-xr-x 7 apache apache 4096 2008-09-23 13:18 GPL_LIB
drwxr-xr-x 2 root nagios 4096 2008-09-23 13:18 lib
drwxrwxr-x 2 apache nagios 4096 2008-09-23 13:20 log
drwxr-xr-x 11 apache apache 4096 2008-09-23 13:51 www
EDIT : I've marked everything that there is to mark en again I let centreon generate the configuration.. and now I got : Centreon : All configuration files copied with success.
jonaskellens
09-23-2008, 03:37 PM
So every time I add a host I need to go to configuration > nagios > restart ??
Ronan_
09-23-2008, 03:39 PM
Well, you don't need to do this for each host, only for a batch of hosts/services.
jonaskellens
09-23-2008, 03:48 PM
Well, you don't need to do this for each host, only for a batch of hosts/services.
I've added 1 host via configuration > hosts > add en when I look at my hosts.cfg-file in /usr/local/nagios/etc I do not see this newly added host.
Also the main-page of centreon says 0 hosts...
So how do I load this new host into centreon/nagios ??
Ronan_
09-23-2008, 03:53 PM
Well, what I meant was you could work by adding a few hosts/services and then reloading, but they obviously won't create themselves without us telling centreon to alter the config files and reload nagios.
jonaskellens
09-23-2008, 04:07 PM
Well, what I meant was you could work by adding a few hosts/services and then reloading, but they obviously won't create themselves without us telling centreon to alter the config files and reload nagios.
So I reload...
In the hosts.cfg my newly created host is added. 1 point for centreon.
However, there is still no monitoring. Home still shows 0 hosts (0 up).
Monitoring > hosts shows none
Reporting > host:junon gives 100% but always gives 100% even when the host is put of the network.
Ronan_
09-24-2008, 10:26 AM
Is nagios running? What about NDO?
jonaskellens
09-25-2008, 08:47 AM
Is nagios running? What about NDO?
httpd is running
mysqld is running
nagios is running
ndo2db is running
I have also installed the nrpe-Plugin on my monitoring server and on the server that needs to be monitored (followed the nagios guide for this). Both nrpe-versions are the same.
On the home page of centreon > hosts I get : 0 up, 2 disabled
Ronan_
09-25-2008, 10:15 AM
Well there must be a problem about either ndomod (did you set the event broker module correctly?), or centreon not being able to get the information from the database (config error?)
jonaskellens
09-25-2008, 12:27 PM
Well there must be a problem about either ndomod (did you set the event broker module correctly?), or centreon not being able to get the information from the database (config error?)
Problem was indeed with my ndomod. Reconfigured that part once agin and now it seems that my 2 hosts are up. The ping-statement says everything is ok, host is reachable.
But the services are not monitored, although I have installed nrpe on the server that needs to be monitored and in the file nrpe.cfg the services that need to be monitored are defined.
Also when I add a cisco router to be monitored, the router is added to the hosts.cfg- file but it does no seem to be recognized by centreon. Again on the home page, the routers are not mentionned.
Also the tab monitoring doesn't show me my routers. It does show my hosts though !
Thank you for all your help !
Can you just help me a little bit further with the routers ?
EDIT : routers are showing after service ndo2db restart !
Ronan_
09-25-2008, 12:46 PM
It may take a few seconds/minutes before new hosts show up in Centreon : they haven't been checked yet and thus are'nt in the ndo database.
To document yourself on NRPE, look in the doc/ folder of your NRPE package, there's a great PDF with everything explained ;)
jonaskellens
09-25-2008, 01:58 PM
It may take a few seconds/minutes before new hosts show up in Centreon : they haven't been checked yet and thus are'nt in the ndo database.
To document yourself on NRPE, look in the doc/ folder of your NRPE package, there's a great PDF with everything explained ;)
On NRPE I found enough documentation, thank you.
Thank you for your help.
xoroz
09-30-2008, 12:10 PM
Hi there I have the same problem, centreon monitoring information is different then nagios.
Its really really strange, because in centreon Config menu i see the two hosts witch are also in nagios web interface. These hosts are also in the database CENTREON table hosts
I have followed the following troubleshoots:
1. checked permission problem related to status.log
2. checked Oreon > Monitor > Event-logs for any errors (some about "Still unable to connect to data sink")
any ideas why would the monitor not have same information as of configuration?
Should I just restart centreon?
thanks
xoroz
09-30-2008, 12:42 PM
I found the host that is under Centreon Monitoring under nagios DB table nagios_hosts
what happens? Centreon configures into a DB and reads data from another DB?
I guess there is a DB confusion here..
please help
xoroz
10-01-2008, 11:58 AM
Ok I found the problem...
After strugling for few hours, almost going crazy!
I had an error with ndomod.cfg, I noticed in my logs errors like:
"unable to connect to data sink error"
THE TROUBLESHOOTING STEPS:
1. Check ndomod.cfg, verify the mysql credentials are valid and if user has permissions.
2. Check if the ndo.sock file exists and what PID it has by doing fuser ndo.sock
3. If the ndo.sock has no PID then you probably have ndomod.cfg socket type TCP (WRONG) changed it to UNIX and problem solved!
4. Could also be a permission problem on the ndo.sock file.
startup ndo2db:
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
stop ndo2db:
pkill ndo2db-3x
both of this should be integrated into /etc/init.d/nagios script to automatic stop/start
cheers