From 6aa53fc5257183707fa0e2f56fb210b1fadad7a6 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 17 Dec 2009 16:20:35 +0100 Subject: [PATCH] fork fork away --- upsgraph.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/upsgraph.pl b/upsgraph.pl index 745a44c..073a439 100755 --- a/upsgraph.pl +++ b/upsgraph.pl @@ -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 .= "\""; -- 2.39.5