Library

Docs
Beta

Products

404 errors after upgrade from 2024R1.1.2 to 2024R1.1.3Active Directory / LDAP Troubleshooting Authentication IntegrationBackups are not being generated due to tar creation errorsCCM says unapplied changes exist, but none listedCHECK_NRPE Error Could not connect to xxx.xxx.xxx.xxx Connection reset by peerDatabase Storage Engine and High CPU usage in Nagios XIDisabling Port 113 IDENT RequestsERROR Please add the ’Optional’ channel to your Red Hat systems subscriptionsError Invalid max_check_attempts value for hostHow To Clear Solaris Service Maintenance StatusNagios XI -ERROR unable to open include file conf.d/.cfgNagios XI 2014 Upgrade Issue CONFIG ERRORNagios XI Ajaxterm Installation AbortedNagios XI Apply Configuration Fails Backend login to the Core Configuration failedNagios XI Apply Configuration Never CompletesNagios XI Can’t Log Into The Web InterfaceNagios XI CentOS 6 Installation Problems XI 2011R1.7 2011R1.8Nagios XI Checking System StatusNagios XI Common Upgrade Failures And SolutionsNagios XI Configuration Applies, No Changes Take PlaceNagios XI Configuration Applies, but still get Configuration File Is Out Of Date ErrorNagios XI Configuration Verification FailedNagios XI Core 4 Load Spikes on 1.75 and 7 Hour IntervalsNagios XI Crashed Database TablesNagios XI Debugging Bandwidth Performance GraphsNagios XI Defining Global Environment VariablesNagios XI Disabling Database UTF8 ConnectivityNagios XI ERROR PostgresQL not running exitingNagios XI ERROR unable to open include file /etc/mrtg/conf.d/xxxxxxx.cfgNagios XI Empty Screen for Wizard, Component, DashletNagios XI Error while converting SVGNagios XI Event Data Is StaleNagios XI HTTP 500 Error / PHP Parse error Unexpected $endNagios XI HTTP 500 Error / White Screen After LoginNagios XI High Availability and Failover Solutions for Nagios XI NWC14Nagios XI Host Still Visible After Deletion (Ghost Hosts)Nagios XI Hosts Pending/GrayNagios XI ICMP and Ping Checks Stopped GraphingNagios XI Installing XI Fails To Install Dependency pymssqlNagios XI Issues with mod_gearman and Performance Data Newlines \nNagios XI LDAP / Active Directory Import Users Certificate IssuesNagios XI Last Check Time Not UpdatingNagios XI Login Screen Keeps Redirecting To ItselfNagios XI MK Livestatus Problems With Mod GearmanNagios XI MRTG Reports SNMP_Session ErrorsNagios XI MSSQL Query Wizard Invalid characters in the usernameNagios XI MSSQL Wizards Adaptive Server connection failedNagios XI Missing localhost AlertsNagios XI Notification ProblemsNagios XI Notifications Not Sending In XI 5.3.0Nagios XI Oracle Services Critical After Nagios XI UpgradeNagios XI Performance Graph ProblemsNagios XI Plain Text Password ConsiderationsNagios XI Problems Using Nagios XI With ProxiesNagios XI Problems With Scheduled Backups At MidnightNagios XI Problems with $ Signs in the Check CommandNagios XI Profile Build FailedNagios XI Receiving IPv6 SNMP TrapsNagios XI Reset Security CredentialsNagios XI Reset Upgrade Status In Web InterfaceNagios XI Resetting The nagiosadmin PasswordNagios XI Resizing the VM Disk SizeNagios XI Resolving Cannot connect to database Error Core Config ManagerNagios XI Running Out Of Disk Space On The Nagios XI VMNagios XI SNMP MIB Upload ProblemsNagios XI SNMPTT Service generates Cannot find module errorsNagios XI SQL Error [nagiosxi] -ERROR -syntax errorNagios XI Schedulded Backups No Longer WorkingNagios XI Scheduled Downtime Not WorkingNagios XI Scheduled Reports Not RunningNagios XI Some BPI Checks Show Unknown BPI Group Index After UpgradeNagios XI SourceGuardian Errors 2009R1.2CNagios XI Status Information Cut Off At 256 CharactersNagios XI Troubleshooting ReportsNagios XI Unable To Login Using Two Factor AuthenticationNagios XI Unable to Delete HostNagios XI Upgrade errors root.crontab.orig cannot overwrite existing fileNagios XI Uploaded plugin returns /bin/bash^M bad interpreter No such file or directoryNagios XI Warning Duplicate definition found for contact ’xi_default_contact’Nagios XI Windows Memory Usage PhysicalNagios XI mysql_error out of range value for columnPerformance Graphs Showing Data during Host Down Time PeriodsSlack Notifications Stopped WorkingUpgrade error with XI and non standard Broker ModulesUpgrading to NDO 3 after having been downgraded in newer versions of Nagios XIWeb Browser Reports 330 Error Content EncodingXI 5.4 monitoring engine not running/usr/local/nagiosxi/var/xi itype No such file or directory error

Nagios XI - Defining Global Environment Variables

Problem Description

When setting up a check in Nagios, you may get a error similar to the following:

[Can't locate Monitoring/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl 
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_rabbitmq_aliveness l
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_rabbitmq_aliveness line 15.]

However when you execute the check in an SSH session as the nagios user, it executes correctly.

Explanation

When you test the plugin in an SSH session, you are using a session that has environment variables loaded from your bash profile. This includes an extended PATH which allows bash to find the require modules.

In some environments, when the plugin is executed by the monitoring engine, these environment variables are not loaded and hence the plugin does not know where to find them and fails.

Define Global Environment Variables

In this solution, you will define variables required for you plugins globally.

Specifically:

  • Add the path /usr/local/important_application to the PATH environment

  • Add the variable ORACLE_HOME=/usr/lib/oracle/11.2/client64

This is performed by editing a specific file that nagios checks when it starts:

/etc/sysconfig/nagios

By default, this file does not exist, but you will create it just by opening vi to the file.

Open an SSH session to your Nagios XI host

Type:

vi /etc/sysconfig/nagios

Press i to start editing the file

Add the following lines to the file:

export PATH=$PATH:/usr/local/important_application
export ORACLE_HOME=/usr/lib/oracle/11.2/client64

Press esc to stop the editing mode

Type:

:wq

Now restart Nagios:

**RHEL 7 + | CentOS 7 + | Oracle Linux 7 + | Debian | Ubuntu 16/18/20
**

systemctl restart nagios.service

Warning: Mod-Gearman is an unsupported third-party utility.

Nagios Enterprises provides this KB article to customers in good faith. However, an attempted integration with Mod-Gearman is not supported by Nagios Enterprises and future problems caused by using this method are beyond our control.

Multiple Nagios XI instances can be used if the size of your infrastructure or monitoring needs require you to create a distributed monitoring environment. Federated or distributed Nagios XI instances empower you to scale your infrastructure while making it easier to manage large environments and future changes. For more information on using multiple Nagios XI instances to distribute check load, visit Distributed Monitoring with Nagios XI.

Mod-Gearman

If you have Mod-Gearman, the following steps will need to be performed on all of your workers (including the XI server if it is a worker).

Note: The method for workers are different depending on the operating system they are running on.

**RHEL 7 + | CentOS 7 + | Oracle Linux 7 + | Debian | Ubuntu 16/18/20
**

These operating systems use systemd which has a different method, referencing existing environment variables like $PATH will not work. If you wish to define the path, you will need to define the entire path variable (which is shown below).

The following is being applied:

  • Re-define the PATH environment to include /usr/local/important_application

  • Add the variable ORACLE_HOME=/usr/lib/oracle/11.2/client64

This is performed by editing a specific file that mod-gearman2-worker checks when the service starts:

/etc/sysconfig/mod-gearman2-worker

Open an SSH session to your Mod-Gearman worker.

Type:

vi /etc/sysconfig/mod-gearman2-worker

Press i to start editing the file

Add the following lines to the end of the file:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/important_application
ORACLE_HOME=/usr/lib/oracle/11.2/client64

Press esc to stop the editing mode

Type:

:wq

Now reload the daemons and restart the Mod-Gearman worker:

systemctl daemon-reload
systemctl restart mod-gearman2-worker.service

RAM Disk

If you later configure Nagios XI with a RAM Disk using our installation script, the settings you just added will be lost. You will need to follow the steps above (Define Global Environment Variables) to re-add the environment variables and it will work again.

Nagios XI - Utilizing a RAM Disk in Nagios XI

How Can I See The Environment Variables ?

One way to see what environment variables are present when the plugin executes is to create a simple plugin that will output them. From this you create a command and service and then you can see the result in the XI GUI.

Bash script:

#!/bin/bash
env | grep -v '|'
exit 0

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

Nagios Enterprises, LLC

© All rights reserved. 2026