PDA

View Full Version : External script with parameters on Zabbix Server


Mojah
15-09-2010, 18:04
Hi,

I'm trying to do the following:
Item for the "forward DNS" of a host
Item for the "reverse DNS" of a host
Trigger if they don't match.

I thought I could create an external script that would run on the Zabbix Server (not on each individual host via the Zabbix Agent).

I want to fire an external script, and give it an extra parameter: either the DNS name, or the IP address as configured in Zabbix Server.

But firing an external script, doesn't allow passing it parameters that are properties of that host.

Is there another (proper) way of doing it?

The reason I don't prefer using the Zabbix Agent on each server, is because of configuration-management.

Regards,
M.

James Wells
15-09-2010, 22:25
Greetings,
I'm trying to do the following:
Item for the "forward DNS" of a host
Item for the "reverse DNS" of a host
Trigger if they don't match.
The way I did this was with two scripts. One for forward DNS resolution which reported to one item and the second for reverse DNS resolution which reported to a second item. Then I created a "complex" trigger comparing the two values;
{HostName:script_dns_forward.last(0)}#{HostName:sc ript_dns_reverse.last(0)}

There are much more efficient ways to do this, but I wanted to capture the information as well as trigger on it.

Mojah
15-09-2010, 23:17
Hi James,

Did you do this by specifying a hostname/ip directly in your script?

I seem to get stuck at having zabbix pass parameters to my script, so I can use 1 script that will check the forward/reverse DNS, depending on which hostname or IP is being passed as an argument.

Regards,
M.

James Wells
15-09-2010, 23:34
Did you do this by specifying a hostname/ip directly in your script?
Unless this changed recently, the Zabbix server passes the affected hostname as the argument for external checks.