Avoid shelling out to sysctl when we can read /proc/sys
authorTom Hughes <tom@compton.nu>
Sat, 23 Nov 2013 12:13:18 +0000 (12:13 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 23 Nov 2013 12:13:18 +0000 (12:13 +0000)
cookbooks/munin/recipes/default.rb

index 33f51097ea44839c2064d4ac6822eb1afcfd65eb..3a5be0d61513b92a9b7a0cdae4e1b1c488318095 100644 (file)
@@ -116,7 +116,7 @@ else
   end
 end
 
-if %x{sysctl -n net.ipv4.ip_forward}.chomp == "1"
+if File.read("/proc/sys/net/ipv4/ip_forward").chomp == "1"
   munin_plugin "fw_packets"
 else
   munin_plugin "fw_packets" do