Signed-off-by: Pavel Andreev <[email protected]>
---
 PVE/Status/Graphite.pm |    6 +++++-
 PVE/Status/Plugin.pm   |    4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm
index 849930f..50075cc 100644
--- a/PVE/Status/Graphite.pm
+++ b/PVE/Status/Graphite.pm
@@ -7,6 +7,7 @@ use PVE::Status::Plugin;
 # example config (/etc/pve/status.cfg)
 #graphite:
 #      server test
+#      secondary_server test
 #      port 2003
 #      path proxmox.mycluster
 #      disable 0
@@ -30,6 +31,7 @@ sub properties {
 sub options {
     return {
        server => {},
+        secondary_server => {},
        port => { optional => 1 },
        path => { optional => 1 },
        disable => { optional => 1 },
@@ -64,7 +66,8 @@ sub update_storage_status {
 sub write_graphite_hash {
     my ($plugin_config, $d, $ctime, $object) = @_;
 
-    my $host = $plugin_config->{server};
+    my @hosts = ($plugin_config->{server},$plugin_config->{secondary_server});
+    foreach my $host (@hosts) {
     my $port = $plugin_config->{port} ? $plugin_config->{port} : 2003;
     my $path = $plugin_config->{path} ? $plugin_config->{path} : 'proxmox';
 
@@ -78,6 +81,7 @@ sub write_graphite_hash {
 
     $carbon_socket->close() if $carbon_socket;
 
+    }
 }
 
 sub write_graphite {
diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm
index ff7af89..8e40d58 100644
--- a/PVE/Status/Plugin.pm
+++ b/PVE/Status/Plugin.pm
@@ -30,6 +30,10 @@ my $defaultData = {
            type => 'string', format => 'address',
            description => "server dns name or IP address",
        },
+        secondary_server => {
+            type => 'string', format => 'address',
+            description => "server dns name or IP address",
+        },
        port => {
            type => 'integer',
            description => "server network port",
-- 
1.7.9.5

_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to