From 55ef68ae46bd51ed13ef097112c13970eebf5492 Mon Sep 17 00:00:00 2001 From: John Stange Date: Fri, 15 May 2015 12:12:50 -0400 Subject: [PATCH] wrap Nagios self-check fix so as not to break on older versions --- cookbooks/mu-master/recipes/update_nagios_only.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cookbooks/mu-master/recipes/update_nagios_only.rb b/cookbooks/mu-master/recipes/update_nagios_only.rb index 2e6fbb1b4..96eb4d406 100644 --- a/cookbooks/mu-master/recipes/update_nagios_only.rb +++ b/cookbooks/mu-master/recipes/update_nagios_only.rb @@ -31,11 +31,13 @@ # Workaround for minor Nagios (cookbook?) bug. It looks for this at the wrong # URL at the moment, so copy it where it's actually looking. -remote_file "/usr/lib/cgi-bin/statusjson.cgi" do - source "file:///usr/lib/cgi-bin/nagios/statusjson.cgi" - mode 0755 - owner "root" - group "nagios" +if File.exists?("usr/lib/cgi-bin/nagios/statusjson.cgi") + remote_file "/usr/lib/cgi-bin/statusjson.cgi" do + source "file:///usr/lib/cgi-bin/nagios/statusjson.cgi" + mode 0755 + owner "root" + group "nagios" + end end ["/usr/lib/nagios", "/etc/nagios", "/etc/nagios3", "/var/log/nagios", "/var/www/html/docs"].each { |dir|