Handle multiple zabbix servers
Handle if multiple servers are specified in zabbix_agent.conf
This commit is contained in:
parent
78bac675b7
commit
7a7a0b765a
@ -341,10 +341,13 @@ sub zabbix_config {
|
|||||||
sub zabbix_post {
|
sub zabbix_post {
|
||||||
my $key = $_[0];
|
my $key = $_[0];
|
||||||
my $val = $_[1];
|
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");
|
system("$cmd >/dev/null");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub var_config {
|
sub var_config {
|
||||||
|
Loading…
Reference in New Issue
Block a user