I'm trying to work out why my Monit (https://mmonit.com/monit/) doesn't want to seem to monitor my Solr service. I have it all working for the rest of the services:
But for some reason Solr doesn't want to properly monitor.
I followed the example here:
https://www.webfoobar.com/node/61
For my server I tweaked it a little so the services were correct, and also some of the paths:
## Solr monitoring.
## Test the solr service.
check process solr with pidfile /var/solr/solr-8983.pid
group solr
start program = "/etc/init.d/solr start"
stop program = "/etc/init.d/solr stop"
restart program = "/etc/init.d/solr restart"
if failed port 8983 then restart
if 3 restarts within 5 cycles then timeout
depends on solr_bin
depends on solr_init
## Test the process binary.
check file solr_bin with path /opt/solr/bin/solr
group root
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
## Test the init scripts.
check file solr_init with path /etc/init.d/solr
group root
if failed checksum then unmonitor
if failed permission 744 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
Checking the Syntax it all looks ok:
monit -t
/etc/monit/monitrc:295: Include failed -- Success '/etc/monit/conf.d/*'
Control file syntax OK
Any other suggestions as to what I can try?
UPDATE: I really don't understand why this isn't working. All the permissions and files seem to exist, and are set correctly:
root@admin:/etc/init.d# ls -l /var/solr/solr-8983.pid
-rw-rw-r-- 1 solr solr 6 Jul 28 05:41 /var/solr/solr-8983.pid
root@admin:/etc/init.d# ls -l /etc/init.d | grep solr
-rwxr--r-- 1 root root 2711 Jul 25 13:25 solr
root@admin:/etc/init.d# ls -l /opt/solr/bin/ | grep solr
-rwxr-xr-x 1 root root 12694 May 29 22:36 install_solr_service.sh
-rwxr-xr-x 1 root root 1255 Mar 9 20:00 oom_solr.sh
-rwxr-xr-x 1 root root 72389 May 30 00:25 solr
-rwxr-xr-x 1 root root 66010 May 30 00:25 solr.cmd
-rwxr-xr-x 1 root root 6204 May 30 00:25 solr.in.cmd.orig
-rwxr-xr-x 1 root root 6950 May 30 00:25 solr.in.sh.orig
UPDATE 2: When restarting Monit, I get this in monit.log:
[UTC Jul 28 10:22:45] info : Shutting down Monit HTTP server
[UTC Jul 28 10:22:45] info : Monit HTTP server stopped
[UTC Jul 28 10:22:45] info : Monit daemon with pid [26662] stopped
[UTC Jul 28 10:22:45] info : 'admin.steampunkjunkies.com' Monit 5.16 stopped
[UTC Jul 28 10:22:45] info : Starting Monit 5.16 daemon with http interface at [213.219.38.44]:2812
[UTC Jul 28 10:22:45] info : Starting Monit HTTP server at [213.219.38.44]:2812
[UTC Jul 28 10:22:45] info : Monit HTTP server started
[UTC Jul 28 10:22:45] info : 'admin.steampunkjunkies.com' Monit 5.16 started