1

My systems are running monit 5.19. When I start Monit, I see the error syntax error 'status'

Status appears to be supported since 5.8 so I'm not sure what the issue is.

It is being caused by the following directive.

check host nlb  with address   host
if failed
  port 443
  protocol HTTPS
  request "/healthcheck"
  ssl options {verify: disable}
  timeout 15 seconds
  status = 200
then restart
bearrito
  • 381
  • 3
  • 16
  • I don't really know Monit, but might it be `status 200`? All the other lines don't have the `=`. Edit: Meh, that's likely not it according to https://mmonit.com/monit/documentation/monit.html#HTTP. Confusing syntax. – Sven Oct 07 '16 at 13:05

1 Answers1

2

The status clause is part of the proto http statement so needs to come before the ssl line (which isn't part of proto http). See the definition of proto http at https://mmonit.com/monit/documentation/monit.html#HTTP ...

 PROTO(COL) HTTP
     [USERNAME "string"]
     [PASSWORD "string"]
     [REQUEST "string"]
     [STATUS operator number]
     [CHECKSUM checksum]
     [HTTP HEADERS list of headers]
     [CONTENT < "=" | "!=" > STRING]

Version of file that doesn't give error is

check host nlb  with address   host
if failed
  port 443
  protocol HTTPS
  request "/healthcheck"
  status = 200
  ssl options {verify: disable}
  timeout 15 seconds
then restart
Paul Haldane
  • 4,457
  • 1
  • 20
  • 31