Hi all folks, a question of understanding. One of my applications hangs sometimes after the start. But the only hint that something is going wrong, the application does not continue to start, is the last message in the application log on the one hand. It's always the same message, I think. And on the other, that no additional messages are written to the log.
Unfortunately, if everything works well, all the messages are written to the log and some more messages also. And it is normal behaviour that the application stop writing messages to the log after the start, for a short time, sometimes. My question, any suggestion how to check a message is the last one in the log for a given time. In my understanding, monit doesn't check a message already checked again, monit knows the last line in the log already checked. A suggestion, any plan to set the service status based on messages. Today I use the port to check the application is up and running or restart the application if the port is not available. I use something like this. if failed host TheHostName port 5001 protocol http for 10 cycles then alert if failed host TheHostName port 8080 protocol http for 20 cycles then restart Some of my application doesn't open a socket, I can't check a port also. But the log contain messages like "manager initialized" or "manager started". Today I use commands to restart applications or disable the monitoring for applications based on messages are written to the application log or send mails. I use something like this. if match ".*Too many open files.*" then exec "/etc/monit/scripts/em.sh restart" if match ".*An attempt is made to stop the.*" then exec "/etc/monit/scripts/serv.sh unmonitor server1" if match "Press 'Enter' to acknowledge...." then alert But I don't know a command to set the service status. "monitor" or "unmonitor" enable/disable the monitoring only. With regards, Lutz -- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
