I have a server (Java) that is running on UNIX.
I’m trying to develop some application that will “sense” if the state of the server has been changed and notify me by mail.
I want to know how can I do it? If there is some event or other way to sense the change, (by the way, sending the eMail is not the problem).
I was thinking on Java code that will run in an infinite loop and will check if the process is running, but it seems to me a bad way.
Any idea will be accepted.
Thank you.
you can set a timer event on a java program (either using cron or quartz)
in the program you can check to see if a particular process is running..
you can use
ps -e | grep javaor you can get the java program to sendout jmx messages which can be used track the status of the app (again this depends if you can change the app on the server).