Page 2 of 3
Re: Nagios Core Config Manager Problem
Posted: Mon Jan 25, 2010 6:34 pm
by alubel
kinson wrote:...For now this is a deal breaker.
same situation.
1. stuff is stuck in NDO database, cant delete hosts that i added wrong (ip 192.168.1231 instead of .1.231)
2. I see postgres and mysql running, whats up with that?
3. add a link to have both 32 and 64 bits version of NSClient++

4. more templates!
Other than that its really promising and for the price, we may actually be able to justify at least if you can fix the delete hosts thing.
Re: Nagios Core Config Manager Problem
Posted: Mon Jan 25, 2010 7:16 pm
by alubel
can confirm that following the
http://library.nagios.com/library/produ ... -prep-tool did not help. only thing i know to do is stop using the wizard and do this all manually?
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 12:29 pm
by stareagle
OK I managed to get rid of the services and the host I needed to.
The process I used, (probably not strictly correct) was
in /usr/local/nagios/etc/import remove any .cfg file that has a reference to the service or host you are trying to remove.
EG my host was say server.domain
There was a file called server.domain.cfg (I removed this file)
The host was referenced in another file in the import directory with what looked like a randomly generated file name ending with .tmp.cfg When I looked in the file it was the host definition. (I removed this file also).
I then went back to NagiosXI Core Configuration and deleted the services and host from there, applied the configuration and they were gone.
Question: Are the files in the import directory temporary and should they be purged by NagiosXI at some time? (Wish I could see the code)
Thoughts?
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 1:27 pm
by MicroJay
Followed stareagle's process. Finally got rid of unwanted services/hosts.
Looks like the "Host Name".cfg actually controls the services. The temp file actually allows the Host to be deleted.
I did a test by just deleting the "Host Name".cfg and noticed I could remove the services by deleting and then applying. But the Host itself kept coming back. I had to search the .tmp.cfg files for the right Host to delete. Once that was deleted, I was able to remove the Host from the list and apply changes successfully.
So - looks like deleting/purging the .tmp.cfg files would not be a thing to do on a 'normal' basis.
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 6:55 pm
by admin
Looks like this is a bug with permissions that popped up somewhere in the release changes.
Files located in the "/usr/local/nagios/etc/import" directory should be deleted once they're imported. The permissions on these files gets set to having apache as the owner. The import script runs from cron as the nagios user and is unable to delete the files, so they stick around. Thus, whenever you use the "Apply Configuration" feature, they get re-imported into NagiosQL and re-exported into your Nagios configuration. That's why they appear to never be delete-able.
Here's a fix for this problem that involves setting the import script to be run setuid root. Run the following commands as the root user:
Code: Select all
chown root.nagios /usr/local/nagiosxi/scripts/nagiosql_importall.php
chmod u+s /usr/local/nagiosxi/scripts/nagiosql_importall.php
That will fix the problem and prevent it from occurring in the future.
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 8:36 pm
by egalstad
We just released 2009R1.1D that should resolve this problem. You can get the 1.1D release from:
http://library.nagios.com/downloads/nagiosxi
Read the upgrade instruction guide for information on installing the update and let us know how the update works.
FYI, you will probably want to delete any only config files from the import directory. If you don't, the first time you use the "Apply Configuration" function, the host/service definitions in the import files will get brought back in to the database. Here's how to do it:
Code: Select all
rm -f /usr/local/nagios/etc/import/*.cfg
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 9:13 pm
by fkroeger
Problem solved
There were some config files /usr/local/nagios/etc/import. I removed them, went back to the Core Config Manager, deleted the hostname and applied the configuration. Went back to the Nagios Host detail page & the deleted host is no longer displayed! Hooray!
Why
Now the question is why there are entries in the import folder? Some where named xxx.tmp.cfg which is where the host "host_name" was being picked up from. There were also a couple of .cfg files for hosts that I had created. If I understand this correctly, then any changes I make via Config Manager, will be overwritten by any entries in the import folder?
I can see the reason for this but perhaps you should have an option to tick when applying the Configuration, to indicate that you really do want to import any configs in the import folder?
Re: Nagios Core Config Manager Problem
Posted: Tue Jan 26, 2010 9:25 pm
by alubel
Awesome, will try updating and give it a go again! if not I'll delete those suspect tmp files.
Re: Nagios Core Config Manager Problem
Posted: Wed Jan 27, 2010 7:31 am
by nickd
Encountering the same basic problems as most here, I updated to 'D' which initially let me delete a few things and I thought I was out of the woods. But after a while, doing nothing more than using the GUI (no manual edits) I'm in a situation where I can't apply configs and junk keeps returning.
Using tools/write, It relates to file permissions. If I run the suggested "chown apache.nagios /usr/local/nagios/etc/*.cfg" then the first three writes go through OK and say no errors, but if I try and restart from here it says the daemon isn't running. If I do an 'apply' from the primary 'apply config' button, it fails and reverts to 'last good' (ie bad) config.
As others have said, this is a little disappiinting as I was looking at XI as a solution where I need monitoring but just don't have the staff/skills to learn the nitty gritty.
Re: Nagios Core Config Manager Problem
Posted: Wed Jan 27, 2010 9:50 am
by tdanielsson
I wasn't able to use my new host templates when adding new hosts. The configuration file check stopped at
Code: Select all
Error: Template 'host_template' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosts/rou.cfg', starting on line 14)
Error processing object config files!
I found help here though
jcardellio wrote:I was able to fix this issue by changing the owner of the config files to "apache". Once in a while these files will get set to nagios.nagios so you have to go back in and reset the permissions.
Hope this helps
Command:
chown apache.nagios /usr/local/nagios/etc/*.cfg
*note* You may need to change the permissions on the config files in services and hosts as well.
Seems my configuration files weren't actually updated, althogh I got no error messages when applying the configuration with only the new template. This is with version 2009R1.1c (latest VMware image).