PDA

View Full Version : PATCH: Allow use of server Hostname or IP in agent config


James Wells
30-08-2005, 04:56
Greetings,

This patch was originally contributed by Simon Matter, I have simply updated it and migrated it to work under the Zabbix 1.1

The intention of this patch is to allow the use of either the IP or hostname of the server in the zabix_agentd.conf file. Presently, when you set the Server entry, it requires and will only process IP addresses. This makes can make it difficult to manage large or dynmic networks. Additionally, this patch will move the system one step closer to supporting multiple zabbix servers against a single database.

EDIT: This patch is upgraded to support 1.1Beta1 and is against the latests CVS repository at time of submission.

EDIT: Code is attached as file.

sauron
30-08-2005, 11:08
You can compress & attach patches ?

James Wells
01-09-2005, 06:45
LOL!!! Finally figured out how to attach files. DOH!!!

axel
08-09-2005, 13:23
hi again

ok i edit my includes/security.c with the changes.
Than i recompile it with ./configure --enable-agent --prefix=/..../...

now i start the new agentd again but i have the same Problem

do i miss something ?

James Wells
08-09-2005, 15:31
What is the problem you are having?

Alexei
20-09-2005, 10:52
May I ask you to send me patched file security.c. Memory is not allocated for variable sname, it makes me worry about the whole patch.

James Wells
20-09-2005, 19:31
Ummm. Yeah, not really sure what happened, but the patch that is attached here is definately broken. I am in the process of re-creating the patch against the newest CVS branch, but I am also going to attach the corrected patch against Zabbix-1.1alpha12 as well as the patched security.c from Zabbix-1.1alpha12.

James Wells
26-10-2005, 00:27
Okay, I had forgotten about this one. Anyway, I was a dufus and forgot to update the header files when Alexei moved security.c which was causing it to fail to compile. Here is the corrected patch against the latest CVS.

razorgt
07-11-2005, 20:42
I am new to zabbix. What is the best way to apply this patch?

Thanks for the understanding, I am kind of a newb.

Glenn

James Wells
07-11-2005, 21:27
Go into the parent directory of your zabbix source tree, and use the command 'patch -p0 < zabbix-1.1beta3-ServerByName.patch.txt' Then cd into the Zabbix directory and re-run the make.

Please note that this is actually in the mainline for the 1.1beta3 release, so if you want wait for 1.1bet3 release, the patching will be taken care of for you. :)

razorgt
08-11-2005, 00:35
I applied the patch, no errors "patched security.c" Did a make to rebuild everything, re-ran zabbix_server. It still can't communicate with my windows boxes using my server as the hostname, only the IP works. I have my hostname setup through DNS, I can communicate with that hostname from my windows boxes. Any idea what the problem could be?

Glenn

James Wells
08-11-2005, 00:49
Unfortunately, the zabbixW32 version does not use the security.c file from what I understand, and my patch does not extend the functionality to it, only to the Unix / Linux versions.