As of December 2011, NConf has released version 1.3.0 which changes the deployment methods for configs. Take a look at my NConf 1.3.0 upgrade guide!
Have you been wondering about how to get Nagios and NConf setup on your Ubuntu server? Well, I took some notes the last time around, and here they are, for anyone that may find them useful. Here we go!
(disclaimer: don’t screw up your system.)
Prerequisites
If you didn’t check the box to configure your box as a LAMP (Linux, Apache, MySQL, PHP) server when you first setup your box, do that first with:
sudo apt-get install apache2 sudo apt-get install mysql-server mysql-client sudo apt-get install php5 libapache2-mod-php5
If you want phpMyAdmin (for web-based MySQL administration):
sudo apt-get install phpmyadmin
Installing Nagios
Install Nagios with
sudo apt-get install nagios3
It should install all the necessary dependencies. Follow the prompts to get it configured and test it out by browsing to http://<yourserver>/nagios3
If you would like to monitor Windows servers using NSClient++ (which I am doing), also install the NRPE plugin with
sudo apt-get install nagios-nrpe-plugin
I felt like I ought to backup the config files before I started messing with them, so I backed them up with
sudo cp -r /etc/nagios3 /etc/nagios3.backup
Installing NConf
NConf provides a web-based frontend for configuring Nagios. There’s no package in the Ubuntu repositories for it, but you can download it pretty easily. Version 1.2.6 was the latest as of the time of this writing, so make sure you’re getting the latest version. (Note: it looks like the link below gets cut off, so here’s a link to the NConf download page where you can grab the latest source)
wget http://sourceforge.net/projects/nconf/files/nconf/1.2.6-0/nconf-1.2.6-0.tgz/download
sudo tar xzvf nconf-1.2.6-0.tgz -C /var/www
sudo chown -R www-data:www-data /var/www/nconf
- Privileges -> Add a new User
- User name: nconf
- Host: localhost
- Password: (generate, and make a note of the generated password)
- Create database with the same name and grant all privileges
- Go
- Privileges -> reload the privileges
Then browse to http://<yourserver>/nconf and follow the prompts to finish initial configuration of NConf.
When you get to the database configuration page, enter nconf for the username and the database name, and use the generated password you should have made a note of earlier. For most everything else, accept the defaults, but change the NAGIOS_BIN variable to /usr/sbin/nagios3 to reference the right location.
Finally, remove the folders and files referenced at the end of the installation process:
sudo rm -r /var/www/nconf/INSTALL sudo rm /var/www/nconf/INSTALL.php sudo rm -r /var/www/nconf/UPDATE sudo rm /var/www/nconf/UPDATE.php
At this point, you should be able to login to NConf, although it won’t be doing anything of importance.
Configuring Nagios to use NConf
We’ll need to make some changes to one of the Nagios configuration files, so (using sudo) open up /etc/nagios3/nagios.cfg in your favorite editor and delete or comment out all the lines that begin with cfg_dir= or cfg_file= and add the following lines:
cfg_dir=/etc/nagios3/global
cfg_dir=/etc/nagios3/Default_collector
Back at the terminal, run the following command to create a folder for NConf to dump the configuration files it generates.
sudo mkdir /etc/nagios3/import
Configuring NConf to Deploy Nagios Configurations Automatically
Almost there. Using sudo, open up /var/www/nconf/ADD-ONS/deploy_local.sh and make the following changes to paths:
OUTPUT_DIR="/var/www/nconf/output/" NAGIOS_DIR="/etc/nagios3/" ... /etc/init.d/nagios3 reload
GM and Allison pointed out in the comments that they had to set the execute bit on this file:
chmod +x /var/www/nconf/ADD-ONS/deploy_local.sh
This script will deploy the generated configuration package and then reload the running instance of Nagios, but it’s easiest to use just installed in the root crontab.
sudo crontab -e
and adding the line
* * * * * /var/www/nconf/ADD-ONS/deploy_local.sh
Final Steps
After saving and closing the root crontab, log back into NConf and take a look around. You’ll see some sample definitions and some predefined services for the localhost computer. You may want to delete the check_local_mrtgtraf and check_local_procs services, as the first one doesn’t work without additional configuration and the second one is a sample definition, but you can make those changes at your leisure.
Once you’re ready, click Generate Nagios config, and if all goes well, you’ll see something like the following:
[ Initializing NConf perl-API (library version 0.2, written by A. Gargiulo) ] [ Copyright (c) 2006-2009 Sunrise Communications AG, Zurich, Switzerland ] [INFO] Starting generate_config script [INFO] Generating global config files [INFO] Generating config for Nagios-collector 'Default Nagios' [INFO] Ended generate_config script Running syntax check: Default_collector: Total Warnings: 0 Total Errors: 0 Changes updated successfully.
Now log back into Nagios and click on Service Detail. Within a minute or two, you should see the hosts and services change to reference the configuration as generated from NConf.
If that works, then huzzah!
Start making your configuration changes in NConf and enjoy not having the manipulate those Nagios conf files by hand anymore!
Troubleshooting, Tips and Caveats
Try running the deploy_local.sh script by hand (with sudo) if it doesn’t appear that Nagios is getting the configurations from NConf. You may be able to glean some information from the output of that script.
New hosts not showing up in Nagios after being created in NConf? Make sure you’ve selected Default Nagios under “monitored by” when defining the host, or that host won’t get assigned properly.
This setup process effectively disables all the command definitions provided by the package install of Nagios, which are stored under /etc/nagios-plugins/config. I looked through them and compared them to the ones provided by default with NConf, and I was fine with what NConf provided. NConf provides a mechanism to import command definitions if you really find that you need them.
I have no idea how this setup will hold up under an upgrade of the Nagios package. We’ll see when the time comes, and if I remember, I’ll update these notes.
If you have any trouble with the steps provided above, please comment and I’ll do what I can to assist.
More Information
Take a look at the following documentation from NConf:
72 replies on “Nagios and NConf on Ubuntu 10.04 Lucid Lynx”
When I generate the config file for Nagios, I see no errors and everthing looks fine. However, I never see the changes in Nagios. Any suggestions?
Sounds like NConf may not be deploying the config properly to Nagios (if at all). Did you configure the deploy_local.sh script?
I pretty much have everything working.. except for ..
when I add
cfg_dir=/usr/local/nagios/global
cfg_dir=/usr/local/nagios/Default_collector
nagios borks and won’t startup..
any ideas?
It’s possible that it might be a permissions issue. Does /var/log/nagios3/nagios.log reveal anything of value when it fails to start?
Nevermind.. sorted it.. I had left some of the other directives in that file uncommented…
thanks…
Hey Jason, thanks for the post. Can I suggest a couple of additions?
# Install mysql (I didn’t have this on a fresh Lucid box)
sudo aptitude install mysql-server
sudo aptitude install libapache2-mod-auth-mysql phpmyadmin
It seems like you also have to comment out cfg_file in addition to cfg_dir in nagios.cfg. This blocked me from a proper config loading with the deploy script.
Also, in the deploy script, might want to note that you need to be careful with slashes and the ‘3’ for nagios3.. I missed a slash in the import which caused a few issues as well.
Thanks again for the post!
Ah, I had installed the LAMP stuff when I setup the server, but good point. I’ll make a note of that.
Thanks for mentioning to comment out cfg_file, I spent the last two hours going through every file related to Nagios to get it to start/update properly. I came back here to re-read, and your comment got me up and running right away.
Not sure where I have gone wrong but on the /etc/init.d/nagios3 reload I get a failure
***> One or more problems was encountered while running the pre-flight check…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
‘Whats New’ section to find out what has changed.
* errors in config!
[fail]
ANy help would me appriaciated, PS I had to create the global and Default_collector manually
im also getting a /var/www/nconf/ADD-ONS/deploy_local.sh: Permission denied
Ive eddited this using winscp so not if ive done somthing wrong there any help would be great
Thanks
Might be a permissions issue. Is anything being generated in the /etc/nagios3/global and Default_collector folders? They should be owned by www-data:www-data with 755 perms on both folders.
Also, can you run the deploy_local.sh script by hand (using sudo)?
Fantastic I had the permission correct on the folder ADD-ONS but checking deploy_local.sh that was set to 644 changed that and another file in the same folder to 755 and it worked
Thanks for your help
Error accessing or executing Nagios / Icinga binary ‘usr/sbin/nagios3’.
Cannot run the mandatory syntax check.
This error I got at the end, after trying to add a host, hope someone can help me?
Can you run the /usr/sbin/nagios3 binary manually from the terminal?
Error accessing or executing Nagios / Icinga binary ‘etc/nagios3?.
Cannot run the mandatory syntax check.
I also got this error at the end.. Any suggestions?
Regards
Double check the path to nagios. You should be able to execute it manually by running
/usr/sbin/nagios3
from the terminal.If you need to edit the path, you can change it in the configs at
/var/www/nconf/config/nconf.php
Awesome thanks!!
I’ve run thru twice, reverting back to a VM snapshot between times and I get the same error:
Nagios Core 3.2.0
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2009
License: GPL
Website: http://www.nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/var/www/nconf/temp/global/host_templates.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/timeperiods.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/contacts.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/service_templates.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/misccommands.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/contactgroups.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/checkcommands.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/hosts.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/hostgroups.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/extended_host_info.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/services.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/servicegroups.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/extended_service_info.cfg’…
Error: Service description, host name, or check command is NULL
Error: Could not register service (config file ‘/var/www/nconf/temp/Default_collector/services.cfg’, starting on line 58)
Error processing object config files!
***> The name of the main configuration file looks suspicious…
Make sure you are specifying the name of the MAIN configuration file on
the command line and not the name of another configuration file. The
main configuration file is typically ‘/usr/local/nagios/etc/nagios.cfg’
***> One or more problems was encountered while processing the config files…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
‘Whats New’ section to find out what has changed.
Where is it getting services.cfg from and why is puking on line 58??
Looks like you’re deploying your configs to /var/www/nconf/temp/ rather than /etc/nagios3/ so it’s possible it could be a permissions issue.
Also, check through your services definitions from within NConf. It’s possible you’ve got a faulty service being generated from NConf, so Nagios throws it back.
Figured it out earlier today, deleting the check_local_procs and check_mgttraf broke it. Skipped that step and it worked fine.
mark please how did you fix the problem? i have the same
[…] Using (and embellishing upon) instructions for Installing Nagios and Nconf on Ubuntu 10.04 https://digitalcardboard.com/blog/2010/08/24/nagios-and-nconf-on-ubuntu-10-04-lucid-lynx/ […]
I have succesfully deploy nconf and nagios3. But nconf still can not automatically extract output to /etc/nagios3. I already give access to user www-data to /etc/nagios3. But nconf still cannot write the output. So i manually extract file NagiosConfig.tgz into dir /etc/nagios3, restarting nagios and all item now appear in map
Did you create the import folder in /etc/nagios3/ ?
I got the nagios3 and nconf to work but when i try to do a deploy files dont get deploy automatically, it doesn’t extract the files in import
I tried to manually extract the files but i get this error.
Processing object config file ‘/etc/nagios3/global/checkcommands.cfg’…
Processing object config file ‘/etc/nagios3/global/timeperiods.cfg’…
Processing object config file ‘/etc/nagios3/global/host_templates.cfg’…
Processing object config file ‘/etc/nagios3/global/commands.cfg’…
Warning: Duplicate definition found for command ‘process-host-perfdata’ (config file ‘/etc/nagios3/global/commands.cfg’, starting on line 16)
Error: Could not add object property in file ‘/etc/nagios3/global/commands.cfg’ on line 17.
Error processing object config files!
***> One or more problems was encountered while processing the config files…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
‘Whats New’ section to find out what has changed.
* errors in config!
This was the content of the File “global/commands.cfg”
cat global/commands.cfg
#define command {
# command_name notify-host-by-email
# command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
#}
#define command {
# command_name notify-service-by-email
# command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$” | /bin/mail -s “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
#}
define command {
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}
define command {
command_name process-host-perfdata
command_line /usr/bin/printf “%b” “$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n” >> /var/nagios/host-perfdata.out
}
define command {
command_name process-service-perfdata
command_line /usr/bin/printf “%b” “$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n” >> /var/nagios/service-perfdata.out
}
define command {
command_name service_is_stale
command_line /usr/lib/nagios/plugins/eventhandlers/stale_service.sh
}
Can anyone tell me what i am doing wrong.. here ..
If you’re getting duplicate definition errors, make sure you’ve commented out or removed all the
cfg_dir=
lines in the nagios.cfg file. It seems like Nagios is still trying to reference one of the standard config files.Hey This is fixed there were Duplicate entries in 2 different files..
I’m running ubuntu server natty, nagios3 , nconf.
Just thought I would add what I had to do to for my install to work.
More than likely its because I had not read the above properly but i’ll post anyway!
cfg_dir=/etc/nagios3/global
cfg_dir=/etc/nagios3/Default_collector
I had to create these folders.
I also had to chmod +x /var/www/nconf/ADD-ONS/deploy_local.sh
Then I ran var/www/nconf/ADD-ONS/deploy_local.sh by using sudo ./deploy_local.sh from the directory
Then I ran sudo /etc/init.d/nagios3 restart
Thanks to this guide it pointed me in the right direction and I thank you!
do you know if there is a way to incorporate this into NConf “Generate Nagios config” action
edit: The method in the above post is how I have to do it, however I do not know why and wish there was a fix I could use
Take a look at the section Configuring NConf to Deploy Nagios Configurations Automatically. Once NConf generates the deploy file, the cron job should pick it up and put it in the right place, if it all works.
Se alguem tiver com esse erro:
Error accessing or executing Nagios / Icinga binary ‘/var/www/html/nconf/bin/nagios’. Cannot run the mandatory syntax check.
No meu caso o NConf não estava encontrando os binarios do nagios.
rode o comando:
cp /usr/local/nagios/bin/* /var/www/html/nconf/bin/nagios
flow
When I add any host in Nconf, m not able to view it in Nagios frontend.
Can you verify that Nconf is generating a config file and that Nagios is picking it up?
Thank you a lot!! It works! ) But i had to correct configs slightly ^)
Followed your guide exactly but what I add via NConf is not being updated to Nagios. I checked the directories and everything, files are being generated. Perhaps I missed something with removing the cfg lines in nagios.cfg?
Disregard the previous comment, I commented out the logfile in nagios.cfg…
Gogo retard move!
Glad that it’s working for you!
Thanks for a nice tutorial, however i believe a few steps are missing..I followed all the steps by nagios didnt started at the end with error
——
***> One or more problems was encountered while running the pre-flight check…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
‘Whats New’ section to find out what has changed.
errors in config! … failed!
failed!
——————
Then I figured that “generate nagios config” need to run from nconf, which generate a .tgz file in output directory which give a gloabl and default_collector folder when we extract it, and those 2 need to be copied in /etc/nagios3
I did and everything went well…
I thought to mention my experience and my findings..
Thanks for a nice tutorial again, all credit goes to you my friend 🙂
[…] been over a year since I originally installed and configured Nagios and NConf 1.2.6 on my Lucid Lynx server. In the meantime, I’ve upgraded the hardware and moved to Ubuntu 11.10 Oneiric Ocelot, mostly […]
Hi,
I’m finding that the plugins in /usr/lib/nagios/plugins conflict with a heap of the commands in misccommands.cfg and checkcommands.cfg.
Has anyone else had this, or know how to fix it?
Essentially, I just had to nuke all the existing command definitions provided by the Ubuntu package and just go with what NConf generates. Sounds like you might still be calling out the old configs.
This guide was the only one that I got working for my VPS.
1000 internet points to you!!
I can now monitor my sites and configure Nagios much easier, well done and thank you!
I just wanted to add that I, too, had some issues getting NConf to work. I started with a working Nagios installation (with hosts, services, and commands defined, including several commands for NRPE_NT), but when I tried to throw NConf into the mix, I couldn’t get the NConf generated hosts to show up on the Nagios frontend. I found that performing the following command solved the issue:
# chmod +x /var/www/nconf/ADD-ONS/deploy_local.sh
# sudo /var/www/nconf/ADD-ONS/deploy_local.sh
This probably should have been obvious, but it might be a good idea to add it to the main post.
Thanks for this guide, it was very helpful!
Thanks for the info Allison; I’ve added it to the guide! The NConf folks have up and released 1.3.0, so if you feel like adding that to the mix, I’ve got another guide documenting my upgrade process. The whole deploy_local.sh thing has been replaced in the latest version.
[…] GM and Allison pointed out in the comments that they had to set the execute bit on this file: […]
Thanks but i don’t understand how i monitor remote linux host. Which daemon i use and where i add my add-on in nagios server. When i install nconf then can i configure nagios from cmd
The easiest (an for me, the only known) way, is to install the nagios-plugin with NRPE-AddOn and run NRPE as a deamon on your remote system. Usually you should find both in the repos of your prefered distribution.
First of all: Thank you very much for this guide!
Second and just for the record – I’ve got some trouble with the config-files unter “global” and “default_collector”. After running the deploy_local.sh these folders weren’t created nor filled with the files after I created them manually. Finally I unpacked the files from /var/www/nconf/output/NagiosConfig.tgz.
Changes at the paths in the “deployment.ini” doesn’t seem to make any difference.
You might consider upgrading to NConf 1.3.0, which has a different deployment procedure.
Hi Jason,
thanks for the quick reply. I’ve used the latest NConf-package from nconf.org. At the moment I’m playing around with the deployment.ini-file. It seems that the generated config-files are not copied/extracted to the /tmp/-folder but I can’t locate the exact problem. I’ll change the paths to another folder and check the functionality of the script again.
My notes on the upgrade to NConf 1.3.0 are here, if it helps you any.
Thank you again. I already found some sources of my problems (like the ‘;’ for uncommented lines). Now I deal with the following messages from NConf:
local
expand extract config OK
PHP mkdir: OK
Create target directory (/var/www/nconf/temp/deploy)
PHP copy: OK
temporary copy(/var/www/nconf/output/NagiosConfig.tgz, /var/www/nconf/temp/deploy/NagiosConfig.tgz)
system call OK
gunzip -f /var/www/nconf/temp/deploy/NagiosConfig.tgz
system call OK
tar -xf /var/www/nconf/temp/deploy/NagiosConfig.tar -C /var/www/nconf/temp/deploy/
PHP unlink: OK
remove temporary file(/var/www/nconf/temp/deploy/NagiosConfig.tar)
expand copy collector config FAILED
PHP copy: FAILED
recursive copy(/var/www/nconf/temp/deploy/Default_collector/, /etc/nagios3/Default_collector/)
expand copy global config FAILED
PHP copy: FAILED
recursive copy(/var/www/nconf/temp/deploy/global/, /etc/nagios3/global/)
Seems to be a rights-management problem.
As update: After I allowed ‘write’ by ‘others’ via chmod there are no more problems. I’ll now search if this solution provides any security vulnerabilities. If not, my problem is fixed…
Glad to hear you were able to figure it out! The permission issue is why I ended up putting the .tgz file and the other deploy stuff in /tmp.
Hi, I may be being incredibly dumb here but I’ve had Nagios 3.2.3 and NConf 1.3.0 running fine for about a month until this week when I noticed that none of my changes to anything on nconf were being pushed through to nagios. It doesn’t give me any errors when I create a new host, generate a config or at any other stage in the process. deploy_local.sh seems to running fine and seems to create all the necessary files, I just can’t see where it’s going wrong. Can anyone help?
Ok, so actually I’ve found what the problem is, I’m just not sure how to fix it. It seems that nconf is generating hosts and advanced services into a “collector” folder instead of “Default_collector”. Does anyone know where I can change this? I’m guessing I’ve somehow changed it by accident but I can’t for the life of me think where I would have changed it?
Many thanks in advance
NConf 1.3.0 has a different deployment routine (so no more deploy_local.sh). I’ve only upgraded from v1.2.6, so it’s entirely possible that the default configuration for a new install uses collector instead of Default_collector. You might start by looking through my notes on upgrading to NConf 1.3.0 and see if that helps.
Hi, nice guide.
I have followed every step of this guide, but now i am stop at this point:
Generate config log:
[INFO] Starting generate_config script
[INFO] Generating global config files
[INFO] Generating config for Nagios-collector ‘Default Nagios’
[INFO] Ended generate_config script
Running syntax check:
Default_collectorError generating config
Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL
Website: http://www.nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/var/www/nconf/temp/global/timeperiods.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/contacts.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/misccommands.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/checkcommands.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/host_templates.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/service_templates.cfg’…
Processing object config file ‘/var/www/nconf/temp/global/contactgroups.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/service_dependencies.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/host_dependencies.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/advanced_services.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/services.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/servicegroups.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/hosts.cfg’…
Processing object config file ‘/var/www/nconf/temp/Default_collector/hostgroups.cfg’…
Processing object config directory ‘/var/www/nconf/static_cfg’…
Processing object config directory ‘/usr/local/nagios/etc’…
Processing object config file ‘/usr/local/nagios/etc/cgi.cfg’…
Error: Unexpected token or statement in file ‘/usr/local/nagios/etc/cgi.cfg’ on line 15.
Error processing object config files!
What have i change to work NConf
ty in advance for a response
So a couple of things: (1) I’m running Nagios 3.2.3 out of the 11.04 repos, so I can’t really speak to anything at the 3.4.x level. But (2) you might take a look inside your /usr/local/nagios/etc/cgi.cfg file to see if it’s intact, and if that erroring line is correct. In my cgi.cfg, line 13 is the main_config_file parameter.
hello,
i have a duplicate configs on all my hosts, let me explain:
in the column “Status Information” of nagios, all my hosts import the same configuration of my Nagios server:
Status Information
DISK OK – free space: / 31590 MB (92% inode = 94%):
OK – load average: 0.25, 0.37, 0.42
PROCS OK: 0 processes with STATE = X, Z
PING OK – Packets Lost = 0%, RTA = 0.40 ms
thank you for helping me if you have an answer.
It sounds like it may be more a Nagios configuration issue than an NConf one, but unfortunately I don’t have a good answer for you. Make sure you’re running the stable you have access too. The Nagios Support Forum might be able to offer some better advice.
ok, i hope to find an answer in the forum.
thank you.
Hey,
This is a great tutorial for installing nagios and nconf. It is the only one that made any sense to me (and wasn’t filled with mis-types).
So here is my problem, everything goes well with “generate nagios config. But when i click “deploy” I get this:
local
expand extract config OK
expand copy collector config OK
PHP copy: OK
recursive copy(/tmp/Default_collector/, /etc/nagios3/Default_collector/)
expand copy global config FAILED
PHP copy: OK
recursive copy(/tmp/global/, /etc/nagios3/global/)
system call FAILED
sudo /etc/init.d/nagios3 reload
* Reloading nagios3 monitoring daemon configuration files nagios3
Nagios Core 3.2.0
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2009
License: GPL
Website: http://www.nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/etc/nagios3/Default_collector’…
Error: Cannot open config file ‘/etc/nagios3/Default_collector’ for reading: No such device
Error processing object config files!
***> One or more problems was encountered while processing the config files…
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
‘Whats New’ section to find out what has changed.
* errors in config!
…fail!
The files are being copied to Default_collector, but the reload command is not being executed. Any ideas??
Thanks,
Emmett
Deploying is different in NConf 1.3.0. Take a look through my 1.3.0 upgrade guide and see if that gives you any more guidance.
Probably check permissions on your /etc/nagios3 directory
specifically, web server (nconf) user (www-data) needs to write to /etc/nagios3/conf.d to drop config files there
drwsrwsr-x 4 root www-data 43 2013-01-16 09:06 conf.d
[…] you wanted to get fancy you can follow the instructions found on the digitalcardboard blog under the ‘Configuring NConf to Deploy Nagios Configurations Automatically’ […]
After generate config (1274 hosts, 15184 Services), and checking nagios configuration (Things look okay – No serious problems were detected during the pre-flight check), I reload (or restart) nagios…. but appear it following message:
nagios nagios: Warning: Attempting to execute the command “sendMail” resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists…
You can help me?
This sounds like a sendmail issue. Make sure you’ve got a mailer (exim, postfix, ssmtp) setup on your box…
[…] https://digitalcardboard.com/blog/2010/08/24/nagios-and-nconf-on-ubuntu-10-04-lucid-lynx/ […]
[…] From http://digitalcardboard.com/blog/2010/08/24/nagios-and-nconf-on-ubuntu-10-04-lucid-lynx/ […]