Zabbix agent on IBM AIX
Overview
Pre-compiled Zabbix agent binaries for IBM AIX are available for download as a .tar.gz archive.
This page describes how to install the agent from the archive, run it manually or with the System Resource Controller (SRC), start it at system boot, and remove it from SRC.
Installing agent
The AIX tar command does not support the -z option, so decompress the archive with gunzip.
Use the -o option of tar so that the extracted files are owned by the user who extracts them, not by the numeric user and group IDs stored in the archive.
For example, to place the agent in /opt/zabbix (run as root; /opt/zabbix must not exist yet):
gunzip -c zabbix_agent-7.4.7-aix-7.2-powerpc-openssl.tar.gz | tar -xof -
mv zabbix_agent-7.4.7-aix-7.2-powerpc-openssl /opt/zabbix
In the AIX archive, the agent binary is located in usr/sbin/ and the configuration file in etc/zabbix/.
Before starting the agent, adjust /opt/zabbix/etc/zabbix/zabbix_agentd.conf as needed (at least the Server, ServerActive, and Hostname parameters).
If started as root, the agent switches to the zabbix user (or the user specified by the User parameter) unless AllowRoot=1 is set in the configuration file.
This user must exist on the system; otherwise, the agent does not start.
If the zabbix user does not exist yet, create it together with a group of the same name:
mkgroup zabbix
mkuser pgrp=zabbix login=false rlogin=false zabbix
The login=false and rlogin=false attributes prevent the account from being used for logging in; the agent can still run as this user.
Starting agent manually
The agent can be started manually:
/opt/zabbix/usr/sbin/zabbix_agentd -c /opt/zabbix/etc/zabbix/zabbix_agentd.conf
Running agent with SRC
Registering agent
The agent can also be registered with the System Resource Controller (SRC).
When started through SRC, the agent must run in foreground mode (the -f option).
Otherwise, SRC loses track of the agent process and cannot stop it.
For example (run as root):
mkssys \
-s zabbix_agentd \
-p /opt/zabbix/usr/sbin/zabbix_agentd \
-a "-c /opt/zabbix/etc/zabbix/zabbix_agentd.conf -f" \
-u zabbix \
-G tcpip \
-S -n 15 -f 9 \
-R
In this example:
-ssets the subsystem name used with the SRC commands;-psets the full path to the agent binary;-asets the agent command-line arguments as a single quoted string; SRC splits this string into separate arguments when it starts the agent (only one-aoption is accepted);-usets the user that the agent runs as; the user name is converted to a numeric user ID when the subsystem is created, so the user must already exist;-Gadds the agent to thetcpipsubsystem group, so that group commands also apply to it (for example,stopsrc -g tcpipalso stops the agent);-S -n 15 -f 9makes SRC control the agent with signals:stopsrcsendsSIGTERM(15) for a normal stop andSIGKILL(9) for a forced stop (stopsrc -f);-Rmakes SRC restart the agent if it terminates abnormally (for example, if one of its processes crashes); the agent is not restarted afterstopsrc.
Since the user ID is stored in the subsystem definition, update the definition if the zabbix user is recreated with a different user ID:
chssys -s zabbix_agentd -u zabbix
Starting and stopping agent
The agent can be started, queried, and stopped with startsrc, lssrc, and stopsrc:
startsrc -s zabbix_agentd
lssrc -s zabbix_agentd
stopsrc -s zabbix_agentd
Avoid the forced stop (stopsrc -f).
It kills only the main agent process; the other agent processes keep running and keep the listening port open, so the agent cannot be started again until they are terminated manually (for example, with kill -9).
Starting agent at system boot
Registering the agent with SRC does not make it start at system boot.
To start the agent automatically at boot, add an entry to /etc/inittab:
mkitab "zabbix_agentd:2:once:/usr/bin/startsrc -s zabbix_agentd >/dev/console 2>&1"
Removing agent from SRC
To remove the agent from system startup and from SRC:
stopsrc -s zabbix_agentd
rmitab zabbix_agentd
rmssys -s zabbix_agentd