PDA

View Full Version : Local checks with Windows Zabbix agent


bytesize
15-01-2006, 22:23
Hi,

I would like to test a webserver is running on the same machine which a Zabbix agent is running on. I cannot run a simple check from the Zabbix server because of firewalls.

I need something like check_service[http] but everything I try comes up as "Not Supported". The Zabbix agent needs to connect to HTTP on localhost and then report the status back to the Zabbix server.

How can I do this?

Thanks!

John

Nate Bell
16-01-2006, 16:07
You could create a UserParameter that uses wget to connect to the localhost, grab a page that will always contain a specific piece of text, grep for that string of text, and return a value depending on what you find, say 0 for text not found, and 1 if it is.

To save you some time (since I just used wget in this way recently) here is a rough sketch of what your UserParameter could look like:

echo $(wget -q --bind-address=localhost http://www.myzabbixserverpage.com | grep "ameaningfulstring" | wc -l )

Nate

bytesize
16-01-2006, 17:58
Hi,

Thanks for the reply but I need to do this using a Windows Zabbix client.

John

elkor
16-01-2006, 18:44
My first response would have been identical to nate's.

then you said windows

I'm not the best windows guy, but I don't know of any command-line only http tool for windows. Even with windows services for unix installed you don't get wget, curl, or lynx. You do get a posix environment that you could probably compile those tools in.. but that may be more than you really want to do on a production box.

my advice in your situation would be to set up a "sensor" box on your dmz or another network that CAN access the webservers, running unix/linux, and define your various website checks on that. then use zabbix to monitor that box and validate the HTML, as a bonus you could also calculate web response time and such.

Wolfgang
18-01-2006, 11:42
Hi,

Thanks for the reply but I need to do this using a Windows Zabbix client.

John

Maybe you want to try wget for windows:
http://www.interlog.com/~tcharron/wgetwin.html