Page 1 of 2
Bulk Host Cloning and Import
Posted: Tue Dec 19, 2017 6:36 pm
by tonkaUser
Hi,
I have 100+ windows servers with NCPA agent installed. Some have a single disk C while others have disks C/D or C/D/E.
How can I use a wizard-like bulk clone that will be smart enough to apply space monitoring to only the available disks?
As I see now, I will have to use "Bulk Host Cloning and Import " to clone only servers that have the same disks. Is that true or there's some quick way to import ?
Thanks
Re: Bulk Host Cloning and Import
Posted: Wed Dec 20, 2017 10:35 am
by npolovenko
Hello,
@tonkaUser.
How can I use a wizard-like bulk clone that will be smart enough to apply space monitoring to only the available disks?
I believe there's no such feature available yet. The wizard can determine the target server's configuration only when being ran for each server individually.
The reason why this hasn't been implemented is how would this plugin know if the drive is down versus if it doesn't actually exist?
As I see now, I will have to use "Bulk Host Cloning and Import " to clone only servers that have the same disks.
Yes, exactly, so you'd need to clone the configs to the servers that have same logical disks. Or you may clone one config to all servers and then delete the "non-existing checks".
Or you may assign servers with a similar structure to the hostgroups, and then assign the right service checks to the hostgroups.
Re: Bulk Host Cloning and Import
Posted: Wed Dec 20, 2017 1:24 pm
by tonkaUser
Is there a way to do it using config files on Nagios box? Thanks
Re: Bulk Host Cloning and Import
Posted: Wed Dec 20, 2017 2:04 pm
by npolovenko
@tonkaUser, Do you mean by manually modifying the cfg files in /usr/local/nagios/etc/ folder? You could, i'd recommend to import the new config files rather than modifying them. Take a look here:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Just run the NCPA wizard one time against a random host, and it will create cfg files in /usr/local/nagios/etc/ folder, then you could use those files as an example to create new ones.
You could also use a Bulk Modifications Tool. In XI web interface navigate to Configure/Core Configuration Manager, then click on Tools/Bulk Modifications Tool(in the left column). From there you'd click on add services, select the already existing services and clone them for the new hosts. And if you wonder how to add hosts: you could either add them in Core Configuration Manager, or you could use the Autodiscovery wizard that will scan the IP range and let you automatically add all hosts at once.
Re: Bulk Host Cloning and Import
Posted: Thu Dec 21, 2017 1:58 pm
by tonkaUser
Thanks
Re: Bulk Host Cloning and Import
Posted: Thu Dec 21, 2017 2:05 pm
by dwhitfield
tonkaUser wrote:Is there a way to do it using config files on Nagios box? Thanks
Are you talking about modifying the configs directly rather than using the CCM? You need to be careful with this, but it can be done:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: Bulk Host Cloning and Import
Posted: Fri Dec 22, 2017 2:38 pm
by tonkaUser
I wanted to change *.cfg files under /usr/local/nagios/etc/services and then let Nagios re-process them. I see that my changes are visible, but I don't want to loose them.
Re: Bulk Host Cloning and Import
Posted: Fri Dec 22, 2017 2:55 pm
by kyang
When you say change, are you editing the services under a host
for example: Editing the check command?
I'm not exactly sure, but this sounds a lot like what
@dwhitfield mentioned in the above post.
Be careful when modifying the configs directly, but following the instructions in the documentation he posted is how you do so.
Along with running the commands to make sure your changes don't throw any errors and then restart Nagios.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: Bulk Host Cloning and Import
Posted: Fri Jan 05, 2018 4:04 pm
by gormank
The following service will check all available drives. One thing is that if there are ~10 or more, the perfdata gets lost.
Code: Select all
define service {
service_description FS_Win_Usage
use default_service
hostgroup_name Windows_Physical,Windows_Virtual
check_command check_nrpe!CheckDriveSize!-a ShowAll=long MinWarnFree=20% MinCritFree=10% FilterType=fixed!"perf-config=used.used(unit:G;suffix:'') used %(ignored:true) show-all=long"!-a ShowAll=long MinWarnFree=20% MinCritFree=10% FilterType=fixed perf-config=used.used(unit:G;suffix:'!!!!
register 1
}
Re: Bulk Host Cloning and Import
Posted: Mon Jan 08, 2018 10:33 am
by kyang
Thanks gormank,
tonkaUser, Let us know of any other questions!