Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Apache failed and Monit did not restart it as expected. The error in monit's log is:

Error opening Monit id file '/root/.monit.id' for writing-Cannot allocate memory

The problem is that Apache went down due to a lack of memory so... is there simply nothing to be done in such a case? The lack of memory killed both the process and the thing monitoring that process.

Anyone know of any strategies for working with such a situation in Monit?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I usually change the default Monit ID file location to something like: /var/monit/id

Depending on the version and distribution of your Monit package, the default ID file location can vary. In the current RPMForge package of Monit 5.4, I'm seeing:

set idfile /var/monit/id

That may help in this case. Some people also try to play tricks to keep Monit running (like spawning from inittab), but I really haven't felt the need to do this. Using a more sane ID file location usually resolves my issues.

share|improve this answer
    
Thanks. I've tried this (moving that file to a dir in /var). We'll see if it helps. –  Lothar_Grimpsenbacher Aug 1 '12 at 0:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.