diff --git a/src/main/java/land/chipmunk/chipmunkbot/commands/InfoCommand.java b/src/main/java/land/chipmunk/chipmunkbot/commands/InfoCommand.java index 2dea0b6..4cb46e9 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/commands/InfoCommand.java +++ b/src/main/java/land/chipmunk/chipmunkbot/commands/InfoCommand.java @@ -56,8 +56,9 @@ public class InfoCommand extends Command { public int sendServerInfo (CommandContext context) { final CommandSource source = context.getSource(); + final Runtime runtime = Runtime.getRuntime(); final OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean(); - final RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + final RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); final MemoryMXBean memory = ManagementFactory.getMemoryMXBean(); // ? Should I send a single message that uses newlines instead? @@ -69,20 +70,26 @@ public class InfoCommand extends Command { } catch (Exception ignored) { } - source.sendOutput(formatEntry(Component.translatable("OS name"), Component.text(os.getName())), false); + source.sendOutput(formatEntry(Component.translatable("OS Name"), Component.text(os.getName())), false); source.sendOutput(formatEntry(Component.translatable("OS version"), Component.text(os.getVersion())), false); source.sendOutput(formatEntry(Component.translatable("OS architecture"), Component.text(os.getArch())), false); source.sendOutput(formatEntry(Component.translatable("CPU cores"), Component.text(os.getAvailableProcessors())), false); source.sendOutput(formatEntry(Component.translatable("CPU load"), Component.text(os.getSystemLoadAverage())), false); + try { + final String uname = new String(runtime.exec(new String[] {"uname", "-a"}).getInputStream().readAllBytes()).trim(); + source.sendOutput(formatEntry(Component.translatable("uname -a"), Component.text(uname)), false); + } catch (IOException ignored) { + } + try { final String cpuModel = CPUInfo.readCpuInfo().get("model name"); source.sendOutput(formatEntry(Component.translatable("CPU model"), Component.text(cpuModel)), false); } catch (IOException ignored) { } - source.sendOutput(formatEntry(Component.translatable("Java VM"), Component.text(runtime.getVmName())), false); - source.sendOutput(formatEntry(Component.translatable("Java version"), Component.text(runtime.getVmVersion())), false); + source.sendOutput(formatEntry(Component.translatable("Java VM"), Component.text(runtimeMXBean.getVmName())), false); + source.sendOutput(formatEntry(Component.translatable("Java version"), Component.text(runtimeMXBean.getVmVersion())), false); source.sendOutput(formatEntry(Component.translatable("Heap memory usage"), formatMemoryUsage(memory.getHeapMemoryUsage())), false);