advertisment ;-)
[upsgraph] / upsgraph.pl
index 745a44cbe2dae92c4a3b7d3ea17bbab1417a35e1..aa777210125b94c4fafe92b5e554da58e52288d8 100755 (executable)
@@ -110,6 +110,12 @@ if (! -e "${rrdfile}") {
        print `${cmd}`;
 }
 
+my $child = fork();
+
+die "fork failed!" if (!defined($child));
+
+exit 0 if ($child != 0);
+
 while(1) {
        ($session,$error) = Net::SNMP->session(Hostname => $host,
                        Community => $community);
@@ -137,7 +143,6 @@ while(1) {
                if (!(defined($vars->{$var}->{'value'}))) {
                        $vars->{$var}->{'value'} = 'U';
                }
-               print $vars->{$var}->{'name'}.": ".$vars->{$var}->{'value'}."\n";
                $cmd .= ":" . $vars->{$var}->{'value'};
        }
        $cmd .= "\"";
@@ -164,6 +169,7 @@ while(1) {
 
        print HTML "</body></html>\n";
        print HTML "<br>Generated on: " . localtime(time());
+       print HTML ' by <a href="http://git.zerfleddert.de/cgi-bin/gitweb.cgi/upsgraph">upsgraph</a>.';
 
        close(HTML);
 
Impressum, Datenschutz