0

I am using a linux tool called Monit that I am trying to monitor a PHP daemon script.

I do not know how to issue the command correctly.

Please provide me with some sample command for those who are experienced with monit.

I use command like these.

$admin: sudo monit script.php

$admin: sudo monit ./script.php

but it keep saying its not a service

Please help me on this. I normally would run the PHP daemon like this with the command

$admin: sudo ./script.php

and it would run. Now I want to use monit to monitor it. but my command I use above does not work. Please help.

1 Answers1

0

The problem is that the system is not able to locate the monit service. Do a whereis monit or a locate monit first in order to find its location. If monit has been recently installed in your system, you might need to do an updatedb in order for locate command to find it.

Once the location is found, change to that directory then try doing a sudo monit full/path/to/script.php

raidenace
  • 12,789
  • 1
  • 32
  • 35
  • I get this notice after issuing the command.. monit: The control file '/etc/monit/monitrc' must be owned by you. – user1623638 Aug 30 '12 at 17:54
  • then i get this as well monit: invalid argument -- ./daemon1.php (-h will show valid arguments) – user1623638 Aug 30 '12 at 18:03
  • Looks like your apache user does not have access to the resource file for monit. You might need to change the owner/group for monitrc so that apache user can execute it – raidenace Aug 30 '12 at 18:42
  • could you paste your monit config files (usually stored in /etc/monit.d) – Raphaël Jan 21 '13 at 07:45