Perfstatbeat is a beat based on Metricbeat which collects performance metrics through the perfstat API of the AIX operating system and supplies them in a form, that is mostly compatible with the Metricbeat system module.
These modules and metrics have already been implemented:
-
system.load
Same fields as the upstream module.
-
system.diskio
- Disk name, volume group name and unique disk identifier (UDID).
- IO count, size and time per read and write (i.e. average IO time can be calculated).
This does not seem to be much, but it's both a working metric that uses a global interface of the perfstat API, as well as one that uses a component-specific interface that is an example of implementing others.
- An AIX operating system instance.
- A recent version of
gcc-go
and its dependencies. I've build the software on these combinations:- AIX 7.2 and the Go packages of the AIX Toolbox for Linux Applications
- AIX 7.1 and the Go packages kindly provided by BullFreeware
- GNU
make
, e.g. from one of the sources above or packages kindly provided by Michael Perzl.
libgo
should come from the same Go packages as the build environment.libgcc
, not necessarily at the same level or from the same source likelibgo
.
To compile your beat run gmake
. Then you can run the following command to see the first output:
./perfstatbeat -e -d "*"
Note, that I've seen linker problems when the ar
command of GNU binutils is being used instead of the native one. This could happen, if /opt/freeware/bin
shows up in front of /usr/bin
in the PATH
environment.
Perfstatbeat is a beat based on Metricbeat which was generated with metricbeat/metricset generator.
Have a look at the upstream documentation to start with development.
- Internet access or an outbound proxy server (use
export https_proxy=http://[user:passwd@]proxy.server:port
). python
andpython-pip
also GNUcoreutils
andfindutils
, e.g. from the sources listed above.virtualenv
, which might be installed withpip install virtualenv
.
Some make steps depend on GNU specific options of the cp
and find
commands, i.e. the have to be used instead of the native ones. However, putting /opt/freeware/bin
to the beginning of the PATH
environment could lead to the linker error described above. This can be solved, for example, as follows:
mkdir -p ~/bin
ln -s /opt/freeware/bin/cp /opt/freeware/bin/find ~/bin/
export PATH=~/bin:$PATH
Furthermore these steps will need to load some Python modules from the upstream sources, so set up the PYTHONPATH
environment like this:
export PYTHONPATH=vendor/github.com/elastic/beats/metricbeat/scripts
In case further modules and metricsets should be added, run:
gmake create-metricset
This will create the necessary boilerplate code. Check the upstream documentation to see how you can proceed.
In the existing modules (e.g. load) you can see how to access the perfstat API from Go. cgo contains information on how to call C code from Go routines.
You can find the description of the perfstat API in the IBM Knowledge Center. The AIX operating system contains some code examples written in C inside /usr/samples/libperfstat
.
After updates to the fields or config files, always run
gmake collect
This updates all fields and docs with the most recent changes.
Perfstatbeat currently includes version 6.2.4 of beats in the vendor
subfolder with some minor modifications on libraries inside their vendor
directory. Later versions make use of Go modules that are not available on the AIX operation system currently.
The original packaging process makes use of containers and will obviously not work here. So currently the binary file has to be distributed manually. Maybe an RPM spec file will be provided later.
AIX is a registered trademark of the International Business Machines Corporation.
Metricbeat is a trademark of Elasticsearch BV.
Perfstatbeat is not endorsed by any of these companies.