Handle multiple zabbix servers
Handle if multiple servers are specified in zabbix_agent.conf
This commit is contained in:
parent
78bac675b7
commit
7a7a0b765a
@ -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'";
|
||||
system("$cmd >/dev/null");
|
||||
foreach my $server (@servers) {
|
||||
my $cmd = "zabbix_sender -z $server -p 10051 -s $zabbix_host -k $key -o '$val'";
|
||||
system("$cmd >/dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user