restart a service by SSH.
Posted: Thu Aug 30, 2012 8:47 am
ok, had a nice long thread which sadly never got working where I had a java server run out of RAM, can trip a memory alert, but using NRPE just can't kill and restart the service. Had some great help ideas, but just never got it to kill/restart.
So, still having the java issues, I am wondering can I kick a local process off, well I'm sure I can, but wondering what/how. I can setup some SSH key's, setup some port forwarding on my load balancer, so when a critical hit via the check_nrpe!check_mem, simply say run /usr/lib/nagios/plugins/restartremoteservice.sh
That would be a local bash script that would ssh in (use key's so no password) kill the java pid and restart the app!
Thanks to everyone who tried restart version 1, so now gonna try restart version 2
So, still having the java issues, I am wondering can I kick a local process off, well I'm sure I can, but wondering what/how. I can setup some SSH key's, setup some port forwarding on my load balancer, so when a critical hit via the check_nrpe!check_mem, simply say run /usr/lib/nagios/plugins/restartremoteservice.sh
That would be a local bash script that would ssh in (use key's so no password) kill the java pid and restart the app!
Thanks to everyone who tried restart version 1, so now gonna try restart version 2