Handle multiple zabbix servers

Handle if multiple servers are specified in zabbix_agent.conf
This commit is contained in:
szimszon 2016-03-12 22:21:50 +01:00
parent 78bac675b7
commit 7a7a0b765a

View File

@ -341,9 +341,12 @@ sub zabbix_config {
sub zabbix_post {
my $key = $_[0];
my $val = $_[1];
my @servers = split(',', $zabbix_server);
my $cmd = "zabbix_sender -z $zabbix_server -p 10051 -s '$zabbix_host' -k $key -o '$val'";
foreach my $server (@servers) {
my $cmd = "zabbix_sender -z $server -p 10051 -s $zabbix_host -k $key -o '$val'";
system("$cmd >/dev/null");
}
}