Is there some kind of limit for how many services can be cloned using the bulk host cloning wizard or something? Every single time I try to clone this particular host I receive this error. All of my service definitions end up blank (see below example), and I have no idea how to get around this.
define service {
host_name lisaerp06p on lisapps26g
service_description / Disk Usage
register 1
}
define service {
host_name lisaerp06p on lisapps26g
service_description /opt/splunk Disk Usage
register 1
}
define service {
host_name lisaerp06p on lisapps26g
service_description /vendor/batchjobs Disk Usage
register 1
}
define service {
host_name lisaerp06p on lisapps26g
service_description /vendor/cognos Disk Usage
register 1
}
This host has 123 service checks that I'm trying to add. The host I'm cloning it off of currently has the same 123 checks. This is a server that will be replacing the one I am cloning it off of, hence the use of the bulk host cloning wizard. Made the most sense at the time, but now I can't get it to work...
Make sure that your “template” (the host you are trying to clone) has the same config name for host and services. If you renamed host/services they may be different. In this case the wizard will fail with the "Error: Service description, host name, or check command is NULL. Error: Could not register service..." error message.
See the troubleshooting section in the following document:
Ah, that looks to be the problem. It looks lik the service name is the one I nee to change. If I change the name of the .cfg file manually and then apply config from the gui will that bork anything?
Never mind, it looks like manually renaming the cfg file and removing it doesn't actually work. As soon as I apply a new config the old file name is restored. So my next question, is there an easy way to rename all 123 services without having to click on each one individually and change them?
You can use the Bulk Renaming Tool which comes with the Nagios XI Enterprise Edition. If you don't have Enterprise, you can start a free, 60-day, fully functional trial and get the job done.
Be sure to check out our Knowledgebase for helpful articles and solutions!
In this case the bulk renaming tool wouldn't help me, though. The host cfg file was named correctly, the service cfg file was not. Unfortunately the bulk service renaming wizard only allows me to change the name of the service description, which doesn't need to be changed in this case. Visual example would be that the host cfg name was 'potato salad.cfg' and the service name was 'tater salad.cfg'. I needed tater salad to be named potato salad. Looks like the only way to change the actual config name for the services is to actually do it individually on every single service check. Once I changed the config name on all 123 services and applied that config it changed the service cfg file name and all was well. Sort of a pain to do, but not anything to lose sleep over.
I see. Bulk renaming configs could be a good feature request candidate. I just want to point out that if you create your hosts/service via our wizards, the host/services configs WILL be named the same, and the issue wouldn't exist.
Be sure to check out our Knowledgebase for helpful articles and solutions!
I did use the wizards when initially adding the host/services. Problem was this host is a zone on one of our Unix servers. Our naming scheme (to make things easier for management to read) is <Zone> on <Global server>. This particular zone was failed over from one global to another. When this happens I need to change the name of the host so that management still sees the correct global that the zone is one, but if I don't change the config names on the services they still work fine as long as the parent host to the services is the correct host. TL;DR: this was only an issue because when this zone was failed over to a different global I was too lazy to change the names of all 120+ service checks.
If you wanna throw in a feature request for bulk config renaming I would definitely like something like that in XI. I'm not sure how much other demand there'd be for something like this but it'd certainly be helpful for us. Zones don't fail over to different globals often, but it does happen and a bulk config renaming tool would make things easier on me for sure.