Monitoring basic system performance

We need to keep an eye out on global system values. The ones that are particularly of interest are the following:

  • kernel.all.pswitch
  • kernel.all.nprocs
  • kernel.all.load

How to do it…

I'll show you a way to display both text-based and graphical output. Here are the steps:

  1. Display live data for the metrics with a 1-second interval for the guest.example.com host by executing the following command:
    ~]# pmdumptext -H -t 1 -i -l kernel.all.pswitch kernel.all.nprocs kernel.all.load -h guest.example.com
    
    How to do it…
  2. Create a configuration file for pmchart to display live data called system.conf with the following contents:
    #kmchart
    version 1
    
    chart style plot antialiasing off
            
    plot color #ffff00 metric kernel.all.pswitch
    chart style plot antialiasing off
            plot color #ffff00 metric kernel.all.nprocs
    chart style plot antialiasing off
            plot color #ffff00 metric kernel.all.load instance "1 minute"
            plot color #ff924a metric kernel.all.load instance "5 minute"
            plot color #ff0000 metric kernel.all.load instance "15 minute"
    
  3. Next, use pmchart to plot a live chart for guest.example.com via the following command:
    ~]# pmchart -h guest.example.com -c system.conf
    
    How to do it…

There's more…

The preceding examples are based on "live" data; however, you're not limited to live data. You could increase the interval of pmlogger in order to get more data about a troublesome system and then take a look at the generated data afterwards. With other tools, you'd have to use additional tools through cronjob and so on, while PCP allows you to do both.

Here's how you can do this:

  1. Show the the data of guest.example.com for November 1, 2015 between 15:30 and 16:30 with a 5-minute interval via the following command:
    ~]# pmdumptext -H -t 5m -i -l -S @15:30 -T @16:30 kernel.all.pswitch kernel.all.nprocs kernel.all.load -a /var/log/pcp/pmlogger/guest.example.com/20151101
    
    There's more…
  2. You can do the same with pmchart, as follows:
    ~]# pmchart -a /var/log/pcp/pmlogger/guest.example.com/20151101 -c system.conf -S @15:30 -T @16:30 -W -o output.png
    
    There's more…
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset