Solr: check stats of cores
Posted: Mon Dec 02, 2019 7:28 am
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
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