Documentation Prom-agent

Prom-agent

Quickstart

To start receiving data from your AIX systems into Prometheus, only 3 steps are needed:

  1. Install the fileset
  2. Add scrapes in Prometheus server configuration
  3. Create Grafana visualisations

Installation

Unzip the downloaded fileset and install it. In case you previsouly installed the trial version, please uninstall it before installing the production ready licensed fileset (check the uninstall section below).

gunzip prom_exporter.0.x.y.z.bff.gz
installp -acXd . prom_exporter

Start the service/subsystem

As root user, use the AIX System Resource Controller (SRC) startsrc command:

# startsrc -s prom_exporter
0513-059 The prom_exporter Subsystem has been started. Subsystem PID is 16908344.

The expected return code is 0. In case of failure, please check the troubleshooting section below.

Get the status of the service/subsystem

Once started, the subsystem service should be on status ‘active’:

# lssrc -s prom_exporter
Subsystem         Group            PID          Status
 prom_exporter                     1234567      active

If the status remains to ‘inoperative’, check the Troubleshooting section below.

Configure Prometheus scrape

Once the service/subsystem has been started, it is now time to add a scrape for it on your Prometheus server. Connect to your Prometheus server and edit the /etc/prometheus/prometheus.yml file:

# vim prometheus.yml

Find the ‘scrape_configs’ block and add one entry by exporter/node:

scrape_configs:
  - job_name: AIX
    static_configs:
      - targets: ['hostnameA:9100']
        labels:
          stage: 'PROD'
          app:   'VIOS'
          pseries: 'serverNameA'
      - targets: ['hostnameB:9100']
        labels:
          stage: 'DEV'
          app:   'Database'
          pseries: 'serverNameB'

Save your file and restart or refresh the prometheus server process.

# kill -HUP 12345 # Prometheus PID

Stop the service/subsystem

# stopsrc -s prom_exporter

The expected return code is 0.

Troubleshooting

If your prom_exporter subsystem remains in ‘inoperative’ status, please check the following points:

  • Check if your trial period is expired:
# /usr/local/bin/prom_exporter
Prometheus node exporter for AIX listening on port 9100. Sampling period: 30s
Trial period expired. We hoped you like Prometheus4AIX. Please purchase a license at https://prometheus4aix.com if you intend to continue using this product.

Fix: Purchase a licence on https://promehteus4aix.com, uninstall the trial fileset and install the purchased fileset.

  • Check if the network port is not already occupied. By default, the exporter listens to the 9100/tcp port:
# netstat -na | grep 9100
tcp4       0      0  *.9100                 *.*                    LISTEN

Fix: Change the listening port of your prometheus4aix using the chssys command as explained in the ‘modify default parameters’ section below. An alternative fix is to stop the process actually using the same TCP port.

  • The daemon does not start whatever I try.

Check that you are using an AIX 7.x operating system. For now, AIX 5.x and 6.x are not supported:

# oslevel -s
7100-05-09-2135
  • My Grafana charts show holes or missing data.

It may happen on large scale lpars. In this case, shorten the sampling period for the exporter. The default is 30 seconds. It might help to shorten it to 20 or 25 seconds:

chssys -p /usr/local/bin/prom_exporter -s prom_exporter -u root -R -S -f 9 -n 15 -a "-p 9100 -s 20"
  • My problem is not referenced here.

Please contact us at contact@prometheus4aix.com describing your issue.

Uninstall

First, stop the service, uninstall the fileset, and remove the subsystem:

stopsrc -s prom_exporter
installp -u prom_exporter.rte
rmssys -s prom_exporter

Modify default parameters

By default Promeetheus4AIX exporter runs with the following parameters:

  • listening port: 9100/tcp
  • sampling perido: 30s
chssys -p /usr/local/bin/prom_exporter -s prom_exporter -u root -R -S -f 9 -n 15 -a "-p 9100 -s 30"

Change the listening port

Use the change subsystem command. For example to switch to tcp port 9123:

chssys -p /usr/local/bin/prom_exporter -s prom_exporter -u root -R -S -f 9 -n 15 -a "-p 9123 -s 20"

Disable auto start at boot time

The automatic startup of the exporter is made by an entry into the /etc/inittab file. The entry should look like this:

prometheus:2:once:/usr/bin/startsrc -s prom_exporter > /dev/console 2>&1

To temporary disable it, simply comment it editing the file, by adding a : at the beggining of line:

:prometheus:2:once:/usr/bin/startsrc -s prom_exporter > /dev/console 2>&1

If you require a complete disabling, simply delete the line and save the /etc/inittab.

loki-agent

Requirement

libyaml: libyaml-0.2.5-1.aix7.1.ppc.rpm

Installation by yum: yum install libyaml