added TAGS=dc=ffzg
[atop-influxdb] / atop2influx.pl
index d56c4da..1bb781b 100755 (executable)
@@ -20,6 +20,9 @@ sub update_time {
        return $time;
 }
 
+my $tags = $ENV{TAGS};
+$tags = ",$tags" unless $tags =~ m/^,/;
+
 while(<>) {
        chomp;
        next if /^$/;
@@ -60,7 +63,7 @@ while(<>) {
        next if $measurement =~ /top3/; # FIXME this isn't parsed yet
 
        #XXX { cols => \@cols, vals => \@vals };
-       print "atop_$measurement,host=$host";
+       print "atop_$measurement,host=$host$tags";
        my $d = " ";
        foreach my $i ( 0 .. $#cols ) {
                if ( my $c = $cols[$i] ) {