Page 1 of 1

Nagios - support new stuff

Posted: Mon Mar 04, 2019 7:00 am
by reincarne
Hi,
I wrote this post also in Nagios ideas. Adding this here as it can also help others. Please consider to add it as bug fixes or support for new features.
Recently I upgrade our linux instance to Amazon instance.
I started to make changes in order to make Nagios more friendly with Amazon instance , because I know you don't support it yet, however, here are some friendly changes I already did to make stuff work:

in file:
/usr/local/nagiosxi/var/xi-sys.cfg
"distro" parameter and "dist" Recognizing that this is an Amazon instance, so their parameters are automatically set to:
distro='Amazon Linux'
dist='amazon'


Cause of the, Nagios doesn't know how to handle the local service. In order to make it work, I added support for Amazon distro in:
/usr/local/nagiosxi/scripts/manage_services.sh
by adding these lines
"$distro" == "Amazon Linux"
So now the full line looks like this:
if [ "$distro" == "CentOS" ] || [ "$distro" == "RedHatEnterpriseServer" ] || [ "$distro" == "EnterpriseEnterpriseServer" ] || [ "$distro" == "OracleServer" ] || [ "$distro" == "Amazon Linux" ]; then

Another change that we did as a result of compliance issues, is upgrading our php version from 5.4 to 7.2.13.
It seems like Nagios deffinately doesn't support it yet, however I found a bug which I fixed today.
On the new PHP version, the NRDS won't open the config files, as it leave the page blank due to http error 500:
[04/Mar/2019:11:18:00 +0000] "GET /nagiosxi/includes/components/nrdsconfigmanager/nrdsconfigmanager.php?mode=edit&edit=NRDP_Jenkins&dir=configs HTTP/1.1" 500 -

Which is an issue with one of the files:
[Mon Mar 04 11:25:17.317893 2019] [php7:warn] [pid 24008] [client X.X.X.X:65253] PHP Warning: Illegal string offset 'SEND_NRDP' in /usr/local/nagiosxi/html/includes/components/nrdsconfigmanager/nrdsconfigmanager.php on line 415, referer: https://nagios.trusteer.net/nagiosxi/admin/

In order to fix it, I had to define one of the variables as an array by adding:
$configvar = array();
to line 405 to the nrdsconfigmanager.php file.

If you can add these code lines in one of the version so each upgrade I won't have to do it manually - I will be thankful :)

Re: Nagios - support new stuff

Posted: Mon Mar 04, 2019 11:17 am
by benjaminsmith
Hello @reincarne,

Thanks for the input. It looks like you were able to get Nagios XI running successfully on Amazon Linux. Officially, we haven't rolled out support for Amazon Linux. We've been busy testing and launching support on Ubuntu / Debian for all of our products. However, I just had a brief conversation with one of our developers regarding the Amazon Linux and your request and code changes.

As far as PHP 7 goes, yes it will work with Nagios XI. However, we support whatever version that is included with the supported operating systems. Right now, that is php 5.x on RHEL / CentOS and php 7.x on Ubunut / Debian.

Let me know if you have any questions or comments. Thank you.

Re: Nagios - support new stuff

Posted: Tue Mar 05, 2019 2:12 am
by reincarne
Thanks for the reply.
No question, just wanted to be helpful :)

Re: Nagios - support new stuff

Posted: Tue Mar 05, 2019 8:01 am
by scottwilkerson
reincarne wrote:Thanks for the reply.
No question, just wanted to be helpful :)
Thanks!