当前位置:网站首页>Manuel incomplet, comment tracer manuellement l'information de surveillance de tongweb?
Manuel incomplet, comment tracer manuellement l'information de surveillance de tongweb?
2022-07-19 14:19:00 【Chou navet.】
Préface
TongWebFournir plusieurs types d'interfaces de surveillance,Comment obtenir des informations via ces interfaces? Nous passonsTongWeb7.0.4.2Comment obtenir la version sous explication.Note::Une autre version n'aurait pas nécessairement raison.
Un.、AdoptionJMXAcquisition d'interfaceMbeanInformation
TongWebDeJMXPar défaut,Adoptionserver.logAccèsJMX url,À plus.:https://blog.csdn.net/realwangpu/article/details/109506744
[INFO] [main] [systemout] [tuserport:0;jcport:0]
[INFO] [main] [admin] [URL for the Standard JMXConnectorServer : (service:jmx:rmi:///jndi/rmi://192.168.163.1:7200/jmxrmi)]
[INFO] [main] [core] [Starting service TONGWEB]
[INFO] [main] [core] [Starting Servlet Engine: TongWeb]
CompilationJMXProcédure, Les principales informations disponibles sont: :JVMMémoire、Pool de Threads、Pool de connexion des sources de données、ApplicationsessionNombre、 Nombre de demandes d'application, etc. ,demoComme suit:
package com.tong;
import java.util.HashMap;
import java.util.Map;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
public class TestJMX {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
// CréationJMX DeURL
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://127.0.0.1:7200/jmxrmi");
// Construire pour obtenir les informations d'authentification utilisées par la connexion , Utilisateurs utilisant un domaine sécurisé .
Map env = new HashMap();
env.put("jmx.remote.credentials", new String[] { "thanos", "thanos123.com" });
JMXConnector connector = JMXConnectorFactory.connect(url, env);
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
//DésignationObjectName
ObjectName mbeanName = new ObjectName("TONGWEB:type=ThreadPool,name=\"http-nio2-0.0.0.0-8088\"");
Object obj = mbsc.getAttribute(mbeanName, "maxThreads");
System.out.println("8088 maxThreads Attribute is " + obj.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}Pour obtenir les valeurs de surveillance pertinentes ,Le principal problème estObjectNameAccès à.Parce queTongWeb Manuel incomplet 、C'est différent.TongWebPetite versionObjectNameC'est différent., Donc je veux vraiment ObjectNameIl n'y a qu'un seul chemin.:En ouvrant jconsole Rechercher manuellement les valeurs de surveillance correspondantes , Formule à un mot :Planeur.
Attention!:Attention!TongWebPetit numéro de version de,Par exemple,:Oui.TongWebVersion8088PortObjectNamePour: TONGWEB:type=ThreadPool,name="http-nio2-0.0.0.0-8088" ,Et oui.TongWebVersion8088PortObjectNamePour: TONGWEB:type=ThreadPool,name="http-nio2-8088" ; Comme le montre l'image ci - dessous, il est remplacé par l'invincible Hawk. Hulk Après la source des données , Les valeurs de surveillance sont plus différentes .

2.、AdoptionrestAcquisition d'interfaceTongWebInformation
Importer dans une application HttpClient4 Besoins jar Sac httpclient-4.x.jar、 httpcore-4.x.jar、commons-logging.jar,${TW_HOME}/lib/agent Sous la table des matières common-7.0.jar Documentation.demoComme suit:
package com.tong;
import com.tongweb.httpclient.utils.HttpClient4Util;
public class TestRest {
public static void main(String[] args) {
String result = null;
try {
// Notez d'en utiliser un à la place thanos Utilisateurs externes , Sinon, la console connectée sera éjectée thanosUtilisateurs
result = HttpClient4Util.execute("/rest/api/listener_detail", "GET", "thanos", "thanos123.com", "127.0.0.1",
"9060", null);
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
}
}Attention!:C'estrest L'interface n'est qu'une partie de l'interface fournie par le manuel , Le manuel est disponible , Je ne sais pas ce qui n'est pas fourni. ,Ça ne peut pas être commejconsole Comme ça. .
Trois、 Obtenir toutes les valeurs de surveillance des noeuds par une gestion centralisée
Adopter une gestion centralisée ,AdoptionheimdallGestionTongWebNoeuds individuels,Puis visiter http://127.0.0.1:9060/heimdall/notinrealm/rest/monitor/ibm/view Vous obtenez chacun TongWebÉtat de fonctionnement du noeud、Mémoire、JDBCSource des données、Pool de Threads、 Informations de surveillance appliquées jsonDonnées.
{
"nodes": [
{
"monitorList": [
{
"appname": "",
"dbname": "",
"monitorName": "nodestatus",
"monitorType": "warn",
"monitorValue": "stopped",
"servletName": "",
"threadPoolName": ""
},
{
"appname": "",
"dbname": "",
"monitorName": "OOM",
"monitorType": "warn",
"monitorValue": "",
"servletName": "",
"threadPoolName": ""
}
],
"nodeHome": "D:\\TongWeb7042\\TW7E\\domains\\aa",
"nodeIp": "192.168.163.1",
"nodeStatus": "stopped"
}
]
}边栏推荐
- Ranking of mainstream ERP systems, comparison of mainstream ERP systems
- Luogu p3522 [poi2011] TEM temperature solution
- 【ACWing】2521. Count colors
- 96. Different binary search trees
- Use of Google browser developer tools (Master!)
- 研二非科班研究生如何备战秋招
- Silent AI: how does shengteng AI solve the problem of sign language learning with large models?
- 【ACWing】2492. HH的项链
- 腾讯云对象存储操作流程
- Brief introduction of Bezier curve
猜你喜欢

欧奈尔的RPS曲线的编制方法(陶博士原创)

Huawei technologies:jonathan Krolikowski | from design to deployment, zero contact deep reinforcement learning WLANs

NO.6浮点数的表示与运算
![[7.15] code source - [neat array 2] [ternary cycle] [reverse pair on tree] [sequence of cochlea]](/img/86/8300586819e76502134e8467dc28a3.png)
[7.15] code source - [neat array 2] [ternary cycle] [reverse pair on tree] [sequence of cochlea]

Okaleido或杀出NFT重围,你看好它吗?

2. Sum of three numbers

Méthode de compilation de la courbe RPS d'O'Neill (originale par le Dr Tao)

Optimal Biking Strategy【DP + 二分】

Overview report of Chinese AI medical imaging industry in 2022

Comprehensive analysis of C language multimedia open source framework GStreamer
随机推荐
After 2000, he was hired as a special associate researcher of Nanjing University. He went to primary school at the age of 4 and was admitted to Nanjing University at the age of 14!
asterisk:No compatible codecs, not accepting this offer!
毕设-基于SSM在线预约挂号系统
揭开服务网格~Istio Service Mesh神秘的面纱
[dynamic programming] - longest ascending subsequence model
NFT市场格局仍未变化,Okaleido能否掀起新一轮波澜?
AcWing 274. 移动服务【DP】
非凸優化問題經典必看綜述“從對稱性到幾何性”,羅切斯特大學等
Take a look at try{}catch{}
Luogu p2422 good feeling solution
洛谷P3522 [POI2011]TEM-Temperature 题解
类3实践
Optimal Biking Strategy【DP + 二分】
Keil环境下STM32定位hardfault位置方法和遇到的情况
topy库的安装(拓扑优化软件)
uniapp 高德地图定位功能
iVX低代码平台系列详解 -- 概述篇(二)
数据库的增删改查
陶博士月线反转6.0
No.6 representation and operation of floating point numbers