<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Start OneAgent in off mode in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250402#M33071</link>
    <description>&lt;P&gt;No, oneagents (either full stack or pass) cannot be started deactivated. You can always deactivate and reactivate them using Settings API. That's exactly what we are doing with the extension.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2024 14:02:21 GMT</pubDate>
    <dc:creator>Julius_Loman</dc:creator>
    <dc:date>2024-07-11T14:02:21Z</dc:date>
    <item>
      <title>Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250259#M33067</link>
      <description>&lt;P&gt;Hello dear community, I turn to your infinite wisdom for guidance. I have some Kubernetes clusters in a QA environment that are turned off every night and turned on the next day. I have Dynatrace installed on these clusters, but I generally use it on-demand. The problem occurs every morning when the clusters are turned on, they come up with a new name and this causes the configuration I left the day before (turning off One-agent monitoring) to be lost and One-agent to start in ON mode.&lt;/P&gt;
&lt;P&gt;Is it possible or is there any configuration in the One-agent installation that starts in OFF monitoring mode?&lt;/P&gt;
&lt;P&gt;I appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ellery_0-1720615782713.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21040i5BE9D56299525179/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ellery_0-1720615782713.png" alt="Ellery_0-1720615782713.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 13:38:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250259#M33067</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-07-12T13:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250265#M33069</link>
      <description>&lt;P&gt;We have developed an extension 2.0 which allows you to define profiles and sets one agent modes accordingly to the profile for new connected OneAgents. If you are interested, reach out to me here in the thread.&lt;/P&gt;&lt;P&gt;With Kubernetes it also depends on your deployment mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can be also accomplished by workflows - if you are on SaaS.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 13:04:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250265#M33069</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-07-10T13:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250270#M33070</link>
      <description>&lt;P&gt;We are currently using the DPS and SaaS model. The installation was done with HELM and with the dynakube.yaml file that Dynatrace suggests in its installation guide. Is it not possible to set monitoring=off in dynakube.yaml or something similar to make it start up turned off?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 13:58:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250270#M33070</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-07-10T13:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250402#M33071</link>
      <description>&lt;P&gt;No, oneagents (either full stack or pass) cannot be started deactivated. You can always deactivate and reactivate them using Settings API. That's exactly what we are doing with the extension.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 14:02:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250402#M33071</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-07-11T14:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250524#M33083</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;SPAN&gt; How can I enable or disable monitoring with OneAgent on Kubernetes using the extension you mentioned?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 16:13:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250524#M33083</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-07-12T16:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250673#M33103</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/65321"&gt;@Ellery&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I understand your problem, however I think it can be solved by configuring the Process Group, Services Name rules, Container rules, &lt;STRONG&gt;Host naming&lt;/STRONG&gt; &lt;span class="lia-unicode-emoji" title=":flexed_biceps:"&gt;💪&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My best recommendation is that you evaluate those rules and your problem could be solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;BR /&gt;I hope its help &lt;span class="lia-unicode-emoji" title=":flexed_biceps:"&gt;💪&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 22:15:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/250673#M33103</guid>
      <dc:creator>PierreGutierrez</dc:creator>
      <dc:date>2024-07-15T22:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/255237#M33691</link>
      <description>&lt;P&gt;I found the solution in a workflow, and using JavaScript, we search for each monitored host, filter them based on the pattern we need, and then shut them down. Here's the code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var https://{environmentid}.live.dynatrace.com/api/v2/";
//const request = require('request');
const schemaIds = "builtin:host.monitoring"


var api_token_entities = "&amp;lt;token TOKEN READ WRITTE ENTITIES&amp;gt;"; 
var api_token =  "&amp;lt;TOKEN ONEAGENT - READ - WRITTE&amp;gt;";
// Step 1: Get all Object Ids for HOST schema
const options = {
  method: 'GET',
  headers: {
    'Authorization': `Api-Token ${api_token}`
  }
};

const disable_host_group = ["qa-xxxxxx", "qa-yyyyyyy", "qa-ddddddd",  "qa-sssssssss"]

https://{environmentid}.live.dynatrace.com/api/v1/oneagents`, options, (response) =&amp;gt; {     

    let data = '';
  
  response.on('data', (chunk) =&amp;gt; {
    data += chunk;
  });

  response.on('end', () =&amp;gt; {
    const hostObjects = JSON.parse(data);
    if ("error" in hostObjects) {
      console.log(`Error occurred: ${hostObjects.error.message}`);
      process.exit(1);
    }

    const hosts = hostObjects["hosts"]

    Object.keys(hosts).forEach(key =&amp;gt; {

      var cluster = hosts[key]["hostInfo"]["kubernetesCluster"];
      var estado = hosts[key]["availabilityState"];
      var entityID = hosts[key]["hostInfo"]["entityId"];
      
      try {
        var hostgroupID = hosts[key]["hostInfo"]["hostGroup"]["meId"];
      } catch (error) {
        var hostgroupID = "nulo";
      }

      try {
        var hostGroup = hosts[key]["hostInfo"]["hostGroup"]["name"];
      } catch (error) {
        var hostGroup = "nulo";
      }
     
      if(disable_host_group.includes(hostGroup)) {
        if(estado == "MONITORED"){
          console.log(key + " " + entityID + " ---&amp;gt; " + cluster + " ---&amp;gt; " + estado + " ---&amp;gt; " + hostgroupID + " ---&amp;gt; " + hostGroup );
          update(entityID);
        }
      }
    });
  
  });
 
  
}).on("error", (error) =&amp;gt; {
  console.error(`Error: ${error.message}`);
});   


// Configura las opciones para la solicitud

function update(host) {

    console.log("inicio actualizacion : " + host)

  const options_update = {
    hostname: '&amp;lt;tenantdyantrace&amp;gt;.live.dynatrace.com',
    port: 443,
    path: '/api/v2/settings/objects/?scope='+host,
    method: 'POST',
    headers: {
      'Accept': 'application/json; charset=utf-8',
      'Content-Type': 'application/json; charset=utf-8',
      'Authorization': `Api-Token ${api_token_entities}`
    }
  };
    
  // make the petition
  const req_update = https.request(options_update, (res) =&amp;gt; {
    let data1 = '';
  
    // Reception the data
    res.on('data1', (chunk) =&amp;gt; {
      data1 += chunk;
    });
  
    // when the answere end, process data
    res.on('end', () =&amp;gt; {
      //console.info('Response:', data1);
    });
  });
  
  // error management
  req_update.on('error', (e) =&amp;gt; {
    console.error('Error:', e.message);
  });
  
  // send data
  const postData = JSON.stringify([{
    "schemaId": "builtin:host.monitoring",
    "scope": host,
    "value": { "enabled": false }
  }]);
  
  req_update.write(postData);
  req_update.end();

      console.log("update end: " + host)

}&lt;/LI-CODE&gt;&lt;P&gt;i hope this solution can help somebody&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 11:50:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/255237#M33691</guid>
      <dc:creator>Ellery</dc:creator>
      <dc:date>2024-09-09T11:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Start OneAgent in off mode</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/255301#M33700</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/65321"&gt;@Ellery&lt;/a&gt;&amp;nbsp;our extension allows you to configure newly connected OneAgents and disable them or switch the monitoring mode according to the defined rules, I think the screenshot says it all.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julius_Loman_0-1725949566153.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22265i8A806BDFFD088A47/image-size/large?v=v2&amp;amp;px=999" role="button" title="Julius_Loman_0-1725949566153.png" alt="Julius_Loman_0-1725949566153.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 06:28:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Start-OneAgent-in-off-mode/m-p/255301#M33700</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-09-10T06:28:01Z</dc:date>
    </item>
  </channel>
</rss>

