CPU Monitor

CPU Monitor is a lightweight Java app that uses Secure Shell (ssh) to scrape information from a server and chart its configuration and current load. It communicates directly with the server and as a result doesn’t require an agent to be running on the target. It supports Linux, Solaris and macOS. You can download it here.

full

Installation and Configuration

Download the latest build from here. To configure CPU Monitor simply uncompress the zip file using a command similar to the following on Linux and Unix

unzip cpumonitor.zip

On windows use a utility such as winzip.

This will create a directory called cpumonitor, simply change into this directory and then into the bin directory.

$ cd cpumonitor
$ ls
bin      classes  launcher lib      log      source
$ cd bin
$ ls
README.txt     cpu.xml        cpumonitor     cpumonitor.bat

You will need to edit cpu.xml to reflect your environment. It will look something like this

<!--?xml version = '1.0' encoding = 'UTF-8'?-->
<cpumonitor title="Compute Nodes" xmlns="http://www.dominicgiles.com/cpumonitor">
  <monitorednode>
      <hostname>localhost</hostname>
      <username>root</username>
      <password>mypassword</password>
      <comment>My Computer</comment>
   </monitorednode>
</cpumonitor>

Change the text in between the “HostName” tags (currently localhost) to point to the server you wish to monitor (hostname or ip address) . Change the text between the “Username” tags to a user with access to standard monitoring utilities such as “vmstat”. This typically doesn’t require any special privilege. Change the text between the “Password” tags to the users password. You also can change the text between the “Comment” tags to anything you want displayed with the other details for this computer such as “Database Server”, “Application Server”, “LDAP Server” etc.

You can also change the text between the “Title” tags to something more appropriate such as “ERP Server”, “Sun Oracle Database Machine” etc.

Simply repeat this process for multiple servers and your done. You should end up with something similar to this

<!--?xml version = '1.0' encoding = 'UTF-8'?-->
<cpumonitor title="Production RAC Cluster" xmlns="http://www.dominicgiles.com/cpumonitor">
  <monitorednode>
      <hostname>node1</hostname>
      <username>oracle</username>
      <password>secretpassword</password>
      <comment>RAC Node 1</comment>
  </monitorednode>
  <monitorednode>
      <hostname>node2</hostname>
      <username>oracle</username>
      <password>secretpassword</password>
      <comment>RAC Node 2</comment>
  </monitorednode>
  <monitorednode>
      <hostname>node3</hostname>
      <username>oracle</username>
      <password>secretpassword</password>
      <comment>RAC Node 3</comment>
  </monitorednode>
  <monitorednode>
      <hostname>node4</hostname>
      <username>oracle</username>
      <password>secretpassword</password>
      <comment>RAC Node 4</comment>
   </monitorednode>
</cpumonitor>

After the config file has been loaded into cpumonitor it will encrypt any clear text passwords.

To start CPU Monitor simply type

$ ./cpumonitor

If you have multiple configurations you can use the -c command line option to to specify different configuration files i.e.

$ ./cpumonitor.jar -c applicationservers.xml

To start cpumonitor in a smaller format specify the -md option from the command line.