How to install zabbix agent on Windows and backup zabbix database configuration

Jephe Wu - http://linuxtechres.blogspot.com


steps:

1. refer to doc at http://www.zabbix.com/documentation/1.8/manual/processes/zabbix_agentd_win

2. copy 32bit or 64bit unzipped files to c:\Program Files\Zabbix Agent\ (create this directory first)

3. copy configuration file from zabbix source to above directory as zabbix_agentd.conf

An example configuration file is available in Zabbix source archive as misc/conf/zabbix_agentd.win.conf.

EnableRemoteCommands=0
Server=172.16.1.1,172.16.1.2
Hostname=JEPHE
ListenPort=10050
ServerPort=10051
StartAgents=5

4. install it
go to cmd,
cd "Program Files\Zabbix Agent"
zabbix_agentd.exe -c "c:\Program Files\Zabbix Agent\zabbix_agentd.conf" -i

5. go to services.msc, start zabbix agent.

6. test
from agent host, telnet zabbixserver 10051
from server host, telnet zabbixagent 10050

7. add agent host into zabbix monitored server list

========
backup zabbix configuration shell script:

root@db01:~/bin/ # more zabbix_config_backup.sh
#!/bin/sh
DAY=`date +%w`
HOSTNAME=`hostname`
TABLES="acknowledges actions applications autoreg_host conditions config dchecks dhosts drules dservices escalations expressions functions globalmacro graph_theme graphs graphs_items groups help_items hostmacro hosts hosts_groups hosts_profiles hosts_prof
les_ext hosts_templates housekeeper httpstep httpstepitem httptest httptestitem ids images items items_applications maintenances maintenances_groups maintenances_hosts maintenances_windows mappings media media_type nodes opconditions operations opmediatypes profiles proxy_autoreg_host regexps rights screens screens_items scripts services services_links sessions slides slideshows sysmaps sysmaps_elements sysmaps_link_triggers sysmaps_links timeperiods trigger_depends triggers users users_backup users_groups usrgrp valuemaps"
COMMAND="mysqldump -uzabbix -pzabbix zabbix --add-drop-table --add-locks --extended-insert --single-transaction --quick"
DIR="/mysql/config_backup"
DATATABLES="alerts auditlog events history history_log history_str history_str_sync history_sync history_text history_uint history_uint_sync node_cksum proxy_dhistory proxy_history service_alarms services_times trends trends_uint"

# program starts here
$COMMAND --tables $TABLES | gzip > $DIR/zabbix_config_db.$DAY.gz

(echo "From: `hostname`<root@`hostname`>";echo "Subject: Finished daily Zabbix config backup"; echo "To: jwu@domain.com"; echo "";echo "According to Zabbix
.8 network monitoring book page 377, the following tables are data tables, all others are configuration tables"; echo "";echo "$DATATABLES";echo "";echo "running command $COMMAND --tables $TABLES | gzip > $DIR/zabbix_config_db.$DAY.gz"; echo ""; echo "`ls
-lat /srv/mysql/config_backup`") | /usr/sbin/sendmail jwu@domain.com