Search Windows and Linux Networking

Friday, June 3, 2011

How to Install Zabbix Agent on Windows


Installing Zabbix Agent on Windows

Download zabbix agent file from http://www.zabbix.com/download.php and unzip that.

Open command prompt from Start > Run and  then type cmd then click ok

Create new folder for zabbix agent

mkdir c:\Program Files\zabbix

Now copy zabbix_agentd.exe, zabbix_get.exe and zabbix_sender.exe from win32 folder if your OS is x86 else copy from win64 for x64 bit

From command prompt run following command  to create configuration file for zabbix_agent

Note: - change IP Address of Zabbix server instead of 192.168.73.242 . Please be sure that commands are in single line
Echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
Echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
 "C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –i
 "C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –s

Now zabbix agent service is installed and started as automatic start.

OR

You can create batch file for installing zabbix agent . batch file copy that three files from share folder, Create new directory for zabbix agent  then copy required files and install and start service you only need run that zabbix_agent_windows.bat file

@echo off
echo copying exe
net use m: \\ipaddOfShareHost\Share\zabbix_Windows_agent\zabbix_agents_1.8.5.win
mkdir "c:\Program Files\zabbix"
xcopy m:\win32 "c:\Program Files\zabbix"
net use m: /delete
echo Creating configuration for %COMPUTERNAME%...
echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
echo Installing system service...
"c:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" -i
echo Starting agent...
"c:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" -s
echo Finished!
pause


Thursday, June 2, 2011

Monitoring Router or Other Devices using Simple check with Ping (ICMP) in Zabbix


Monitoring Router or Other Devices using Simple check with Ping (ICMP) in Zabbix

For ICMP check Zabbix required different utility for Ping (ICMP echo  ) that is fping. To support Zabbix to simple check you have to first install fping and set the location for fping

fping :- fping is a ping-like program which can determine the accessibility of multiple hosts using ICMP echo requests. fping is designed for parallelized monitoring of large numbers of systems, and is developed with ease of use in scripting in mind.

Install fping :-

You can install fping with following command :-

# yum install fping

Or You can install it by tarbell file



# tar -zxvf fping.tar.gz
# cd fping-2.4b2_to/
# ./configure
# make
# make check
# checkinstall
OR
# make install


Note:- Zabbix server must know where to find fping and be able to execute it.

First check the correct path of fping and then modify zabbix_server.conf file for correct path

# whereis fping
fping: /usr/local/sbin/fping

Now give necessary permission  
# ls -l /usr/local/sbin/fping
-rwxr-xr-x 1 root root 48903 Jun  2 11:01 /usr/local/sbin/fping
# chgrp zabbix /usr/local/sbin/fping
# ls -l /usr/local/sbin/fping
-rwxr-xr-x 1 root zabbix 48903 Jun  2 11:01 /usr/local/sbin/fping
# chmod 4710 /usr/local/sbin/fping
# ls -l /usr/local/sbin/fping
-rws--x--- 1 root zabbix 48903 Jun  2 11:01 /usr/local/sbin/fping

# vi /etc/zabbix/zabbix_server.conf

FpingLocation=/usr/local/sbin/fping

Now restart zabbix server service for changes take effect .

# service zabbix_server restart
Now Zabbix is ready for simple icmp check.

Now open http://ip-address/zabbix and Login to Zabbix as admin

If you have not already added host add it first before creating item

Crate New Host for Router.

To crate new host go to configuration | Hosts and Select Create Host. In New host form type the host name of Router. Basically Router and switch are SNMP supported devices so select SNMP Devices in Group field. Then type the IP Address of Router and then Save the host.

Now we have added Router to our Zabbix monitoring software but it not knowing what to check so for that we have to create item to know Zabbix what to check and using which method. We can be monitor Router using SNMP or by simply sending ping request.

 For now we check our router is live or not using simple check.

So click Item next to Route we just added and then click Crate Item. In Crate Item new form Host is already selected as your router. In description box type the description for the test. For example  Network Reachability using ping . In Type drop down box select Simple Check . In key box type icmpping. In type of information drop down menu select Numeric (float). In Units box type ms . In update interval (in Sec) change it to 60 and show value drop down menu select host status and save the item by clicking Save.

Now we have created test to check network reachability of router. Now we want zabbix have to send a mail if router is unreachable for that we have to create trigger and action. Because we have already configured action for trigger; we have to crate trigger for newly created item. So for that click on trigger next to Router we have added and click Create Trigger . In new Trigger form type the identical information that sense as what is wrong
Type that in Name field. For, example Router is down or unreachable.
In expression field click add this will open new page for condition. Click Select next to item box and then select item we just created Network Reachability using ping and then click insert and then click save.


Now when ever our router get down or unreachable Zabbix will send mail saying that Router is down or unreachable.