- What is CVIEW? (What it is not!)
- How does CVIEW work?
- What is needed for CVIEW (Prerequisites)?
- Download
- How to install CVIEW?
- How to use CVIEW script?
- How to use CVIEW graph?
- Tips
What is CVIEW? (What it is not?)
It is an easy CPU/CORE/CAPACITY monitoring tool for AIX systems. If you run this program it will collect physical core usage of LPARS in a managed system and creates an html file. After opening this file, you will see dynamic (interactive) graphs of the LPARS, where you can identify peak times, bottlenecks, strange behavior and used capacity of the managed system.
Now the question is, "Why do I make another tool, when these kind of metrics already monitored by more sophisticated applications by IBM and by other free programs?" The answer is "complexity" and "average".
"Complexity": When I checked available (free) CPU capacity monitoring tools, they required a web server and more steps for installation and configuration. Cview does not need a web server and it has to be given only 3 parameters (full path to the program, used ssh key and HMC name) and that's it.
"Average": When I checked available (free) CPU capacity monitoring tools (3 of them), I noticed that hourly, daily, weekly... graphs look differently. For example I saw a 0.9 core usage peak time on the hourly graph. When I checked daily graph of that same system, I could see only 0.8 core usage on that date and on the weekly graph even less. These tools were "averaging" the metrics to be able to show data on a given timewindow. In my opinion this is not good, and very misleading. Cview is not doing that. It calculates core capacity by minutes, and it does not matter what scale you use, you will see always the same numbers.
"What it is not!"
Cview is not a real time monitoring tool. You can use it to see what happened few minutes ago, but main purpose is to show historical data, and to see how your managed system and LPARs are behaving in long term, and if you see something strange, zooming to that date will probably explain you what happened there. Cview is not replacing other monitoring applications. It is an alternative and an additional tool, and hopefully they can be used together to find out necessary information.
How does CVIEW work?
From infrastructure point of view CVIEW needs 3 things to work: an HMC, an AIX LPAR and any computer for showing graphs (html files).
1. HMC: CVIEW is using HMC to get CPU information from LPARs. An HMC has a built in function, to store physical core usage of all LPARs in connected Managed Systems. It stores these values for 1 day only, so today's and yesterday's data can be obtained. It actually stores CPU cycles and some calculation is needed, but in short this is the situation. As hscroot, the command lslparutil will show for every minute these cpu cycles, and after doing some calculations we will get used physical core value for that minute.
2. AIX (CVIEW SCRIPT): An AIX LPAR will be needed, which is able to connect via SSH to the HMC. This is needed for CVIEW script (which is running on this LPAR) to get needed values and to create a data file and an html file (for graph). Cview is not running continuously in the background, it needs about 5 minutes for 200 LPARs to produce its output, so from resource point of view, its used resource is very minimal. For full automatic runs, used SSH key should be given to CVIEW and HMC should be able to accept that. (Some instruction how to do that will be given later.)
3. ANY COMPUTER (CVIEW GRAPH): After output files have been created, these should be copied to any computer where html files can be opened. Then you will see nice graphs, which you can manipulate. Choose timewindow, choose which LPAR to be displayed.
What is needed for CVIEW (Prerequisites)?
- An AIX LPAR, from where you can login to an HMC. Login with SSH key is needed if you want passwordless logins. (It will do an SSH connection for each LPAR so it is highly advised.)
- About 1.5 MB is needed to store 100 LPARs core usage each day. It means yearly about 500 MB is needed for 100 LPARs.
- CVIEW output files should be copied to another computer. Winscp does a good job in this.
- Html files should be opened by a Webbrowser. By default Firefox works well. With other browsers some configuration my needed,because sometimes browsers do not allow to open a file reference (for example Chrome). I suggest Firefox.
Download
Download it from Dropbox: cview.tgz
How to install CVIEW?
1. After copying downloaded cview.tgz to a specific directory on an AIX system, unzip it (I tested it as root): # gunzip < cview.tgz | tar xvf -
(It has been zipped with this command: # tar cvf - cview | gzip -c > cview.tgz)
It will create a cview directory with all the necessary files.
2. Configure environment variables: $PWD, $SSH_KEY, $HMC
Open cview.pl file (for example with vi), and fill in these variables with your local values at the top of the script:
After it is filled it should look like similar to this:
(SSH key authorization may needed at HMC side as well. See tips about this at Tips section.)
3. That's it, now you are ready for the run.
How to use CVIEW script?
There are 2 ways to start cview.pl. One is "manual run" the other is "automatic run". The difference is if you give a parameter or not when starting this script.
"Manual" run
If you run script this way: # ./cview.pl <managed system>, you can choose between today and yesterday values:
Managed system name is an element on the list of this HMC command: # lssyscfg -r sys -F name
After script is finished you will see 2 new files:
In order to view graphs, these 2 new files and _dygraph.js (which contains drawing functions) should be copied over to a computer which can open html files,
"Automatic" run
If you run script without parameter it will go through all managed systems which are available on HMC (lssyscfg -r sys -F name), it will collect yesterday's values (no option to choose) and copy output files to ./DATA directory:
Automatic run has a built in function to concatenate daily values. In every month it will do that for a 10 days period. From the first day of the month until 09th of the month there will be a file (..._1), from 10 to 20 another one (..._2) and from 20-31 again 1 file (..._3). So, when someone opens html file, he will see a 10 day graph of the LPARs.
To achieve these continuous graphs, probably a crontab entry should be created, which will collect yesterday's values automatically. An example could be:
5 2 * * * /usr/local/scripts/cview/cview.pl >/dev/null 2>&1
For displaying graphs, the whole managed system directory should be copied over, with data file, html file and _dygraph.js file.
How to use CVIEW graph?
After necessary files have been copied over, directory should look similar to this:
Now "html" file can be opened with a web browser, and you will see a graph something like this:
Tips
- Passwordless login between AIX LPAR and HMC:
The necessary steps can be found here: ssh key distribution to HMC
- Displaying a graph with many LPARs (above 10) can be slower:
When html file is opened, at first sight, to understand the displayed graph, is not so easy. Additionally a 10 day graph with many LPARS will be loaded for a few seconds. If you choose a smaller timewindow, graphs will look better and the interaction will be faster as well.
- Graph is too large for your resolution:
I created the graph for 1600x900 resolution, and if you have a smaller resolution, it can be annoying. To change the size of the graph you have to modify these 2 lines of the file ./DATA/_template/_range.html:
width: 1550,
height: 700,
Additional notes
dygraph.js file is an open source JavaScript library which has been downloaded from: http://dygraphs.com/
All other files are written by me, including cview.pl, which is written in perl language. It uses only basic functions, there are no additional modules, so it should be run on all default installed AIX systems.
This downloadable version is in a (very) beta phase. If it has been setup as described above, it works well, but if you try to test in different situations, it may behave strangely. This is not suggested.
If it is used without modifications it cannot do any harm in your system, however I cannot guarantee anything. The consequences and responsibility are yours when you run this program.
This is a free software, and you can use it freely without any modifications and I hope you will like it.
ML,
Balazs


