0

I have the following configuration in Monit:

check program raid-md127 with path "/sbin/mdadm --misc --test /dev/md127"
    if status != 0 then alert

When restart monit, I get the following error:

root@NAS2:/etc/apt/sources.list.d# /etc/init.d/monit restart
Stopping daemon monitor: monit.
Starting daemon monitor: Syntax error:
/etc/monit/monitrc:29: Error: syntax error 'raid-md127'

Can you advice, please?

Eddie C.
  • 487
  • 1
  • 3
  • 12
  • The syntax seems correct. What is the monit version ? Could it be an error from a previous line ? Did you tried without the dash ? I have checks with dash running fine on my side – DevOps Jan 17 '17 at 18:07
  • `root@NAS2:/home/murugan# monit -V This is Monit version 5.4 Copyright (C) 2001-2012 Tildeslash Ltd. All Rights Reserved.` – Murugan Chandrasekar Jan 18 '17 at 06:42
  • `root@NAS2:/home/murugan# /etc/init.d/monit restart Stopping daemon monitor: monit. Starting daemon monitor: monit/etc/monit/monitrc:323: Warning: Program does not exist: '"/sbin/mdadm misc test /dev/md127"' . Warning: Please, set start delay for monit in config file and delete /etc/monit/monit_delay file. root@NAS2:/home/murugan#` – Murugan Chandrasekar Jan 18 '17 at 06:45
  • Monit 5.4, this is very old. Could you consider upgrading to a newer version ? Maybe this is a bug. However, warning error at restart is different: it complained about not being able to run the program and all the dash seem to have disappeared (if not removed by serverfault). So it is probably a bug at monit level. – DevOps Jan 18 '17 at 16:56

1 Answers1

3

The functionality to use parameters in the command was first introduced in Monit 5.7; https://mmonit.com/monit/changes/

You need to upgrade to a newer version of Monit.