projects
/
upsgraph
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e18c93b
)
fork fork away
author
Michael Gernoth
<michael@gernoth.net>
Thu, 17 Dec 2009 15:20:35 +0000
(16:20 +0100)
committer
Michael Gernoth
<michael@gernoth.net>
Thu, 17 Dec 2009 15:20:35 +0000
(16:20 +0100)
upsgraph.pl
patch
|
blob
|
blame
|
history
diff --git
a/upsgraph.pl
b/upsgraph.pl
index 745a44cbe2dae92c4a3b7d3ea17bbab1417a35e1..073a43950fdcee69dd8e6fd8320956eace370fc0 100755
(executable)
--- 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 .= "\"";
Impressum
,
Datenschutz