Page 1 of 2
How to monitor NagiosLS from NagiosXI
Posted: Mon Oct 07, 2024 1:30 am
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.
Re: How to monitor NagiosLS from NagiosXI
Posted: Mon Oct 07, 2024 5:10 am
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.
Re: How to monitor NagiosLS from NagiosXI
Posted: Mon Oct 07, 2024 5:30 am
by xdatanet
Solved!!!
Ubuntu uses bash not sh...
I changed /bin/sh to /bin/bash in ncpa.cfg and it works.
Regards,
Graziano.
Re: How to monitor NagiosLS from NagiosXI
Posted: Mon Oct 07, 2024 4:38 pm
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
Re: How to monitor NagiosLS from NagiosXI
Posted: Tue Oct 08, 2024 10:32 am
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?
Re: How to monitor NagiosLS from NagiosXI
Posted: Tue Oct 08, 2024 1:36 pm
by jmichaelson
@bbahn That's what I'm thinking
Re: How to monitor NagiosLS from NagiosXI
Posted: Thu Oct 10, 2024 10:42 am
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.
Re: How to monitor NagiosLS from NagiosXI
Posted: Thu Dec 19, 2024 12:42 pm
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
Re: How to monitor NagiosLS from NagiosXI
Posted: Wed Jan 22, 2025 3:37 pm
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?
Re: How to monitor NagiosLS from NagiosXI
Posted: Fri Jan 24, 2025 10:31 am
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.