Can't you just configure nagios to do a "negative match" against numFound=0 ? ... ie: "if response matches 'numFound=0' fail the check."
(IIRC there's an '--invert-regex' option for this) : Date: Mon, 28 Dec 2020 14:36:30 -0600 : From: Dmitri Maziuk <dmitri.maz...@gmail.com> : Reply-To: solr-user@lucene.apache.org : To: solr-user@lucene.apache.org : Subject: how to check num found : : Hi all, : : we're doing periodic database reloads from external sources and I'm trying to : figure out how to monitor for errors. E.g. I'd run a query '?q=FOO:BAR&rows=0' : and check if "numFound" > 0, that'd tell me if the reload succeeded. : : The check is done using nagios curl plugin, and while it can match a string in : the response, the "> 0" check would require writing an extra parser -- it's a : simple enough two-liner, but I'd rather not add more moving pieces if I can : help it. : : The best I can figure so far is : ``` : fl=result:if(gt(docfreq(FOO,BAR),0)"YES","NO")&rows=1 : ``` : -- returns '"result":"NO"' that our nagios plugin can look for. : : Is there a better/simpler way? : : TIA : Dima : -Hoss http://www.lucidworks.com/