Dear Martin,
Yes I agree I messed it up due too many confusions. So I
should pick either 2 or 3. What do you recommend for monit as I read upstart is
something new is it better then inittab? I am doing some research on upstart
too. Thank you for the clarification.
In addition I have tried the suggestion in this link
http://mmonit.com/wiki/Monit/FAQ#init. I did accordingly added the lines in
innitab file. There was no this folder /usr/local/sbin/monit. So I added it
manually. But I dont see why monit does not start? What could be my problem?
Regards,
Shai.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Wed, 16 May 2012 08:37:44 +0200
To: [email protected]
Shai,
the whole problem is very simple, you just need to see the things in context
and understand the relationships:
1.) if monit is configured just with the SysV init scripts (/etc/init.d/monit)
and no Upstart, then if monit will stop nothing will try to restart it. The
"monit quit" can be used, as there is no supervisor which needs to be notified.
2.) or if monit is configured with inittab - init will always respawn it on
monit stop and there is no way to stop monit (other then unconfiguring it from
inittab)
3.) or if monit is configured with Upstart, monit start/stop needs to be
performed via Upstart only. If monit will die or will be stopped via "monit
quit" (outside of upstart control), then Upstart will restart it.
You should go only with one of these methods - not combine them.
If you think you configured monit with Upstart AND Upstart doesn't start monit
when you stop it with "monit quit" or simply kill monit, then you have problem
in your Upstart configuration - go troubleshoot your Upstart settings (see
Upstart documentation for how to do it). The Upstart configuration for monit
which is on the wiki page works => you have some problem with Upstart in
general or messed the init/inittab/upstart configurations.
In real life monit doesn't stop unless instructed - the spurious stop could be
caused by crash (due to some bug). The monit can be stopped only by the person
who has privilege to do it (the user under which monit is running).
Regards,Martin
On May 16, 2012, at 8:21 AM, sukbir singh wrote:Dear Martin,
Ok let me explain how I start. I normally start either with
/etc/init.d/monit start or service monit start. So I guess this way to start is
correct right. The problem now is that when I do monit quit it does not restart
it? So what could be missing here then? So is wrong to use monit quit is it?
What if some one go use monit quit then it will not re-start again is it? So in
real life scenario what could stop or kill the monit? Will those possible will
be re-start with upstart? Thank you.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Wed, 16 May 2012 08:13:50 +0200
To: [email protected]
Hi Shai,
if you configure monit with Upstart and you want to stop monit, you have to do:
stop monit
If you stop monit with "monit quit", Upstart will see that the monitored
process (monit) stopped and will restart it. To stop it you need to notify the
daemon which manages the process (in this case Upstart) that you want to stop
it. The management of services configured in monit is the same - if you stop it
without letting monit know ("monit stop <service>") then monit will think the
process is broken and will restart it.
That is: if you start monit either via init, Upstart or some other process
monitoring tool, you can no longer use "monit quit".
Regards,Martin
On May 16, 2012, at 6:29 AM, sukbir singh wrote:Dear Martin, I
have configured the upstart but still not working on centos 6.2. How I kill
monit is just by typing monit quit? Is the right way to killed it or any other
way I should try for it to re-spawn?
Regards,Shai.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Mon, 14 May 2012 14:35:31 +0200
To: [email protected]
If you register monit with init, you cannot stop it (unless you unregister it
from init and reload init configuration), as init will respawn monit on stop.
The mentioned Upstart will allow you to start/stop monit on will with respawn
in the case that it stops outside of Upstart control.
Regards,Martin
On May 14, 2012, at 11:57 AM, sukbir singh wrote:Dear Martin,
Sorry for some of the confirmation. Here is a valid one I need to get your view
I was testing monit quit. Then I tried monit validate is still working. Then I
run this service monit status monit dead but subsys locked. Why even after quit
the service is still running? I google it they ask to delete the file from
/var/monit folder. I did that too. So then I followed this link
http://mmonit.com/monit/documentation/monit.html#init_support . I added this at
the end of the file /etc/innitab # Run Monit in standard run-levels
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc. Then I telinit q and
kill -1 1. So then only I start my monit is that correct? So when I call monit
quit it do quit I think that it should not be quiting right?
Regards,Shai.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Mon, 14 May 2012 10:24:21 +0200
To: [email protected]
Sukbir,
you can start monit via init to make it respawn if it will
die:http://mmonit.com/monit/documentation/monit.html#init_support
On RHEL you can also use Upstart:http://mmonit.com/wiki/Monit/Upstart
To start monit you can either call "/etc/init.d/monit start" or just "monit" in
the command line.
PLEASE: read the basics of linux administration - every utility (rpm,
chkconfig, monit) has manual page, that should be your first place where to
look for the informations. Spamming the mailing list with very basic
monit-unrelated questions and asking for confirmations of every simple step is
not good. Read the rpm manual page (you'll learn how to verify the rpm content
+ locate the rpm package to which the file belongs), chkconfig manual page
(you'll learn how to register services and verify which are allowed to run),
etc.
There are many articles which describe initial monit setup, for example
this:http://wiki.niwos.com/linux/applications/monit
Monit manual:http://www.mmonit.com/monit/documentation/monit.html
Regards,Martin
On May 14, 2012, at 10:10 AM, sukbir singh wrote:Dear Martin,
Yes there is a file /etc/init.d/monit. So that is the installation file right?
So if I need to start after the quit is "monit start" right? How to now make
sure that monit itself does not go down in any case ? Is there any mechanism to
ensure that safety itself? Thank you.
Regards,Shai.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Mon, 14 May 2012 09:35:30 +0200
To: [email protected]
You can build the rpm directly from monit source code distribution (this rpm
installs the /etc/monitrc properly):
rpmbuild -tb monit-5.4.tar.gz
Regarding the chkconfig - yes, your output confirms that monit is set to run in
runlevels 3, 4, 5 (default runlevel is usually 3 or 5, you can verify your
default runlevel in /etc/inittab).
Monit stop: i suppose the rpm installed monit init script (/etc/init.d/monit)
=> you can stop monit with "/etc/init.d/monit stop" or via monit CLI: "monit
quit".
Regards,Martin
On May 14, 2012, at 4:04 AM, sukbir singh wrote:Dear Martin,
Yes mine is from 3rd party. So where is the right place to pick the right
version of monit for centos 6.2? I run chkconfig monit 0:off 1:off
2:on 3:on 4:on 5:on 6:off. So is this fine? What is the command to
stop monit I tried monit stop it does not work either? I dont get you how to
create the link for the configuration file? Thank you.
Regards,Shai.
From: [email protected]
Subject: Re: Problem starting my monit
Date: Sun, 13 May 2012 21:28:04 +0200
To: [email protected]
If monit was installed via 3rd party package, it's up to the vendor of the
package where they install the configuration file, etc. Per your description it
seems that the install the configuration file as /etc/monit.conf, but because
your monit binary wasn't able to find it and was looking for default monitrc,
it seems that they didn't modify the configuration path search. Maybe their
init script uses the "-c /etc/monit.conf" option to set the configuration file
path. You can verify whether monit is registered to start on boot with
"chkconfig" utility. You can keep the rpm package - i'd just suggest to create
link for the configuration file (/etc/monit.conf -> /etc/monitrc)
Regards,Martin
On May 13, 2012, at 2:37 PM, sukbir singh wrote:Dear Martin,
Actually I took this monit-5.2-1.el6.rf.x86_64.rpm file from this link
http://pkgs.repoforge.org/monit/ and run command rpm -ivh
monit-5.2-1.el6.rf.x86_64.rpm for my centos 6.2. So I tried to find monitrc and
there is no such file in my system only /etc/monit.conf. So is it ok for me to
change the monit.conf to monitrc?After changing and creating the /var/monit. I
did this now looks ok.
/etc/init.d/monit startStarting monit: monit: generated unique Monit id
be30cd9f43337901d0f4a48f3ac33712 and stored to '/var/monit/id'Starting monit
daemon with http interface at [localhost:2812]
[ OK ]Is this the right way to run monit or
someother way? What is it init.d is already a registered service? Just to test
monit I have down the service which monit is suppose to monitor but there is no
alert sent so where to look out next? Thank you
From: [email protected]
Subject: Re: Problem starting my monit
Date: Sun, 13 May 2012 14:06:52 +0200
To: [email protected]
Hi,
the default monit configuration file name is "monitrc", not "monit.conf" (that
is used by some 3rd party packages which modify the source code to find the
monit.conf instead of monitrc).
The idfile error is repotted most probably because your configuration file
contains "set idfile /var/monit/id" statement, but the directory "/var/monit/"
most probably doesnt exist => the unique id cannot be saved to the given
location. The id is used when Monit is configured with M/Monit to pair the host
entry in M/Monit with messages from Monit (pairing by source IP address won't
be reliable, as the monit agents can be behind firewall with IP masquerading,
so all the agents would update one host entry and you'll sporadically see
services of different hosts under the same entry, hence the concept of
per-instance ID).
To fix the idfile error:
mkdir /var/monit
+ set the permissions on that directory to allow the user under which monit is
running to write to this directory.
Regards,Martin
On May 13, 2012, at 6:54 AM, sukbir singh wrote:Dear All,I have this file
monit.conf in my /etc so I set my mail server and set the receiver.1. I set the
mail server2. set alert ***** 3. I un-comment the the message formatQuote:set
mail-format {
from: monit@$HOST
subject: monit alert -- $EVENT $SERVICE
message: $EVENT Service $SERVICE
Date: $DATE
Action: $ACTION
Host: $HOST
Description: $DESCRIPTION
Your faithful employee,
Monit
}Lastly I added this line to check my java process which is ran as a daemon
using yajsw.
Quote:check process commServer with pidfile /var/run/wrapper.commServer8000.pid
# check your app pid
if failed port 8000 protocol HTTP
then alertSo thereafter I ran this command Quote:/etc/init.d/monit start
Starting monit: monit: Cannot find the control file at ~/.monitrc,
/etc/monitrc, /etc/monitrc, /usr/local/etc/monitrc or at ./monitrc
[FAILED]The I change the monit.conf to monitrcQuote:/etc/init.d/monit start
Starting monit: monit: Error opening the idfile '/var/monit/id' -- No such file
or directory
Starting monit daemon with http interface at [localhost:2812]
[ OK ]Then lastly I run this to check if monit running but nothing either too.
So where could be my mistake?Quote:/etc/init.d/monit start
Starting monit: monit: Error opening the idfile '/var/monit/id' -- No such file
or directory
Starting monit daemon with http interface at [localhost:2812]
[ OK ]--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general