Skip to content
Snippets Groups Projects
Commit 000046a1 authored by Ramiro Facundo Lorenzo Rodriguez Inthamoussu's avatar Ramiro Facundo Lorenzo Rodriguez Inthamoussu
Browse files

es fix1

parent 90e7e04f
No related branches found
No related tags found
No related merge requests found
...@@ -504,8 +504,7 @@ public class EstadoSistemaEJB { ...@@ -504,8 +504,7 @@ public class EstadoSistemaEJB {
private String extractHostname(List<String> commandResult) { private String extractHostname(List<String> commandResult) {
String hosnameline = commandResult.stream().filter(s -> s.contains("hostname")).findFirst().orElse(null); String dirtyHostname = commandResult.stream().filter(s -> s.contains("hostname")).findFirst().orElse(null).split(":")[1];
String dirtyHostname = hosnameline.split(":")[1];
return dirtyHostname.substring(dirtyHostname.indexOf("\"")+1, dirtyHostname.lastIndexOf("\"")); return dirtyHostname.substring(dirtyHostname.indexOf("\"")+1, dirtyHostname.lastIndexOf("\""));
} }
...@@ -518,7 +517,9 @@ public class EstadoSistemaEJB { ...@@ -518,7 +517,9 @@ public class EstadoSistemaEJB {
Process process = processBuilder.start(); Process process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line; String line;
int i = 0;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
System.out.println((++i) + ": " + command + " -> " + line);
salida.add(line); salida.add(line);
} }
process.waitFor(); process.waitFor();
...@@ -608,6 +609,7 @@ public class EstadoSistemaEJB { ...@@ -608,6 +609,7 @@ public class EstadoSistemaEJB {
schema = dburl.split("/")[3]; schema = dburl.split("/")[3];
dbSize = ((BigDecimal)em.createNativeQuery("SELECT sum(DATA_LENGTH + INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA = ? GROUP BY TABLE_SCHEMA").setParameter(1, schema).getResultList().get(0)).toString(); dbSize = ((BigDecimal)em.createNativeQuery("SELECT sum(DATA_LENGTH + INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA = ? GROUP BY TABLE_SCHEMA").setParameter(1, schema).getResultList().get(0)).toString();
} catch (Exception e) { } catch (Exception e) {
dbSize = "";
} finally { } finally {
try { try {
userTransaction.commit(); userTransaction.commit();
......
#Generated by Maven Integration for Eclipse #Generated by Maven Integration for Eclipse
#Mon Jul 27 12:54:34 BRT 2020 #Mon Jul 27 15:40:50 BRT 2020
version=0.0.1-SNAPSHOT version=0.0.1-SNAPSHOT
groupId=proygrado groupId=proygrado
m2e.projectName=Servidor JEE m2e.projectName=Servidor JEE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment