Hello,
We had a glitch earlier with our Nagios XI install which seemed to have messed something up. When I go to apply the configuration now, I get an error that a template doesn't exist. Looking at the raw configuration files in /usr/local/nagios/hosttemplate.cfg, it does exist. I downloaded the snapshot with the error, and sure enough, the hosttemplates.cfg in the gz is blank (only the NagiosQL header and footer, no content). Looking at the NagiosQL log file, in the XI interface, I see a lot of these:
Configuration write failed - Dataset not found
Where do I go from here?
Thanks,
Dave
Configuration write failed - Dataset not found - Please help
Re: Configuration write failed - Dataset not found - Please help
Firstly the "raw configuration files" will, as you may have guessed, never show a broken configuration. When the config fails a working configuration is put back into place.
Can't you just create the template using NagiosQL? Perhaps delete the template and re/make it? Make a new template(with a different name, optionally) and stop using the old one?
We were just talking about this today, in the future(hopefully as soon as tomorrow) we will defiantly be handling these cases differently. However for right now my best option is to say we use NagiosQL and if there is a problem with that then I'm done helping you... This is a problem with NagiosQL.
Regretfully I can suggest you try to get assistance from the NagiosQL community.
Can't you just create the template using NagiosQL? Perhaps delete the template and re/make it? Make a new template(with a different name, optionally) and stop using the old one?
We were just talking about this today, in the future(hopefully as soon as tomorrow) we will defiantly be handling these cases differently. However for right now my best option is to say we use NagiosQL and if there is a problem with that then I'm done helping you... This is a problem with NagiosQL.
Regretfully I can suggest you try to get assistance from the NagiosQL community.
Re: Configuration write failed - Dataset not found - Please help
Someone had locked down the Apache config to only use SSL (no port 80 open on the box) which appeared to have caused some things to fail. So the answer at this point is "go pound sand"?
Re: Configuration write failed - Dataset not found - Please help
Ok, so if I use the "Write config files" link in the menu of the config manager, and have it write the monitoring data, then the additional data, and then run the check it comes back fine. But if I try to apply the configuration, i get errors. Any advice?
Re: Configuration write failed - Dataset not found - Please help
Our applications connect to 127.0.0.1:80 and expect to find the web-server there. Make sure this is working.
Re: Configuration write failed - Dataset not found - Please help
Checked with curl from the local host and I can connect now.
So if I have the config written out by hand, and then check the config, it comes back ok. Manually running a nagios -v returns the same, but I suspect I am checking the wrong files.
I guess the question is what does the "Apply Configuration" button do, that is, it should be exporting the info from the database (like the "Write Config files" command?), then check the config, and then restart nagios. But in this case, it is complaining about the configuration of a host which is not currently configured in the database, so it would seem that it isn't pulling the info from the database correctly, but I don't know how to verify that.
Any ideas?
Thanks,
Dave
So if I have the config written out by hand, and then check the config, it comes back ok. Manually running a nagios -v returns the same, but I suspect I am checking the wrong files.
I guess the question is what does the "Apply Configuration" button do, that is, it should be exporting the info from the database (like the "Write Config files" command?), then check the config, and then restart nagios. But in this case, it is complaining about the configuration of a host which is not currently configured in the database, so it would seem that it isn't pulling the info from the database correctly, but I don't know how to verify that.
Any ideas?
Thanks,
Dave
Re: Configuration write failed - Dataset not found - Please help
Try fixing the permissions as indicated elsewhere on these forums. I'm also thinking there could be a file laying around from a previous config.
You are hand editing the configuration files
I guess it's your funeral if this is a result of your tinkering. One thing that may be of help is the static folder, it's a place for you to put your own Nagios config files that are not managed. This might help you to get the check done by "Apply Configuration" and the system to load, even if it's not configured the way you'd want.
It does those steps you outlined. As you might understand there is a failure handler that replaces the broken config with the last known good config and then returns an error.
You are hand editing the configuration files
I guess it's your funeral if this is a result of your tinkering. One thing that may be of help is the static folder, it's a place for you to put your own Nagios config files that are not managed. This might help you to get the check done by "Apply Configuration" and the system to load, even if it's not configured the way you'd want.
It does those steps you outlined. As you might understand there is a failure handler that replaces the broken config with the last known good config and then returns an error.
Re: Configuration write failed - Dataset not found - Please help
Nope, we are not hand editing the files, the configuration has all been done via the interface, which is part of why I am confused. What is the difference between what is done by the "Apply Configuration" vs using the "Write Config Files" option? I am trying to find point at which the Apply Configuration is breaking and how to resolve that.
I'll take a look at the "fixing permissions" posts.
As for tinkering, the only thing which was done was configuring an SSL for the Apache server, and then turning off port 80 in the Apache config, which as you stated, broke things. As such, it was turned back on, and most things seem to be working again. The problem is, I have updated the configuration using the database, and now can't get XI to export the config and take it up.
"I'm also thinking there could be a file laying around from a previous config"
Ok, where do you need me to look?
Thanks,
Dave
I'll take a look at the "fixing permissions" posts.
As for tinkering, the only thing which was done was configuring an SSL for the Apache server, and then turning off port 80 in the Apache config, which as you stated, broke things. As such, it was turned back on, and most things seem to be working again. The problem is, I have updated the configuration using the database, and now can't get XI to export the config and take it up.
"I'm also thinking there could be a file laying around from a previous config"
Ok, where do you need me to look?
Thanks,
Dave
Re: Configuration write failed - Dataset not found - Please help
If it helps, here are the errors from the Config Manager Logs (working backwards):
First (before failure) Second (there are a lot of these) Third (right after the "Apply Configuration" is clicked) Check the permissions of /usr/local/nagios/etc it appears that everything is either owned by nagios.nagios or apache.nagios.
Thanks,
Dave
First (before failure) Second (there are a lot of these) Third (right after the "Apply Configuration" is clicked) Check the permissions of /usr/local/nagios/etc it appears that everything is either owned by nagios.nagios or apache.nagios.
Thanks,
Dave
You do not have the required permissions to view the files attached to this post.
Re: Configuration write failed - Dataset not found - Please help
Try moving all the files out of the config folder, to make sure there are no leftover files from another time.
/usr/local/nagios/etc/
Something on the order of, I'm not sure if you'd want ot go about it another perhaps simpler way.
I was not sure if I wanted to prune the static folder, on my test box there were files there... I though that was/is strange.
EDIT:
Never do this under normal operation, it's known to break more then it fixes.
/usr/local/nagios/etc/
Something on the order of, I'm not sure if you'd want ot go about it another perhaps simpler way.
Code: Select all
cd /usr/local/nagios/etc/; findargs=". -name pnp -prune -o -name import -prune -o -path ./nagios.cfg -o -type f"; find $findargs -print0 | cpio -o -0 > ../bakup.cpio; find $findargs -deleteEDIT:
Never do this under normal operation, it's known to break more then it fixes.