Nagios - support new stuff

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Nagios - support new stuff

Post by reincarne »

Hi,
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 :)
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios - support new stuff

Post by benjaminsmith »

Hi @reincarne,

I'm going to close this post as I see you have posted this in the Nagios XI forum as well.

Thank you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked