summaryrefslogtreecommitdiff
path: root/munin
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-06-23 23:02:28 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-06-23 23:02:28 +0000
commitc89a903fdec940c620793104996199c3e87cb90f (patch)
tree41a5c04157de37e3bcd0c66930155091e9b8eef4 /munin
parent6c4f37d17cd98b1079dffce7365063a2e4ade976 (diff)
Retry gathering data
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@144 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'munin')
-rwxr-xr-xmunin/owfs_temperature_11
1 files changed, 11 insertions, 0 deletions
diff --git a/munin/owfs_temperature_ b/munin/owfs_temperature_
index ae9241c..10277b9 100755
--- a/munin/owfs_temperature_
+++ b/munin/owfs_temperature_
@@ -79,6 +79,17 @@ def report
Process.gid=0
Process.egid=0
temp = nil
+
+ # Sometimes the directory in OWFS does not exist, and cat will say
+ # cat: /var/lib/owfs/10.D234EE000800/temperature: Invalid argument
+ #
+ # ls'ing the directory help, let's see if stating it does too.
+ 5.times do
+ break if File.directory?($owfs_path + '/' + device)
+ STDERR.puts "Directory '#{$owfs_path}/#{device}' does not exist right now (or isn't a directory). Sleeping a bit."
+ sleep 1
+ end
+
# fuse does weird checks. this fails:
# File.new($owfs_path+'/'+device+'/temperature', "r") ---> FAILS: in `initialize': Permission denied - /var/lib/owfs/10.D234EE000800/temperature (Errno::EACCES)
IO.popen("-") do |f|