Page 1 of 1

Activating or moving a test server

Posted: Wed Nov 10, 2021 1:53 pm
by LMillerD
(Using CentOS 7 64-bit; XI installed manually, no special configurations).

So far our organization has only activated an installation with our license once. Does Nagios differentiate between production and test servers in any meaningful way? Are we free to use our license to activate a new installation and designate it however we wish? We want to activate a test server, but it may need to be moved to different hardware in the near future. Are there any considerations that must be made prior to moving a server? Does everything just work, so long as not more than 3 activations are running at a time, or does one need to be deactivated before the license can be used again?

Thanks.

Re: Activating or moving a test server

Posted: Thu Nov 11, 2021 12:41 pm
by ssax
Yes, Nagios differentiates between production, DR, and test systems. Each license gets 3 activations (prod/DR/test), see here for what a single XI license entitles you to:

https://support.nagios.com/kb/article.php?id=145

Once you exceed the three activations you will need to reach out to [email protected] (or call in) to have them deactivate/add a new activation.

Only your prod instance can be actively monitoring/alerting outside of testing/migration. After testing/migration, the other systems should be turned off or have Admin > Monitoring Engine Status > Notifications/Active Checks/Passive Checks disabled to stay within the spirit of the license.

NOTE: The DR/test systems will still need firewall rules in place and any agent allowed hosts directives would need to be updated to add the new DR/test XI server IPs otherwise the checks will fail.

The XI backup/restore process makes migrating (or cloning prod for DR/test) pretty easy:

The process is this:
- Spin up new server running a latest supported distro from the Install guide.

- Install the exact same version of XI that the old server has on the new server, no need to configure it, just install it and go through the initial setup (do not try to restore over different versions of XI you will cause issues)

https://assets.nagios.com/downloads/nag ... -Linux.pdf

- If you have a RAMDisk installed, are using RRDCacheD, or are running Mod_Gearman on the old system, set them up before restoring:

https://assets.nagios.com/downloads/nag ... giosXI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios_XI.pdf

If you are monitoring vmware/oracle you'll need to reinstall the proper supporting packages on the new server again following these guides:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

- Backup the old/transfer to new/restore to the new

- Follow the After The Restore section from the backup/restore guide completely

- If you're changing OS versions, run the restore_repair script from the backup/restore guide:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

- Shutdown (or re-IP) the old if migrating, set the old IP on the new system so you don't have to update agent configs/FW rules

https://support.nagios.com/kb/article/c ... s-549.html

That's pretty much it.

Re: Activating or moving a test server

Posted: Fri Nov 12, 2021 2:50 pm
by LMillerD
Thank you very much for your reply! I appreciate that you anticipated what my next questions were likely to be. I didn't know about the repair script. You've saved me some time and reminded me to review available scripts. Is there official documentation just about the scripts in /usr/local/nagiosxi/scripts/ ? I didn't find what I was looking for on https://library.nagios.com/library/prod ... mentation/

Re: Activating or moving a test server

Posted: Mon Nov 15, 2021 2:19 pm
by ssax
Not really, you can generally run the script with --help added to see what it does, here's a synopsis:

Code: Select all

automation
- https://support.nagios.com/kb/article/nagios-xi-ansible-tutorial-819.html

backup_xi.sh
restore_xi.sh
- https://assets.nagios.com/downloads/nagiosxi/docs/Backing-Up-And-Restoring-Nagios-XI.pdf

https://assets.nagios.com/downloads/nagiosxi/docs/Automated_Host_Management.pdf
ccm_delete_object.php
ccm_export.php
ccm_import.php

change_timezone.sh
- Used by XI app to change timezone of all required items


components
- Auto Discovery/Get profile.zip script

contact_notification_handler.php
- https://assets.nagios.com/downloads/nagiosxi/docs/Configuring-Core-Contacts-to-Use-Xi%27s-PHP-Mailer.pdf

deploy_run_job.php
- Used by NCPA Deploy functionality

handle_nagioscore_event.php
handle_nagioscore.inc.php
handle_nagioscore_notification.php
- Used by XI to handle events/notifications

import_xiconfig.php
- Used by XI import functionality

initialize_mibs.php
- Used by install/upgrade to initialize the MIBs

manage_services.sh
- Used by XI app to manage the services (start/stop/status/etc)

manage_ssl_config.sh
- For updating Apache SSL configurations

migrate
- Used by XI Admin > Migrate Server

nagiosql_defaults.sql
- For restoring defaults

ccm_snapshot.sh
nom_create_nagioscore_checkpoint_cond.sh
nom_create_nagioscore_checkpoint.sh
nom_create_nagioscore_errorpoint.sh
nom_restore_nagioscore_checkpoint.sh
nom_restore_nagioscore_checkpoint_specific.sh
nom_trim_checkpoints.sh
- For working with CCM snapshots/Admin > Config Snapshots

nxti_import.php
- Importing SNMPTT/NXTI traps
nxti.php
- https://assets.nagios.com/downloads/nagiosxi/docs/SNMP-Traps-With-NXTI.pdf

parse_core_eventlog.php
- Used by the Admin > Unconfigured Objects functionality to parse the /usr/local/nagios/var/nagios.log

patch_ndoutils.php
- Used by upgrade/install

reconfigure_nagios.sh
- What is run when you click Apply Configuration
- Can also run from CLI or when importing
- https://assets.nagios.com/downloads/nagiosxi/docs/Automated_Host_Management.pdf

remove_historical_data.sh
- https://support.nagios.com/kb/article/nagios-xi-removing-all-historical-data-812.html

repair_databases.sh
- repairmysql.sh - used by the above script
- https://assets.nagios.com/downloads/nagiosxi/docs/Repairing_The_Nagios_XI_Database.pdf

reset_config_perms.sh
- https://support.nagios.com/kb/article/nagios-xi-configuration-applies-no-changes-take-place-39.html
- Is automatically run after an apply config as well

reset_nagiosadmin_password.php
- https://support.nagios.com/kb/article.php?id=146

restart_nagios_with_export.sh
- Used during apply configuration, export nagiosql DB data to file and restart the nagios service

restore_defaults.sh
- https://support.nagios.com/kb/article/nagios-xi-restoring-default-configuration-164.html

send_to_auditlog.php
send_to_nls.php
- Used to Audit Log functionality

unlock_user_account.php
- Can be used to unlock a user account

update_check.php
- Used to check for XI updates

upgrade_to_latest.sh
- Used by web upgrade functionality