Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Install and Enable EPEL Repo:

No Format
yum -y install epel-release

This installs files in /etc/yum.repos.d/ and enables the epel repository by default.

On some servers, leaving EPEL enabled may not be in keeping with best practices to keep as close to the distribution rpm set as possible, so you can set the EPEL repository to be disabled by default.

No Format
perl -npi -e 's/enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo

 

Installing Zabbix Agent

No Format
yum -y install zabbix22-agent

or if you have EPEL disabled:

No Format
yum --enablerepo=epel -y install zabbix20-agent


Configure Zabbix Agent to use monitor-pdc.rice.edu (10.143.195.18)

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

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

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.

Table of Contents
maxLevel3

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

No Format

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

No Format

[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 .

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

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

  • storage.rice.edu:/IT/Systems, Architecture, & Infrastructure/zabbix/Zabbix_Client_Binaries/

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/

No Format

[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.

No Format

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.

No Format

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.

...

/etc/zabbix/zabbix_agentd.conf

...



Start Service and Check Status

No Format
/sbin/chkconfig zabbix-agent on
/sbin/service zabbix-agent start
/sbin/service zabbix-agent status
Panel
TitleLocal Config file only if needed

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*
No Format

mkdir  /var/log/zabbix
chown -R zabbix:zabbix /var/log/zabbix


Verify IPTABLES for Zabbix connections

Be sure IPTABLES /etc/sysconfig/iptables is updated to accept connections on port 10050, from monitor-pdc.rice.edu (10.129143.92195.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.18). MDI systems should already have this.

A simple example is below:

No Format
No Format

## 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.129143.92195.5218/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:

No Format

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

Install/activate Zabbix init script

No Format

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:

No Format

/etc/init.d/zabbix_agent start

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

No Format

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

Panel
titleConnectivity 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

Panel
titleConnectivity 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

ZBXD�1.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/kwKlAQImage Removed ]