Go to All Forums

Regular Expression in Port Monitor

Hello I have set up a port monitor. the monitor executes a request and get a response in the format ":N " where N is a number indicating the length of a backlog. I want to monitor to make sure that backlog doesn't get too long. In the content match section of the port monitor I have entered the following regular expression: 

:[0-1][0-9]?$|:[2-9]$

which should match ":0" through ":19". Once the backlog reaches 20 it will change the status to trouble. However this does not work as intended. Instead I simply get an immediate trouble alert which reads:

The String ":[0-1][0-9]?$|:[2-9]$" is not present in the response

I've tried quoting the expression also with no luck. Are regular expressions accepted in the port monitor keyword check? If not is there another way to achieve this objective?
Like (1) Reply
Replies (3)

Re: Regular Expression in Port Monitor

Hello,

Thanks for raising this request. We will extend the capability to support regular expression in content check for port monitor, which does not exist currently.  

An additional question, what protocol you use to retrieve backlog length ?  Is there any specific protocol or you use just a command over TCP, which your server understands and respond ?


Like (0) Reply

Re: Regular Expression in Port Monitor

Hi Raghavan - the thing I am monitoring is resque which is a queue system back-ended by redis. So to monitor the queue length I am connecting via telnet and issuing the following command: 

LLEN "resque:queue:AMD\\Jobs\\SendEmail"

Which returns the number of items in the SendEmail queue. The response is a CRLF terminated string representing an integer, prefixed by a ":" byte. For example :0\r\n, or :1000\r\n. More about the redis protocol can be read here.
Like (0) Reply

Re: Re: Regular Expression in Port Monitor

Hi Darryl,

Thanks for providing the details over this. We will support RegEx support for content matching in our Port Monitor soon. We will keep you updated regarding this.


Like (0) Reply

Was this post helpful?