Skip to content

Instantly share code, notes, and snippets.

@CHERTS
Created August 21, 2020 07:05
Show Gist options
  • Save CHERTS/c55b6784f0b758a17fe33cb83a7d230a to your computer and use it in GitHub Desktop.
Save CHERTS/c55b6784f0b758a17fe33cb83a7d230a to your computer and use it in GitHub Desktop.
How to install Zabbix-agent on Solaris 10 & 11
# Run this commands from user root
mkdir zabbix-agent && cd zabbix-agent
wget https://github.com/CHERTS/zabbix_44x_next/releases/download/v4.4.11/zabbix_agent-4.4.11-solaris-11.4-amd64-openssl.tar.gz
tar -vzxf zabbix_agent-4.4.11-solaris-11.4-amd64-openssl.tar.gz
cp bin/zabbix_* /usr/bin/
cp sbin/zabbix* /usr/sbin/
mkdir /etc/zabbix/
cp conf/zabbix_agentd.conf /etc/zabbix/
chmod -R 755 /etc/zabbix/
groupadd zabbix
useradd -c 'Zabbix agent' -d / -g zabbix -s /usr/bin/false zabbix
cat << 'EOF' > /etc/init.d/zabbix_agentd
#!/bin/sh
CONFIG=/etc/zabbix/zabbix_agentd.conf
DAEMON=/usr/sbin/zabbix_agentd
PIDDIR=/var/run/zabbix
PID=/var/run/zabbix/zabbix_agentd.pid
case "$1" in
start)
if [ ! -d $PIDDIR ]; then
mkdir $PIDDIR
fi
chown zabbix:sys $PIDDIR
if [ -f $CONFIG -a -f $DAEMON ]; then
echo 'Starting zabbix_agentd.'
$DAEMON -c $CONFIG
fi
;;
stop)
echo 'Stopping zabbix_agentd.'
kill -TERM `cat $PID`
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
EOF
chown root:sys /etc/init.d/zabbix_agentd
chmod 744 /etc/init.d/zabbix_agentd
ln -s /etc/init.d/zabbix_agentd /etc/rc3.d/S99zabbix_agentd
mkdir /var/run/zabbix/
chown zabbix:zabbix /var/run/zabbix/
touch /var/log/zabbix_agentd.log
chown zabbix:zabbix /var/log/zabbix_agentd.log
# Edit config file /etc/zabbix/zabbix_agentd.conf
# Start zabbix-agent
/etc/init.d/zabbix_agentd start
# Let's check the launch of the agent
ps -eaf | grep zabbix_agent
@amsalu-max
Copy link

please continue the next step to start the zabbix_agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment