diff --git a/src/datastore_mad/remotes/fs/monitor b/src/datastore_mad/remotes/fs/monitor index 2ac5a049ac..69b76dc3c9 100755 --- a/src/datastore_mad/remotes/fs/monitor +++ b/src/datastore_mad/remotes/fs/monitor @@ -50,14 +50,20 @@ BASE_PATH="${XPATH_ELEMENTS[0]}" # ------------ Compute datastore usage ------------- -USED_MB=`du -sLm $BASE_PATH | cut -f1` -TOTAL_MB=`df -B1M --output=size $BASE_PATH | tail -1` -FREE_MB=`df -B1M --output=avail $BASE_PATH | tail -1` +if [ ! -d $BASE_PATH ]; then + error_message "Directory $BASE_PATH does not exists" + exit -1 +fi -MONITOR_DATA=</dev/null | cut -f1` +TOTAL_MB=`df -B1M --output=size $BASE_PATH 2>/dev/null | tail -1` +FREE_MB=`df -B1M --output=avail $BASE_PATH 2>/dev/null | tail -1` + +MONITOR_DATA=$(cat <get(id, true); + + if (ds == 0 ) + { + return; + } + + ds_name = ds->get_name(); + + ds->update_monitor(total, free, used); + + dspool->update(ds); + + ds->unlock(); + + oss << "Datastore " << ds_name << " (" << id << ") successfully monitored."; + + NebulaLog::log("ImM", Log::INFO, oss); + + return; } /* -------------------------------------------------------------------------- */ @@ -612,7 +651,7 @@ void ImageManagerDriver::protocol(const string& message) const int id; oss << "Message received: " << message; - NebulaLog::log("ImG", Log::DEBUG, oss); + NebulaLog::log("ImG", Log::DDEBUG, oss); // --------------------- Parse the driver message --------------------------