You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 43 Next »

Quick and Easy way to Install Zabbix Agent

Grab (download) zabbix,zabbix-agent,zabbix-docs RPMs from the repo below:

http://rh6rpm.build.rice.edu/repo/

You can then install the RPMs and configure the agents to use monitor.rice.edu (10.129.92.52).

Example Below:

Installing Zabbix Agent

[bw8@localhost ~]# sudo yum install \
 http://rh6rpm.build.rice.edu/repo/el6/x86_64/zabbix-1.8.10-1.el6.x86_64.rpm \
 http://rh6rpm.build.rice.edu/repo/el6/x86_64/zabbix-agent-1.8.10-1.el6.x86_64.rpm \
 http://rh6rpm.build.rice.edu/repo/el6/x86_64/zabbix-docs-1.8.10-1.el6.noarch.rpm

Configure Zabbix Agent to use monitor.rice.edu (10.129.92.52)

sed -i -e 's/Server=127.0.0.1/Server=10.129.92.52/' /etc/zabbix/zabbix_agentd.conf
sed -i -e "s/Hostname=Zabbix\ server/\#Hostname=$(hostname)/" /etc/zabbix/zabbix_agentd.conf

Start Service and Check Status

/sbin/chkconfig zabbix-agent on
/sbin/service zabbix-agent start
/sbin/service zabbix-agent status

Verify IPTABLES for Zabbix connections

Be sure IPTABLES is updated to accept connections on port 10050, from 10.129.92.52. May be already
done with sitedisk iptables when your system was first installed. Check for a line allowing
connections from 10.129.92.52 (monitor.rice.edu) to port 10050 on client.

## Add this IF needed to /etc/sysconfig/iptables
## accept Zabbix agent connections on port 10050, from zabbix server
## at 10.129.92.52
-A INPUT -p tcp -m tcp --dport 10050 -s 10.129.92.52/32 -j ACCEPT

Installing the Linux Zabbix Agent, getting the files from monitor.rice.edu or RNAS

For servers in a closed network, the easiest way to install the Zabbix agent is probably
to download the files from monitor.rice.edu to a local workstation, then copy them over to
/tmp/ZABBIX/ on your server and install from there.
This example assumes we downloaded the files and then copied to EA12.rice.edu:/tmp/ZABBIX/

This installs just the Linux agent program; zabbix_agentd for monitoring. The default
config file will be placed at /etc/opt/zabbix/zabbix_agentd.conf. Everything else is specified
in the config file.

Download zabbix agent and files from monitor.rice.edu

From any section page on monitor
click the tab on the bottom labeled "Get the zabbix agents here"

Select from these options, and download the appropriate files

Get the appropriate version of zabbix_agentd binary:

* Linux agent/  - gets RHEL5 32bit V1.8.3
* RH4 32bit dynamically linked agent/  - gets RHEL5 32 V1.6.5)
* RH5 32bit statically linked agent/  - gets RHEL5 32bit dynamically linked V1.8.2
* RH5 64bit statically linked agent/ - gets RHEL5 64bit dynamically linked V 1/8.2
And for each type, get the:
- Start/Stop script (zabbix_agentd_ctl )
- config files (zabbix_agentd.conf )
Win32 agent/
Win64 agent/

Or, scp the files desired from monitor

[smcclure@fms09 MONITOR]$ scp monitor.rice.edu:/usr/site/zabbix/public_html/agents/RH4_32bit/zabbix_agentd .

[smcclure@fms09 MONITOR]$  scp monitor.rice.edu:/usr/site/zabbix/public_html/agents/linux/zabbix_agentd.conf .

[smcclure@fms09 MONITOR]$ scp monitor.rice.edu:/usr/site/zabbix/public_html/agents/linux/zabbix_agentd_ctl .

Copy zabbix files from workstation or open client, to your CLOSED client

  • make /tmp/ZABBIX on (closed) client
    mkdir /tmp/ZABBIX

Copy all files to the (closed) client you are installing agent on, into /tmp/ZABBIX/

[smcclure@fms09 ZABBIX]$ scp -p * fms04.rice.edu:/tmp/ZABBIX/

Setup Zabbix user/groups on the new client

You will need to sudo to root to do the following:

Verify/add Zabbix user/groups

This may already have been done as part of the initial install. Verify and do setup
if necessary.

egrep '^zabbix:' /etc/passwd >/dev/null || cat - >> /etc/passwd << EOF
zabbix:x:906:906:Zabbix User:/home/zabbix:/bin/bash
EOF
egrep '^zabbix:' /etc/group >/dev/null || cat - >> /etc/group << EOF
zabbix:x:906:
EOF
pwconv

Do Local setup and modifications for Zabbix

You will need to sudo to root to do the following:

Make home dir for zabbix

Wherever the local admins accounts are, make one for Zabbix. Copy zabbix_agentd
binary into home.

mkdir /home/zabbix
cp -p /tmp/ZABBIX/zabbix_x64_static_agentd /home/zabbix/zabbix_agentd
chmod ugo+x /home/zabbix/zabbix_agentd
chown -R zabbix:zabbix /home/zabbix
  • Setup local Zabbix config directory and file, ONLY IF Needed.
    (warning) Only need a local config file if you are changing from the defaults. Mostly we do NOT.

Create a local configuration directory and copy the conf file there. Otherwise, the default init script checks for /etc/zabbix/zabbix_agentd.conf at startup.

mkdir /etc/opt/zabbix
cp -p /tmp/ZABBIX/zabbix_agentd.conf /etc/opt/zabbix/
chown -R zabbix:zabbix /etc/opt/zabbix

  • Create local /var/log directory for Zabbix agent log and pid files*
mkdir  /var/log/zabbix
chown -R zabbix:zabbix /var/log/zabbix

Verify IPTABLES for Zabbix connections

Be sure IPTABLES is updated to accept connections on port 10050, from 10.129.92.52. May be already
done with sitedisk iptables when your system was first installed. Check for a line allowing
connections from 10.129.92.52 (monitor.rice.edu) to port 10050 on client.

## Add this IF needed to /etc/sysconfig/iptables
## accept Zabbix agent connections on port 10050, from zabbix server
## at 10.129.92.52
-A INPUT -p tcp -m tcp --dport 10050 -s 10.129.92.52/32 -j ACCEPT

Update /etc/services file if necessary:

This may have already been added to /etc/services at initial install. Check for and
add if necessary.

Update services file:

cat - >> /etc/services << EOF
## Zabbix services
zabbix_agent            10050/tcp               # Zabbix Agent
zabbix_trap             10051/tcp               # Zabbix Trap
##
EOF

Install/activate Zabbix init script

cp -pi /tmp/ZABBIX/zabbix_agent_init /etc/init.d/zabbix_agent
chown root:root /etc/init.d/zabbix_agent
chmod ug+x /etc/init.d/zabbix_agent

chkconfig zabbix-agent on
chkconfig --list zabbix-agent

Start zabbix_agent on client

Fire it up:

/etc/init.d/zabbix_agent start

Checking the /var/log/zabbix/zabbix_agentd.log you should see this

tail /var/log/zabbix/zabbix_agentd.log

  2728:20100811:135911.054 Zabbix Agent started. Zabbix 1.8.2 (revision 11211).
  2730:20100811:135911.054 zabbix_agentd collector started
  2733:20100811:135911.055 zabbix_agentd listener started
  2734:20100811:135911.055 zabbix_agentd listener started
  2735:20100811:135911.055 zabbix_agentd listener started
zabbix_agentd.log (END)

Troubleshooting zabbix connectivity issues

Once your zabbix_agentd is started successfully you should see the host on monitor.rice.edu,
and it should say Status = "Monitored" and the Z under Availability should be Blue (not red)

If not, check out connectivity issues like so

Connectivity Checks from new client

root@fms06:/etc/sysconfig> telnet monitor.rice.edu 10051

Trying 10.129.92.52...
Connected to monitor.rice.edu.
Escape character is '^]'.

root@fms11:/etc/sysconfig> netstat -an | grep 1005

tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN
tcp 0 0 10.142.93.6:10050 10.129.92.52:54553 TIME_WAIT
tcp 0 0 10.142.93.6:10050 10.129.92.52:53015 TIME_WAIT
tcp 0 0 10.142.93.6:10050 10.129.92.52:52757 TIME_WAIT
tcp 0 0 10.142.93.6:10050 10.129.92.52:54537 TIME_WAIT
tcp 0 0 10.142.93.6:10050 10.129.92.52:53557 TIME_WAIT

Connectivity Checks from Monitor.rice.edu

root@monitor:/opt/opt.CORE/zabbix-1.8.3/rhel5/public_html/agents> telnet fms06.rice.edu 10050

Trying 10.142.93.4...
Connected to fms06.rice.edu.
Escape character is '^]'.

agent.version

ZBXD1.6.5Connection closed by foreign host.

Define monitoring for new client on monitor.rice.edu

(warning) The monitoring setup is done by the owner/admin of the applications running on the client.
The application owners know best what services they will need to monitor, who to notify,
and what hours of operations they need notifications done for.

See the wiki:
[ Zabbix Monitoring | https://docs.rice.edu/confluence/x/kwKlAQ ]

OR Download zabbix agent and files from rnas.rice.edu

The Zabbix agent binaries and other files are also found on rnas.rice.edu at

  • \\rnas.rice.edu\ITsata\ZabbixAgents\

(10.129.92.52)

  • No labels