Nagios XI – How To Use The Bulk Host Cloning Purpose

Transcription

Nagios XI – How To Use The Bulk Host Cloning Purpose
Nagios XI – How To Use The Bulk Host Cloning
& Import Wizard
The Industry Standard in IT Infrastructure Monitoring
Purpose
This document describes how to use the Bulk Host Cloning & Import Wizard in Nagios® XI™. The Bulk Host Cloning & Import Wizard
allows you to easily import new hosts and services into Nagios XI. This tool is extremely useful for use in large environments where
several hosts need to be monitored quickly and in the same manner.
Target Audience
This document is intended for use by Nagios XI Administrators who want to quickly set up several hosts to be monitored in a similar
manner.
Overview
The Bulk Host Cloning & Import Wizard allows you to easily import new hosts and services into Nagios XI using a CSV dump. Imported
or cloned hosts have services that are replicated to match an already existing host the user selects as a template. This import/cloning
tool is extremely useful for large environments that want to quickly setup several hosts to be monitored in the same manner. This
document will cover the following topics:
•
•
Installing the Bulk Host Cloning & Import Wizard
Running the Configuration Wizard
Installing The Bulk Host Cloning & Import Wizard
Starting with Nagios XI 2012, all existing configuration wizards were included with Nagios XI releases. If you are running a earlier
version of Nagios XI, you will need to download the configuration wizard. If you are running Nagios XI 2012 or later you can skip this
step.
The Bulk Host Cloning and Import wizard can be downloaded at:
Bulk Host Cloning & Import Wizard
http://exchange.nagios.org/directory/Addons/Configuration/Configuration-Wizards/Bulk-Host-Import-Wizard/details
Download and install as you would any other wizard. If you are unsure of how to do that please refer to the documentation here:
How to Install Configuration Wizards in Nagios XI
http://assets.nagios.com/downloads/nagiosxi/docs/Installing_XI_Configuration_Wizards.pdf
Running The Configuration Wizard
Once in the Nagios XI web interface, click the Configure link in the top menu and then Run the Monitoring Wizard.
Click on the Bulk Host Cloning and Import wizard.
Nagios Enterprises, LLC US: 1-888-NAGIOS-1
P.O. Box 8154
Int'l: +1 651-204-9102
Saint Paul, MN 55108
Fax: +1 651-204-9103
USA
Web: www.nagios.com
Email:[email protected]
Page 1
Copyright © 2010 - 2014 Nagios Enterprises, LLC
Revision 1.0 – May, 2014
Nagios XI – How To Use The Bulk Host Cloning
& Import Wizard
In Step 2, select the existing host from the Host Name
drop-down menu that you would like to use as a
template, and click Next.
Remember you are going to clone one host many times.
It is recommended that you verify the host your are
cloning is set up properly. See the Additional Tips
section for more information.
In Step 3, after you have selected a template host, you
should specify which services from the template host
should be applied to newly imported hosts.
All of the available services are listed under the
Template Services section. In order to select a service,
just check the select box next to the desired service
name.
Under Import Data, you should specify which fields of
the CSV data you are uploading (Address, Name, and
Description) from the drop-drowns provided.
You should also enter the host data to import in CSV
format – one entry per line. Please reference the Import
Data section in the picture to the right, showing the Step
3 of the Bulk Host Cloning & Import Monitoring Wizard.
It is a good practice to clone only a few hosts initially and
then verify the results are as expected. If you get the
expected results, then clone a larger number of hosts.
See the Additional Tips section for more information
about cloning large numbers of hosts.
Follow the wizard by clicking on the Next button in Step 4 – Step 6. In these steps monitoring and notification options, as well as group
memberships will be inherited from the template host and services you selected.
To finish up, click on Apply in the final step of the wizard.
Nagios Enterprises, LLC US: 1-888-NAGIOS-1
P.O. Box 8154
Int'l: +1 651-204-9102
Saint Paul, MN 55108
Fax: +1 651-204-9103
USA
Web: www.nagios.com
Email:[email protected]
Page 2
Copyright © 2010 - 2014 Nagios Enterprises, LLC
Revision 1.0 – May, 2014
Nagios XI – How To Use The Bulk Host Cloning
& Import Wizard
Things You Should Know
Unable to Clone Some Service Checks
The Bulk Host Cloning and Import Wizard cannot properly clone some types of service checks, that rely on other applications. For
example, you cannot clone a host, created by running the Network Switch/Router Wizard or Web Transaction Wizard, because they rely
on mrtg and webinject.
Parent-Child Relationships
It is important to note that the parent-child relationships won't be inherited, unless they are set in the host's config file which you are
using as a template. If you want to inherit the parent-child relationship of the template host, verify the config file for template host
includes a hostgroup in its definition. To view the config file for a host go to Configure → Core Config Manager → Monitoring →
Hosts.
Find the host you are inheriting from on the list and under Actions, click
on the disk icon. This will open a new window in your browser displaying
the config file for the selected host.
If the hostgroup is defined in the config file it will be inherited to other
hosts via the Bulk Host Cloning and Import wizard.
For example, if you added a host named “LS1” to a hostgroup named “linux-servers” through Configure → Core Config Manager →
Monitoring → Hosts → LS1 → Manage Host groups, and opened the file “LS1.cfg”, you would see that the following line was added
to the config file:
hostgroups
linux-servers
Now, when you run the Bulk Host Cloning and Import Wizard the newly created hosts will be set as members of the “linux-servers”
hostgroup.
However, if you added the “LS1” host to the “linux-servers” hostgroup by going to the Configure → Core Config Manager →
Monitoring → Hosts Groups → linux-servers → Manage Host groups, the “linux-servers” hostgroup won't be defined in the
“LS1.cfg” file, and therefore the new hosts won't inherit this quality from the template host.
Additional Tips
First, before you even start the Bulk Host Cloning and Import Wizard, double check the host that you are about to clone. Make sure it is
set up properly and run the Write Config Tool, to make sure that you don't have any config errors. Go to Config → Tools → Write
Config Files.
Next, run the wizard but clone your host only a few times just to make sure you are not going to run into some unexpected issues.
Even if the cloning of your host is successful, it is very difficult to undo what you've done. It is not easy to revert your changes and start
“clean” in case you forgot to add a service, change alias, etc. This is especially true if you created 500+ new hosts.
If you are going to create a huge number of hosts, using the Bulk Host Cloning & Import Wizard, you may run into some timeout issues.
Nagios Enterprises, LLC US: 1-888-NAGIOS-1
P.O. Box 8154
Int'l: +1 651-204-9102
Saint Paul, MN 55108
Fax: +1 651-204-9103
USA
Web: www.nagios.com
Email:[email protected]
Page 3
Copyright © 2010 - 2014 Nagios Enterprises, LLC
Revision 1.0 – May, 2014
Nagios XI – How To Use The Bulk Host Cloning
& Import Wizard
To avoid this, open a terminal and log into your Nagios server as root. Next, edit the /etc/php.ini file by running the following command:
vi /etc/php.ini
Increase the values under the “Resource Limits” section according to your needs and system specifications. You may have to modify
these lines:
max_execution_time =
max_input_time =
memory_limit =
Also, you can add the following line on the bottom of the file:
max_input_vars = 100000
Save and close the file. Restart apache, so that the changes can take effect:
service httpd restart
Trouble Shooting
Issue: “No template services selected” error occurs in Step 3 of the wizard.
Solution: Selecting at least one service is required, in order to continue.
Issue: Apply Configuration fails with the following error:
“Error: Service description, host name, or check command is NULL. Error: Could not register service...”
Solution: 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 above listed error message.
Issue: An Alias is not inherited to a cloned host. This is determined by going to Home → Host Detail and selecting a host. The Host
Status Detail screen opens and you will see: “Alias: alias” in the top left corner under the host name.
Solution: Alias is not inherited by default – you need to define an alias (description) in the Step 3 of the wizard.
Issue: Hostgroup relationship is not inherited.
Solution: Define hostgroup members under the “Host Management”, NOT under the “Host Group Management” in the CCM. Reference
Parent-Child Relationships in the Things You Should Know section.
Finishing Up
You have now successfully run the Bulk Host Cloning & Import Wizard. If you have any additional support issues that you cannot
resolve, please, post your questions on the Nagios Support Forum:
http://support.nagios.com/forum/
Nagios Enterprises, LLC US: 1-888-NAGIOS-1
P.O. Box 8154
Int'l: +1 651-204-9102
Saint Paul, MN 55108
Fax: +1 651-204-9103
USA
Web: www.nagios.com
Email:[email protected]
Page 4
Copyright © 2010 - 2014 Nagios Enterprises, LLC
Revision 1.0 – May, 2014