Hi,
I'm developing a application with JBoss 7 and JSF. I need to display OS information in the web page - CPU load, RAM, HDD, installed RPM packets and etc.
How I can do this?
Regards
Peter
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi,
I'm developing a application with JBoss 7 and JSF. I need to display OS information in the web page - CPU load, RAM, HDD, installed RPM packets and etc.
How I can do this?
Regards
Peter
Unless you have platform support from JBoss/JSF, you'll have to run utilities from your OS that produce that kind of info and capture / parse their output. You can do that by having long-running scripts that make occasional updates to files in known locations, or by invoking those utilities via java.lang.ProcessBuilder
What OS? Server or client? Server you can use the system dependent utils to get the appropriate info you need. Client side there are security issues with things like javascript or an applet, and I'd recommend against it.
The server OS is Centos
I need from a simple JSF page to monitor the load the the server on which the JBoss server is running.
You'd normally need some kind of privileged access to get that kind of information about the underlying OS - do you have privileged access (a CentOS login) on the server?. Do you know how to write shell scripts for Linux?
I'm not sure any more what's stopping you from writing your page.