Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
Karaf is deployed on my server, and I can check karaf-service status using the command : service karaf-service status
However, I would like to know if there is a way to get a notification if this service stops, in case of an error ? I thought about a job run every 5 minutes for instance, which executes service karaf-service status command, parses the result, and sends an e-mail alert if the service is not running.
However, I wonder if there is another way.
Beyond this, I would like to know if there is a way to get an alert if a bundle (for an API) stops (so the cxf-endpoint is not started anymore) ?
Thank you
You could do this with a Talend job, but that might be a bit heavy duty for this. If you are good at scripting, you could have a script running using the crontab or scheduler (for Windows) to call the Karaf via the command line, query the status of bundles, parse the results and report back as you wish. Obviously, depending on the detail you want it may be easier to build using a Job ..... or maybe a Service that you can call.
You could do this with a Talend job, but that might be a bit heavy duty for this. If you are good at scripting, you could have a script running using the crontab or scheduler (for Windows) to call the Karaf via the command line, query the status of bundles, parse the results and report back as you wish. Obviously, depending on the detail you want it may be easier to build using a Job ..... or maybe a Service that you can call.
Hello rhall,
thank you for your answer. Very nice idea.
All my deployed bundle contain _talend_ in their name, so my bundle:list command is : bundle:list | grep _talend_
This way, I can parse the answer string with | delimiter or \n and alert if the line doesn't contain Active for instance.
The principle is the same with the command service karaf-service status.
I thought that a built-in mechanism was available but this checking can be implemented via a job 🙂
If karaf-service status is not running, or any bundle is not Active, I'll receive an e-mail, executing every 5 minutes is good I think.
Thank you again for your idea and confirmation rhall 🙂