Page 1 of 1

Solr: check stats of cores

Posted: Mon Dec 02, 2019 7:28 am
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

Re: Solr: check stats of cores

Posted: Mon Dec 02, 2019 10:08 am
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?

Re: Solr: check stats of cores

Posted: Mon Dec 02, 2019 3:53 pm
by cdienger
Thanks for the input, @mcapra!

@Quim, let us know if we can be of further assistance.

Re: Solr: check stats of cores

Posted: Tue Dec 03, 2019 7:23 am
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

Re: Solr: check stats of cores

Posted: Wed Dec 04, 2019 9:08 am
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?

Re: Solr: check stats of cores

Posted: Thu Dec 05, 2019 8:42 am
by Quim
scottwilkerson wrote:Can we mark this case closed?
You can close this case, please.
Thanks

Re: Solr: check stats of cores

Posted: Thu Dec 05, 2019 9:02 am
by scottwilkerson
Quim wrote:
scottwilkerson wrote:Can we mark this case closed?
You can close this case, please.
Thanks
Great!

Locking thread