What sensor should I use to monitor a tomcat app and a blocked or when I return a specific error, you can restart the webapp.
there is no native sensor to monitor tomcat apps. When you are using the server status plug in you might use the Apache Server Status sensors (Totals or PerfStats) to monitor the overall status. Evertyhing else would have to be done via custom script and the SSH Script Sensors (normal or advanced).
Hi, Currently I have set the sensor httptransactionsensor to detect a GET of the page to see if this up or down. Can not restart if it detects this? you have examples of scripts? Best regards
You would be able to create a notification that can either perform an HTTP action through a notification that can be triggered by an state change for that sensor.
For rebooting that server, it would depend on what kind of OS the tomcat is running on. You could write a batch to restart the service or something like that but it's hard to say without knowing more details about the Tomcat server.
Hi, This is a Tomcat on Windows.
The notification email reaches me that the service is down, but as I can run a cmd when you get that notification to restart Tomcat?
Yes, you can set up multiple notifications for when a sensor goes down and for a service like that, you could set up a notification to run small batch script that would restart that service when the GET command was successful or not.
The batch file would include something like
See the section about executing a program towards the bottom of this article
I've checked the notification section, worst not how or where to set the execution of a CMD
In the Notifications section of the software under the Setup tab, you can create or change the notifications that are set up in your system. Within the page where you can set up or edit a notification, at the bottom there is a checkbox that says Execute Program. If you click that checkbox you will be able to select which program you want to run. There you can choose from *.exe, *.bat, *.cmd, *.com or *.ps1 files located in the Notifications/exe subfolder of your PRTG installation.
But I have to create a notification for each program you want to run on a sensor?
Yes, a notification can only run one program although it may be possible to program a batch script to run multiple programs or do multiple things with one notification.