Page 1 of 1
Configuration Wizard for NCPA defaults
Posted: Mon Dec 18, 2017 12:29 pm
by tonkaUser
Hi,
We want to run config wizard for NCPA for multiple Windows servers and have the defaults for CPU/Memory/Disk that different from what is shown currently ? Some servers have one disk others have multiple. How can we do it?
What is the best way to apply the same defaults across multiple servers?
It seems that the template does not cover CPU/Memory/Disk metrics.
Thanks,
Boris
Re: Configuration Wizard for NCPA defaults
Posted: Mon Dec 18, 2017 12:50 pm
by lmiltchev
It seems like the NCPA wizard is not setting the values properly. I filed an internal bug report on the issue (TASK ID 12850). Thank you!
Re: Configuration Wizard for NCPA defaults
Posted: Mon Dec 18, 2017 1:47 pm
by tonkaUser
Thanks for the quick reply.
What's your recommendation for the bulk on-boarding with NCPA agent (e.g. we have it installed and want to clone config across multiple hosts)?
Re: Configuration Wizard for NCPA defaults
Posted: Mon Dec 18, 2017 5:14 pm
by npolovenko
@tonkaUser, One of the ways is to use a configuration management tool like "Chef" or "Puppet".
Re: Configuration Wizard for NCPA defaults
Posted: Tue Dec 19, 2017 6:37 pm
by tonkaUser
While the bug is not resolved yet, is there some config file that drives NCPA defaults for the wizard? It would be really neat if I can change that file.
Re: Configuration Wizard for NCPA defaults
Posted: Wed Dec 20, 2017 10:59 am
by lmiltchev
You can very easily change the defaults for the NCPA wizard. Open the "
/usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php" file in a text editor, change the warning and critical threshold values to whatever you need, save, exit, and rerun the wizard.
Here's the section that you need to modify (around line 248):
Code: Select all
// Set defaults for services
$default_services['cpu_usage']['monitor'] = 'on';
$default_services['cpu_usage']['warning'] = 20;
$default_services['cpu_usage']['critical'] = 40;
$default_services['cpu_usage']['average'] = 1;
$default_services['memory_usage']['monitor'] = 'on';
$default_services['memory_usage']['warning'] = 50;
$default_services['memory_usage']['critical'] = 80;
$default_services['swap_usage']['monitor'] = 'on';
$default_services['swap_usage']['warning'] = 50;
$default_services['swap_usage']['critical'] = 80;
foreach ($root['disk']['logical'] as $title => $value) {
$default_services['disk'][$title]['monitor'] = 'on';
$default_services['disk'][$title]['warning'] = 70;
$default_services['disk'][$title]['critical'] = 90;
Note: Keep in mind that any upgrade would wipe out the changes you made to the "ncpa.inc.php" file, and will restore the "defaults".
You could also run the NCPA wizard once, using the thresholds that you need, and create a host that you can use as a "template" for the "Bulk Host Cloning And Import Wizard". Run the Bulk Host Cloning wizard against this host, and clone it as many times as you want. For more information on how to use the Bulk Host Cloning And Import wizard, please review our documentation on the topic here:
https://assets.nagios.com/downloads/nag ... Wizard.pdf
Let us know if this helped. Thank you!
Re: Configuration Wizard for NCPA defaults
Posted: Wed Dec 20, 2017 2:23 pm
by tonkaUser
Thanks. You can close this thread.
Re: Configuration Wizard for NCPA defaults
Posted: Wed Dec 20, 2017 2:33 pm
by kyang
Sounds good! I'll be closing this thread!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!
Re: Configuration Wizard for NCPA defaults
Posted: Fri Dec 29, 2017 11:31 am
by jomann
I would like to point out that TASK ID 12850 has been cancelled, since it is not a bug. We only store in the templates the notification, contacts, and group settings, not the actual values that were given in step 2, so it only saves step 3-5. This functionality is on the road map and a feature request already exists for it, so
@lmiltchev's answer is the best one, if you set the defaults you will be able to have them be the values you want every time you run the wizard.