0

I have the following in /etc/monit/monitrc on line 130-131:

check file ip-172-31-37-63:1.log with path /home/ubuntu/.vnc
  if match "Connections\: accepted" then exec /home/ubuntu/alerts/slack.rb

It fails on monit initialization with the following error:

ubuntu@ip-172-31-37-63:~$ sudo service monit restart
 * Restarting daemon monitor monit                                                       /etc/monit/monitrc:130: Error: syntax error ':'
                                                                                  [fail]

I cannot escape the : in the filename no matter what I try. That colon needs to be in the filename, because it's part of the log filename, and not configurable as far as I know.

1 Answers1

0

The filename is ip-172-31-37-63:1.log, and I had the configuration incorrectly.

It ought to be:

check file vnc-connections-log with path "/home/ubuntu/.vnc/ip-172-31-37-63:1.log"
  if match "Connections\: accepted" then exec /home/ubuntu/alerts/slack.rb

Essentially, the thing that goes after check file is a sort of alias for the filename that follows with path.