Is there a way to use one of the HTTP sensors to monitor a search field on a website and return a value if the search is successful? I'm trying to find a way to check to see if a Solr search is working from within the website, as opposed to just using a script sensor to check the service status.
Since this is basically doing a POST or GET request on a page, you could check out the following guide, which allows for monitoring a website login. You'll need to modify it somewhat, of course, to match your website query.
Stephan Linke, Tech Support Team
Not sure how this will work since the search will technically work (it will search) even with an invalid query term. It just won't find a result. Also, firebug is no longer and I don't see where the raw data can be found on inspect?
If the search field is always working and there's no result, how exactly would you check if the search is not working? Searching something that always yields a result?
Stephan Linke, Tech Support Team
We are really just trying to make sure that Solr is running and providing search results. We could do this with a SSH Script sensor, but we are trying to limit the amount of those that we use. Using an HTTP sensor seems less invasive/resource intensive. So, we are looking for a way to run a search on the page using the HTTP Advanced sensor, and if the search is successful, send back a code that the search is working (whether the search finds something or not).
In the above example, there may be an error if it doesn't find the requested search term, but that doesn't mean Solr isn't running/working. It just means it didn't find the term. Is there a way to use the sensor to test if they try to search for a term and Solr isn't working properly so doesn't even attempt the search?
Thank you for your post!
As my colleague Stephan mentioned, I recommend to use this guide in order to complete your request. For example, you could use the HTTP Advance Sensor and enter the corresponding Search-POST-URL. In addition, you can configure a key word search. This way, the Sensor executes the search-url once per scan interval and then searches the result for the keyword (e.g. "Not found")
Paessler Tech Support
Okay, so I did configure the HTTP Advanced sensor (the page does not require a login). I used the GET URL which searches for a specific term (ie: https://mysite.com/search?q=searchterm). Then, I checked for a keyword on the page. And it worked...is that the correct way to configure it? I tested it with a term that does not appear on the page and it gave a warning.
My question now is...is this a better way to check that the search service and database service are up and running, or is it better to use a SSH Script sensor with a script on the server which checks the services? (ie: service solr status, service postgres status)?
I have both options configured, but which is more resource intensive for the probe/PRTG server?
it seems that you did everything right as the sensor seems to be working correctly.
In fact there is a difference in performance needs. The HTTP Advanced approach is definitely the way to go, performance wise. The SSH sensor has a pretty high performance impact due to the connection handling and protocol overhead.
An idea would be to have both sensors running, HTTP Advanced with 60 seconds scanning interval and the SSH sensor with 60 minutes.
Tech Support, Paessler AG
This is great information...I set it up just that way. Thanks so much for your help!