monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem starting my monit


From: sukbir singh
Subject: RE: Problem starting my monit
Date: Mon, 14 May 2012 10:07:04 +0800

Dear Derek,
                So I guess mine is from 3rd party. Where should be right place to pick the monit rpm next time? For now I was suggested by another user to just build a link  /etc/monit.conf -> /etc/monitrc which I am not too sure? Thank you.

Regards,
Shai.


From: address@hidden
Subject: Re: Problem starting my monit
Date: Sun, 13 May 2012 14:10:23 -0700
To: address@hidden

Sukbir,
I seem to recall that the 5.2 and 5.3 rpm's on repoforge pre 5.3.2-3 have some issues with the monit configuration file and creating the /var/monit directory. One of the versions would also erase your monit.conf files and reset it to defaults. The issues were fixed in monit-5.3.2-3.

However, I can understand if you are unable to update your monit agents to 5.3.2. To use the fixes that were applied in the -3 release of monit without updating your monit version you can grab the spec file on rpmforge from either the src rpm (monit-5.3.2-3.rf.src.rpm) or the github account (https://github.com/repoforge/rpms/blob/master/specs/monit/monit.spec). Once you have the patched spec file from the new version you can then just rebuild the rpm for monit-5.2 using the monit sources of 5.2. If you need help building an rpm fedora has a good article on the subject (http://fedoraproject.org/wiki/How_to_create_an_RPM_package#Building_the_binary_package).

When using the updated rpm spec file for monit-5.3.2-3 the config file will be /etc/monit.conf, the includes directory will be /etc/monit.d, and the init script will be /etc/init.d/monit. They are using those naming conventions for the conf, includes, and init files to adhere to the standards of RHEL, CentOS, and Scientific Linux.

--
Derek

On May 13, 2012, at 12:28 PM, Martin Pala wrote:

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 start
Starting 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: address@hidden
Subject: Re: Problem starting my monit
Date: Sun, 13 May 2012 14:06:52 +0200
To: address@hidden

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 server
2. set alert ***** 
3. I un-comment the the message format
Quote:
set mail-format {
from: address@hidden
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 alert
So 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 monitrc

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 ]
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]