How to monitor NagiosLS from NagiosXI

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
xdatanet
Posts: 49
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

How to monitor NagiosLS from NagiosXI

Post by xdatanet »

I already monitor my two nodes by ncpa from NagiosXI (CPU, MEM, Port, eth, disks).

I want to monitor the state of the cluster because sometimes my VPN goes down and the cluster stops to syncronize.

I found a sh script in the template site that check it by the 9200 port but this port is open only to localhost in the NagiosLS.
Can I modify some way the network settings of ElasticSearch like suggested?

transport.host: localhost
network.host: <my-ip>

or should I follow another way using ncpa?

Can you suggest me a way to implement it?

Regards,
Graziano.
xdatanet
Posts: 49
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: How to monitor NagiosLS from NagiosXI

Post by xdatanet »

I've found check_es_cluster_status.sh into ncpa/plugins folder of my NagiosLS.
If I run it, it works.

OK: Cluster status is GREEN

But if I call it from NagiosXI it returns:

/usr/local/ncpa/plugins/check_es_cluster_status.sh: 1: python2: not found
UNKNOWN: could not retrieve cluster health data

I think it can execute the script but is there some problems about python??
Maybe about sudo??

Regards,
Graziano.
xdatanet
Posts: 49
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: How to monitor NagiosLS from NagiosXI

Post by xdatanet »

Solved!!!

Ubuntu uses bash not sh...

I changed /bin/sh to /bin/bash in ncpa.cfg and it works.

Regards,
Graziano.
User avatar
jmichaelson
Posts: 334
Joined: Wed Aug 23, 2023 1:02 pm

Re: How to monitor NagiosLS from NagiosXI

Post by jmichaelson »

That's an interesting issue for sure. I've opened up an issue in GitHub to track it here: https://github.com/NagiosEnterprises/ncpa/issues/1214
Please let us know if you have any other questions or concerns.

-Jason
bbahn
Posts: 315
Joined: Thu Jan 12, 2023 5:42 pm

Re: How to monitor NagiosLS from NagiosXI

Post by bbahn »

Hello @xdatanet & @jmichaelson,

It seems to me that the desire here is for plugins to default to the shebang'd interpreter instead of the default interpreter defined in ncpa.cfg for the file extension. Is this correct?
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
User avatar
jmichaelson
Posts: 334
Joined: Wed Aug 23, 2023 1:02 pm

Re: How to monitor NagiosLS from NagiosXI

Post by jmichaelson »

@bbahn That's what I'm thinking
Please let us know if you have any other questions or concerns.

-Jason
bbahn
Posts: 315
Joined: Thu Jan 12, 2023 5:42 pm

Re: How to monitor NagiosLS from NagiosXI

Post by bbahn »

I will mark this as a feature request and will add it to the list of things to work on when I have some time to get back to NCPA. If anyone has any objections or concerns, I would prefer if they could be posted on the GitHub issue: https://github.com/NagiosEnterprises/ncpa/issues/1214.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
dscrimpsher
Posts: 14
Joined: Wed Jan 22, 2014 4:24 pm

Re: How to monitor NagiosLS from NagiosXI

Post by dscrimpsher »

I am glad I found this post. Thank you for sharing.

I just built a new NLS (2024R1.3) cluster on Ubuntu 24.04. I was adding it to my Nagios XI (2024R1.3.2) system with the NCPA wizard and ran into this issue.
I edited the file /usr/local/ncpa/etc/ncpa.cfg on the NLS server.
Changed the line towards the bottom of the file from this
# Linux / Mac OS X
.sh = /bin/sh $plugin_name $plugin_args

to this:
# Linux / Mac OS X
.sh = /bin/bash $plugin_name $plugin_args


Now the check in Nagios is working properly for both of the NCPA plugin files check_es_cluster_status.sh and check_es_jvm_heap.sh
LS_noob
Posts: 2
Joined: Wed Jan 22, 2025 3:31 pm

Re: How to monitor NagiosLS from NagiosXI

Post by LS_noob »

I have set up two LS Alerts -- they read perfectly with the LS dashboard and I have chosen them to "Run Now". Further, I have enabled the proper token in XI, but neither alert shows up in XI's Unconfigured Objects. Any ideas?
jsimon
Posts: 317
Joined: Wed Aug 23, 2023 11:27 am

Re: How to monitor NagiosLS from NagiosXI

Post by jsimon »

Hi @LS_noob,

I'm not sure what steps you've taken when you mention enabling the proper token for XI. The best way to monitor a Nagios Log Server query from XI would be to use the Nagios Log Server wizard. All you'll need to run this wizard is your hostname for your NLS server and your API token attached to the account you are using with NLS. When complete that wizard will add a new Host to your XI with the name you provide when you run this wizard. Based on this I'm not sure why we're checking Unconfigured Objects, so I just want to be clear about your goals and the steps you've taken so far. I would try using the Nagios Log Server wizard if you haven't already. If you have, please let us know in more detail what steps you've taken so we can get this figured out.
Locked