0

I'm using this sensu plugin https://github.com/sensu-plugins/sensu-plugins-process-checks/blob/master/bin/check-cmd.rb

to run

sudo lsof | grep couchbase | grep ESTABLISHED | wc -l

I'm trying to come up with a regex for the output. I want it to alert if the value is over 30,000 connections.

What would be the regex I can use?

Devon
  • 307
  • 3
  • 13
  • 1
    That's not what regex is for, just [compare the two numbers](https://stackoverflow.com/questions/18668556/comparing-numbers-in-bash). – user229044 Oct 16 '18 at 20:34
  • Thank you.. decided to create a bash script instead.. agreed on use of regex – Devon Oct 16 '18 at 22:06

1 Answers1

1

> 30000 = 3\d{3}[1-9]|[4-9]\d{4}|[1-9]\d{5,17}|[1-8]\d{18}|9\d{18,}

Add boundary conditions where needed.