0
I am trying to set up monit
to turn off my virtual machine when my program is done. (The program runs as a daemon, takes long time which I do not know in advance, and my machine is expensive so I want to save money.)
I have created the following .monitrc
in my home directory:
set daemon 60
set logfile /run/monit.log
set httpd unixsocket /run/monit.socket
allow baruch:monit
check process python3 matching python3
start program = "sudo systemctl poweroff"
I have created the log file and the socket file and made them writable.
Still monit monitor all
the gives two errors:
/home/baruch/.monitrc:6: Program does not exist: 'sudo'
Unix socket /run/monit.socket connection error -- Connection refused
Any help will be appreciated.