I have a custom service that I want to monitor with monit. When the process fails I want to copy the log to a shared file system and restart the service. Something like the following but I am not not sure what. Any hints would be appreciated.
I installed a program called nss-pam-ldapd.x86_64 which installs a service called
nslcd. 'nslcd' will not start after a reboot.
When I do chkconfig --list nslcd, I get:
nslcd 0:off 1:off 2:on 3:off 4:off 5:off 6:off
As you can see, it's set to start at runlevel 2.
I wrote a php daemon using system daemon pear class.
How do I use monit to restart it when it fails?
I have the following code in my monit config file:
check process merge with pidfile /var/www/merge/merge.pid
group 1000
start program = "/etc/init.d/merge start"
stop program = "/etc/init.d/merge stop"
if failed host IPADDRESS port 80
then restart
if 5 restarts within 5 cycles then timeout
whe
So, I've installed ldap+samba on my test server and getting spammed into logs file:
Code:
==> daemon.log <==
Oct 10 10:20:13 arhat nslcd[2646]: [227194] ldap_result() failed: No such object
==> syslog <==
Oct 10 10:20:13 arhat nslcd[2646]: [797576] ldap_result() failed: No such object
==> daemon.log <==
Oct 10 10:20:13 arhat nslcd[2646]: [797576] ldap_result() failed: No s
Running Monit 5.2.5 on Fedora 15
All standard alerts are working, however just cannot get exec to run anything.
I have tried more than ten different configurations based on examples from the Monit Wiki. None of the exec commands do anything.
How do I check if a web page contains the text "Error connecting to database" and if the text exists in the page restart the database?
Here's what I have so far but it isn't working:
check host website.com with address website.com
group database
start program = "/usr/bin/service mysql start"
stop program = "/usr/bin/service mysql stop"
if url http://website.com content == "Error conn
We have socket listener which listens on port 9000 so below is how we wrote the alert for monit. The listener runs via yajsw daemon tool. So currently when it fails on port 9000 we get an email. What we want to extend is that if it is not running to stop,uninstall, install and finally start programe. We have all the script to the processes stated but how to put in monit?
I have a Java GWT application running on Tomcat7 (as the tomcat7 user).
I need to add some functionality that allows me to call an executable program (monit it this case) to start/stop a particular daemon. Monit itself is running as root, and must remain as running as root.
My plan was to do the following:
1. User attempts to stop a service
2.
I want only user "theuser" to login to this host.
I have tried the following in nslcd.conf:
pam_authz_search (&(objectClass=posixAccount)(IsActive=TRUE)(uid=theuser))
but all can login. If instead of pam_authz_search I use the "filter" command, it works, but getent returns only one user, the "theuser".