Solr: check stats of cores

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
Quim
Posts: 12
Joined: Tue Nov 12, 2019 10:45 am

Solr: check stats of cores

Post by Quim »

Hello

I am trying to monitoring our internal Solr system with Nagios, especially stats of cores (add screenshot).
Actually I have a script (.sh) with some checks like ping, num_docs,.. Works fine.

Sample for ping check:

# Get ping status of specified core
solr_core_ping() {
# Check if core actually exists before continuing
solr_core_exists $1 || {
echo "not exists => WARNING"
return $STATE_WARNING
}

local RESULT=$(exec_curl ${URL_PREFIX}${O_SOLR_HOST}:${O_SOLR_PORT}/solr/$1/admin/ping?wt=xml |
xmlstarlet sel -t -v "/response/str[@name='status']")

if [ "$RESULT" == "OK" ]; then
echo "OK"
return $STATE_OK
else
echo "$RESULT => CRITICAL"
return $STATE_CRITICAL
fi
}

The issue is how to check stats of cores.
I was wondering if anyone can point me in the right direction. Thanks.

P.D.:
Nagios host
Operating System: Ubuntu 18.04.3 LTS
Kernel: Linux 5.0.0-1022-azure
Architecture: x86-64

Nagios version
Nagios® Core™ 4.4.5
Attachments
Stats
Stats
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Solr: check stats of cores

Post by mcapra »

Here's a reasonably good Solr plugin for Nagios:
https://github.com/cpganderton/nagios-solr

Unfortunately it doesn't check the /select endpoint and would need to be extended to do so. I can't actually find one that does:

https://github.com/alxgomz/nagios-plugi ... co_solr.py
https://github.com/dupondje/nagios_plug ... ck_solr.py

I don't know much about Solr, but my understanding is the /select endpoint expects a query to be passed to it? And you're trying to monitor the response times of a particular query? Or are you trying to monitor stats for all /select calls that have been made over a period of time?
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Solr: check stats of cores

Post by cdienger »

Thanks for the input, @mcapra!

@Quim, let us know if we can be of further assistance.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Quim
Posts: 12
Joined: Tue Nov 12, 2019 10:45 am

Re: Solr: check stats of cores

Post by Quim »

Thanks @mcapra!

As you say, endpoint expects a query to be passed to it. This is the issue.
Url (query): core:port/solr/#/vacancy/plugins?type=queryhandler&entry=%2Fselect

I check: https://github.com/alxgomz/nagios-plugi ... co_solr.py
I should to create a new function to check stats.

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solr: check stats of cores

Post by scottwilkerson »

Quim wrote:Thanks @mcapra!

As you say, endpoint expects a query to be passed to it. This is the issue.
Url (query): core:port/solr/#/vacancy/plugins?type=queryhandler&entry=%2Fselect

I check: https://github.com/alxgomz/nagios-plugi ... co_solr.py
I should to create a new function to check stats.

Thanks
Can we mark this case closed?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Quim
Posts: 12
Joined: Tue Nov 12, 2019 10:45 am

Re: Solr: check stats of cores

Post by Quim »

scottwilkerson wrote:Can we mark this case closed?
You can close this case, please.
Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Solr: check stats of cores

Post by scottwilkerson »

Quim wrote:
scottwilkerson wrote:Can we mark this case closed?
You can close this case, please.
Thanks
Great!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked