ThingWorx Monitoring Setup - JMX Exporter and MBeans Attributes (Tomcat and C3P0) [3/5]

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024

ความคิดเห็น • 4

  • @yati8522
    @yati8522 2 ปีที่แล้ว

    how do you run it ? with this configuration file only? I couldn't integrate it into my tomcat. How can I trigger jmx exporter with tomcat start script? I tried to add java -javaagent jmx_exporter.... inside my startup.bat but it didnt work. How does tomcat knows to export the apps metrics?

    • @IAMGregEVA
      @IAMGregEVA  2 ปีที่แล้ว

      There are some good articles explaining this... cloudsbaba.com/how-to-use-prometheus-to-monitoring-java-application/
      The Java agent configuration needs to refer to the path of the JMX exporter executable, the port which it will listen on, and the configuration file. Something like this:
      JAVA_OPTS="$JAVA_OPTS -javaagent:/jmx_exporter/jmx_prometheus_javaagent-0.13.0.jar=19080:/jmx_exporter/tomcat.yaml"

    • @yati8522
      @yati8522 2 ปีที่แล้ว

      @@IAMGregEVA Thanks for reply, but I tried this one. Just corrected directories and copied it to setenv.bat, it didn't work. Do I have to configure CATALINA_OPTS variable also, and how? I think I am so dumb :(

    • @IAMGregEVA
      @IAMGregEVA  2 ปีที่แล้ว

      @@yati8522 I too struggled a lot with this sort of detail (and typically do). You're not dumb... it's part of I.T. ;-). It is possible that your setenv.bat isn't the authoritative place that you need to be setting that as it requires that bat to be run each time to hold context. Try instead to set it in a SYSTEM Environment Variable.