Running 'monit restart all' gives invalid action
Asked Answered
L

2

5

error: invalid action action= restart monit


Server Info

Ubuntu 16.04.4 LTS monit: Installed: 1:5.16-2ubuntu0.1

Livvyy answered 14/8, 2018 at 13:7 Comment(0)
L
10

This issue is for these monit commands

$ monit restart tomcat
$ monit stop tomcat
$ monit start tomcat
$ monit monitor tomcat
$ monit unmonitor tomcat

Reason:

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in monit (Ubuntu): status: New → Confirmed

for the time being, you need to revert the monit package to 1:5.16-2, try manually in a server with

sudo apt-get install monit=1:5.16-2

If your servers are automatically provisioned with some third party tool (chef, puppet, bash scripts, etc) then you would need to update them accordingly.

Source: https://bugs.launchpad.net/ubuntu/+source/monit/+bug/1786910

NOTE

In case you're facing this issue again even after downgrading Monit version, please blacklist it from unattended-upgrades service. It runs daily to fetch latest security updates for relative packages.

To blacklist monit, open "/etc/apt/apt.conf.d/50unattended-upgrades" and under "Unattended-Upgrade::Package-Blacklist" block, add "monit".

@TomDavies suggested a better solution than blacklisting, see the comments.

Do remember it to remove from blacklist once the issue is solved. You would need to run the above command again to revert back to older patch.

Livvyy answered 14/8, 2018 at 13:7 Comment(3)
My monit update automatically after hours doing that, how can stop this?Wreath
Yes, that happened to me too, I have updated the answerLivvyy
Thanks this worked great. I ended up using sudo apt-mark hold monit to freeze the monit version for now and then I'll use sudo apt-mark unhold monit to unfreeze when this is resolved.Predilection
B
0

This is an extension to answer given by Ninad.

If you are using Chef to automatically configure your servers, then the following code change will help you install the previous version of monit in all your servers running Ubuntu 16.04

if 'ubuntu' == node['platform'] && '16.04' == node['platform_version']
  Chef::Log.info "******** Installing monit version '1:5.16-2' ********"
  execute 'apt-get -y install monit=1:5.16-2 --allow-downgrades'
else
  Chef::Log.info "******** Installing latest monit ********"
  package 'monit'
end

Make sure to revert this once the bug is fixed.

Belting answered 6/9, 2018 at 12:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.