Install zabbix agent Linux REDHAT

alias ll=’ls -ltra’

download agent and server components, unpack and compiles :ll /et

[ora102@hyde ERPMIG agent]$ cd /data/zabbix/agent
[ora102@hyde ERPMIG agent]$ gunzip zabbix-1.8.5.tar.gz
[ora102@hyde ERPMIG agent]$ tar -xvf zabbix-1.8.5.tar
[root@hyde ~]# sudo groupadd -g 9000 zabbix
[root@hyde ~]# sudo adduser -m -d /home/zabbix -g 9000 zabbix
[root@hyde ~]# sudo passwd zabbix
zabbix#123

[root@hyde ~]# cd /data/zabbix/agent/zabbix-1.8.5 
[root@hyde zabbix-1.8.5]# ./configure --enable-agent 

config.status: creating src/zabbix_server/proxypoller/Makefile config.status: creating src/zabbix_server/selfmon/Makefile config.status: creating src/zabbix_proxy/Makefile config.status: creating src/zabbix_proxy/heart/Makefile config.status: creating src/zabbix_proxy/housekeeper/Makefile config.status: creating src/zabbix_proxy/proxyconfig/Makefile config.status: creating src/zabbix_proxy/datasender/Makefile config.status: creating upgrades/Makefile config.status: creating man/Makefile config.status: creating include/config.h config.status: executing depfiles commands Configuration: Detected OS: linux-gnu Install path: /usr/local Compilation arch: linux Compiler: gcc Compiler flags: -g -O2 Enable server: no Enable proxy: no Enable agent: yes Agent details: Linker flags: -rdynamic Libraries: -lm -lresolv LDAP support: no IPv6 support: no *********************************************************** * Now run 'make install' * * * * Thank you for using Zabbix! * * * ***********************************************************

[root@hyde zabbix-1.8.5]# make install

Set /etc/services and agent.conf

[root@hyde zabbix-1.8.5]# vim /etc/services

#------------------------------------- # Srvices Zabbix #-------------------------- 

zabbix_agent 10050/tcp 
zabbix_trap 10051/tcp

[root@hyde sbin]# cd /usr/local/sbin
[root@hyde sbin]# ll
total 1084
-rwxr-xr-x 1 root root 492955 mai 23 14:51 zabbix_agent
-rwxr-xr-x 1 root root 594638 mai 23 14:51 zabbix_agentd

[root@hyde etc]# cd /etc
[root@hyde etc]# mkdir zabbix
[root@hyde etc]# cp /data/zabbix/agent/zabbix-1.8.5/misc/conf/zabbix_agent.conf /etc/zabbix/
[root@hyde sbin]# cp /data/zabbix/agent/zabbix-1.8.5/misc/conf/zabbix_agentd.conf /etc/zabbix/

[root@hyde sbin]# vim /etc/zabbix/zabbix_agentd.conf

# 
# Mandatory: no 
# Default: 
# LogRemoteCommands=0 
##### Passive checks related ### 
Option: Server 
# List of comma delimited IP addresses (or hostnames) of Zabbix servers. 
# No spaces allowed. First entry is used for receiving list of and sending active checks. 
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally. 
# 
# Mandatory: yes 
# Default: 
# Server= Server=vmoni.ft.grp ### 
Option: Hostname 
# Unique, case sensitive hostname. 
# Required for active checks and must match hostname as configured on the server. 
# System hostname is used if undefined. 
# 
# Default: 
# Hostname=system.hostname Hostname=Hyde 
### Option: ListenPort 
# Agent will listen on this port for connections from the server. # 
# Mandatory: no 
# Range: 1024-32767 
# Default: 
ListenPort=10050 
### Option: ListenIP 
# List of comma delimited IP addresses that the agent should listen on. 
# 
# 
Mandatory: no 
# 
Default: ListenIP=10.1.1.79 
### 
Option: DisablePassive

Copy and Modify zabbix_agentd_ctl file :

[root@hyde redhat]# cd /data/zabbix/agent/zabbix-1.8.5/misc/init.d/redhat/
[root@hyde redhat]# ll
total 24
drwxr-xr-x 2 zabbix zabbix 4096 avr 15 21:20 8.0
-rwxr-xr-x 1 zabbix zabbix 3214 avr 15 21:17 zabbix_agentd_ctl
-rwxr-xr-x 1 zabbix zabbix 3198 avr 15 21:17 zabbix_server_ctl
[root@hyde redhat]# cp zabbix_agentd_ctl /etc/init.d/

[root@hyde redhat]# cd /etc/init.d/
[root@hyde redhat]# vim zabbix_agentd_ctl

# base zabbix dir 
#BASEDIR=/opt/zabbix 
BASEDIR=/usr/local/

STOP / START Agent

[root@hyde init.d]# ./zabbix_agentd_ctl stop
./zabbix_agentd_ctl stop: zabbix_agentd process(es) stopped
[root@hyde init.d]# ps aux |grep zabbix_agent
root 12057 0.0 0.0 52148 768 pts/3 S+ 11:08 0:00 grep zabbix_agent
[root@hyde init.d]# ./zabbix_agentd_ctl start
./zabbix_agentd_ctl start: zabbix_agentd started
[root@hyde init.d]# ps aux |grep zabbix_agent
zabbix 12064 0.0 0.0 7188 788 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
zabbix 12065 0.0 0.0 7188 1000 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
zabbix 12066 0.0 0.0 7188 788 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
zabbix 12067 0.0 0.0 7188 788 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
zabbix 12068 0.0 0.0 7188 788 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
zabbix 12069 0.0 0.0 8232 912 ? SN 11:08 0:00 /usr/local/sbin/zabbix_agentd
root 12089 0.0 0.0 52148 768 pts/3 S+ 11:08 0:00 grep zabbix_agent
[root@hyde init.d]#

cd /etc/rc3.d/
ln -s ../init.d/zabbix_agent_stop.sh K20zabbix-agent
ln -s ../init.d/zabbix_agent_start.sh S20zabbix-agent

Test the proper operation of the agent

Connect on vmoni with root account

cd /usr/local/bin

root@vmoni:~# zabbix_get -p 10050 -k agent.version -s servername

1.8.5

Must return the version of the zabbix agent.


NLE notes, test oracle probes

[zabbix@hyde ERPTEST sbin]$ ./zabbix_agent -c /etc/zabbix/zabbix_agentd.conf -t ora-check-instance-erptest

root@vmoni:/etc/zabbix# zabbix_get -s hyde.faiveleytransport.local -p 10050 -k ora-check-instance-erptest
ZBX_NOTSUPPORTED

root@vmoni:/etc/zabbix# zabbix_get -s 127.0.0.1 -p 10050 -k agent.version
1.8.5
root@vmoni:/etc/zabbix# zabbix_get -s 127.0.0.1 -p 10050 -k testnico
3

3.7 Zabbix Get (UNIX)
Zabbix UNIX Get est un processus qui communique avec l’agent ZABBIX et récupère les informations nécessaires.
Cet utilitaire est généralement utilisé pour résoudre les problèmes des agents ZABBIX.
Zabbix Get peut être démarré en utilisant:
shell> cd bin
shell> ./zabbix_get -s127.0.0.1 -p10050 -k »system.cpu.load[all,avg1] »
Zabbix Get accepte les paramètres en ligne de commandes suivants:
-p –port Spécifie le port de l’agent qui fonctionne sur l’hôte. La valeur par défaut est 10050.
-s -host Spécifie le nom machine ou l’adresse IP de l’hôte.
-I –source-address Spécifie l’adresse IP source
-k -key Spécifie le nom de la métrique (clé) que nous voulons récupérer.
-h –help Affiche cette aide.
-v –version Affiche la version.
Pour afficher cette aide:
shell> zabbix_get -h

Vérification d’un item

root@vmoni:~# zabbix_get -s hyde.faiveleytransport.local -p 10050 -k oracle[latchfree,erptest,gpbatch,hornet]
658

root@vmoni:~# zabbix_get -s hyde.faiveleytransport.local -p 10050 -k oracle[version,erptest,gpbatch,hornet]
Oracle Database 10g Release 10.2.0.4.0 – 64bit Production

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *