Here we will see how to monitor windows and Solaris systems using java.First we should know what are the parameters like cpu usage,available memory,disk usage,logged in users….etc required to monitor these machines.We can use few options like SNMP or Some third party Java APIs to get those information’s from systems.
Following api’s will be really simplify your work.Here we will see api’s which I used in my project.
Solaris -JSCH API
Solaris Systems supports SSH.What is SSH?.It is a program for logging into remote machine and execute commands on a remote machine.So we can execute commands on remote machine to get those parameters to monitor Solaris system.JSCH is a pure java API for SSH2.Using this api we can easily execute those commands from java program.
Download JSCH here
Windows – WMI
We can also monitor windows machines.j-Interop is a Java Open Source library that implements the DCOM(Distributed Components object model) wire protocol (MSRPC) to enable development of Pure, Bi-Directional, Non-Native Java applications which can interoperate with any COM component.
Using this api we can easily query the windows machine and fetch parameters which will be useful to monitor windows machines.
Download j-Interop here
