Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Monitor CPU via Hudson

Digital Innovation Partner

Monitor CPU via Hudson

This is a tutorial to have cpu of a server monitored via Hudson. Is intented to be a guide line, not all the aspect are detailed.

To achieve this you need the following software installed:

  • Hudson system working
  • Hudson Plot Plugin, to install this, from your Hudson instance go to “Configure Hudson”>”Plugin” and search for the plot plugin from the available software.
  • On the machine monitored  you need a cpu sampling program, we use Ubuntu Linux so we decided to use sar software, to install this:
    • aptitude install sysstat
    • edit the file /etc/default/sysstat change “ENABLED” to “true”.

Now we need to give to the plot plugin a csv file of the interested measures. Every build add one Y value for every measure. In the example we have 5 measure, so we need 5 values.

With a shell script we get the sampled rate we need, for example assume the following is a script called “cpu.sh” (the script need to be adjusted to feet your needs):

put the output of the script to a file like:

and then the configuration of the plot plugin is:

Finish! You now get a graph like the one in the beginning of the article… With sar you can also measure memory, swap, network, processes.

Note that you can also monitor remote machine, suppose to distribute your cpu.sh and have your server configured to login via ssh and public key authentication, then you can get sampling rate like this

Hope this helps

maybe next time i will show you how to be alerted via mail if the cpu exceed a given threshold

Tags: , , , , , ,

2 risposte

  1. ivan ha detto:

    great, now i know what are you doing…

  2. Riccardo ha detto:

    i also write you an email about…

Lascia un commento