Zabbix --> the client setup and how to add dynamic monitoring database view

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Prerequisites: the Zabbix server has been installed, and the normal operation of.


1 need to download the ZABBIX client, to install the client, to open the port 10050

wget http://www.zabbix.com/downloads/2.0.8/zabbix_agents_2.0.8.linux2_6.amd64.tar.gz

Add Zabbix users and groups.

groupadd zabbix

useradd zabbix -g zabbix -s /sbin/nologin

2 decompression

Tar –xvf zabbix_agents_2.0.8.linux2_6.amd64.tar.gz

Mv zabbix_agents_2.0.8.linux2_6.amd64 /usr/local/zabbix_2.0.8

[root@db-m2-slave-1 zabbix_2.0.8]# ll

The total amount of 296

Drwxr-xr-x. 2 root root 40964 13:06 bin 26

Drwxr-xr-x. 3 root root 40964 15:20 conf 26

Drwxr-xr-x. 2 root root 40964 14:27 SBIN 26

-Rw-r--r--. 1 root root 102013 zabbix_agents_2.0.8.linux2_6_23.amd64.tar.gz 2888109

[root@db-m2-slave-1 zabbix_2.0.8]#

3 boot

[root@db-m2-slave-1 sbin]# nohup /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start -c & > zabbix.log

[1] 18785

[root@db-m2-slave-1 sbin]# Nohup: ignores the input and the output is appended to the"nohup.out"


[root@db-m2-slave-1 sbin]# more nohup.out

zabbix_agentd [18584]: cannot open config file [/usr/local/etc/zabbix_agentd.conf]: [2] No such file or directory

zabbix_agentd [18785]: zbx_option requires an argument -- c

usage: zabbix_agentd [-Vhp] [-c <config-file>] [-t <item key>]

Error loading can not configure file, a soft connection

ln -s /usr/local/zabbix_2.0.8/conf/zabbix_agentd.conf /usr/local/etc/zabbix_agentd.conf


Start again

[root@db-m2-slave-1 sbin]# nohup /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start & > zabbix.log

[1] 18920

[root@db-m2-slave-1 sbin]# Nohup: ignores the input and the output is appended to the"nohup.out"


[1]+ Done nohup /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

[root@db-m2-slave-1 sbin]#

4 final view startup log information, not the new record, said start-up success.

[root@db-m2-slave-1 sbin]# more nohup.out

zabbix_agentd [18811]: zbx_option requires an argument -- c

usage: zabbix_agentd [-Vhp] [-c <config-file>] [-t <item key>]

zabbix_agentd [18826]: user zabbix does not exist

zabbix_agentd [18826]: cannot run as root!

5 see zabbix_agent starting a background process

[root@db-m2-slave-1 sbin]# ps -eaf|grep zabbix

zabbix 18922 1 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

zabbix 18923 18922 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

zabbix 18924 18922 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

zabbix 18925 18922 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

zabbix 18926 18922 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

zabbix 18927 18922 0 13:21 ? 00:00:00 /usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

root 18947 8652 0 13:21 pts/0 00:00:00 grep zabbix

6 Automatic Add startup script

ln -s /usr/local/zabbix_2.0.8/sbin/zabbix_agentd /etc/init.d/zabbix_agentd

chmod 755 /etc/init.d/zabbix_agentd

[root@db-m2-slave-1 sbin]# chkconfig --add zabbix_agentd

The zabbix_agentd service does not support chkconfig


chkconfig -- level 345 zabbix_agentd on

[root@db-m2-slave-1 sbin]# chkconfig --level 345 zabbix_agentd on

The zabbix_agentd service does not support chkconfig

[root@db-m2-slave-1 sbin]#
​vi /etc/init.d/Zabbix_agentd head and description
#!/bin/sh
# chkconfig: 345 95 95
# description: zabbix_agentd


Failure


7 off the zabbix_agentd process

killall -9 zabbix_agentd



8 add a custom control

8.1 in the database HOST, modify the VI /usr/local/etc/zabbix_agentd.conf

UnsafeUserParameters=1 the default is 0 (not allow custom script)

Then add UserParameter=key behind,command

key,Command format

Here key is complete when creating the item


Add the following items in it:

UnsafeUserParameters=1

UserParameter=mysql.ping_test[*],mysqladmin -u$1 -p$2 ping|grep alive|wc –l

8.2 to restart the zabbix_agentd service.

8.3 check service

[root@cache-2 zabbix]# /usr/local/zabbix/bin/zabbix_get -s 10.254.3.72 -k mysql.ping_test['root','']

0

Has been 0, but the execution of the mysqladmin returned is 1 in the database server machine

[root@db-m2-slave-1 conf]# mysqladmin -uroot ping|grep alive|wc -l

1

[root@db-m2-slave-1 conf]#


Check the ZABBIX error log information is as follows:

[root@db-m2-slave-1 sbin]# tail -f zabbix_agentd.log

Tail: cannot open the " zabbix_agentd.log" read data: not that file or directory

[root@db-m2-slave-1 sbin]# tail -f /tmp/zabbix_agentd.log

sh: mysqladmin: command not found

sh: mysqladmin: command not found

sh: mysqladmin: command not found

Reset the full path to the mysqladmin, and restart the zabbix_agentd service, and then the check state


[root@cache-2 zabbix]# /usr/local/zabbix/bin/zabbix_get -s 10.254.3.72 -k mysql.ping_test['root','']

1

[root@cache-2 zabbix]#

9 server web site configuration Item

Need to select the server in the server list to monitor the HOST, open the Items of the following options, click it, and then click the upper right corner of the Create item.

Click on the Items-create Itmes.




Enter the key valuemysql.ping_test[root,'']



The input is complete, click on the Save button, save.



The 10 configuration graph

Click graphs---create graph, select Items in the ADD mysql.ping_test--save, wait a while drawing




11 then go to the ZABBIX interface, you will find the picture can generate



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Eudora at October 21, 2014 - 7:25 AM