diff --git a/src/htcondor_cc_sync_plugin.cpp b/src/htcondor_cc_sync_plugin.cpp index 596017f..bb8a12a 100644 --- a/src/htcondor_cc_sync_plugin.cpp +++ b/src/htcondor_cc_sync_plugin.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -379,6 +380,15 @@ void CCSyncPlugin::sendPostRequest(const std::string &route, } } +bool toBool(const std::string &value) { + if (std::atoi(value.c_str())) + return true; + std::string lower; + std::transform(value.begin(), value.end(), std::back_inserter(lower), + ::tolower); + return lower == "true" || lower == "yes" || lower == "on"; +} + void CCSyncPlugin::endTransaction() { if (initializing) { // HTCondor bug? We should'n be receiving events before // initialization is done. We will ignore them if it @@ -412,6 +422,13 @@ void CCSyncPlugin::endTransaction() { continue; } else continue; + if (auto noMonitoringIt = job.find("NoMonitoring"); + noMonitoringIt != job.end() && toBool(noMonitoringIt->second)) { + dprintf(D_VERBOSE, + "Upon NoMonitoring ClassAd, not monitoring job %d.%d\n", + jobId.first, jobId.second); + continue; + } if (state == RUNNING) { auto jobBatchNameIt = job.find("JobBatchName");