<?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>question Re: ambari custom alert script in host_scripts is not populating to the agent cache after ambari server and agent restart in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/285797#M212035</link>
    <description>&lt;P&gt;As the description mentions that nothing from /var/lib/ambari-server/resources is populated in agent cache, I see a behavior where custom dashboard files which are placed at /var/lib/ambari-server/resources/common-services/AMBARI_METRICS/0.1.0/package/files/grafana-dashboards/HDP/ are also not available in /var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/files/grafana-dashboards/HDP/. How to make this work?&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 14:03:19 GMT</pubDate>
    <dc:creator>SaloniU</dc:creator>
    <dc:date>2019-12-17T14:03:19Z</dc:date>
    <item>
      <title>ambari custom alert script in host_scripts is not populating to the agent cache after ambari server and agent restart</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236375#M198188</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/38149/how-to-create-and-register-custom-ambari-alerts.html" target="_blank"&gt;https://community.hortonworks.com/articles/38149/how-to-create-and-register-custom-ambari-alerts.html&lt;/A&gt; doesn't seems to be working with ambari 2.7.1, stuck at step 3)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;No exception in ambari server or agent logs&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 21:46:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236375#M198188</guid>
      <dc:creator>fpaul</dc:creator>
      <dc:date>2019-03-21T21:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: ambari custom alert script in host_scripts is not populating to the agent cache after ambari server and agent restart</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236376#M198189</link>
      <description>&lt;P&gt;&lt;A rel="user" href="#"&gt;@Franklin&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please try this:&lt;BR /&gt;&lt;BR /&gt;1. On ambari agent host please find this script "/usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py" and then search for a string with 'if the return type is not used'&lt;/P&gt;&lt;PRE&gt;# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # if the return type is not used
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base_dir = self.file_cache.get_service_base_dir(command)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; script_path = self.resolve_script_path(base_dir, script)&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;2. Just add a new line on all agent hosts  &lt;STRONG&gt;self.file_cache.get_host_scripts_base_dir(command)&lt;/STRONG&gt; there as following Just below the commented line:&lt;/P&gt;&lt;PRE&gt;# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # if the return type is not used
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.file_cache.get_host_scripts_base_dir(command)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base_dir = self.file_cache.get_service_base_dir(command)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; script_path = self.resolve_script_path(base_dir, script)&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**NOTE:**&lt;/STRONG&gt; Python is Indentation sensitive so you will need to put the same indentation while adding the line there (else it might cause some syntax error)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;3. Clear the Agent Cache Dir (or move it as backup)&lt;/P&gt;&lt;PRE&gt;# mv /var/lib/ambari-agent/cache /var/lib/ambari-agent/cache_OLD&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;4. Restart the ambari server and agent.&lt;/P&gt;&lt;PRE&gt;# ambari-server restart
# ambari-agent restart &lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;5. Now check the host script dir if it has pulled file the custom scripts from ambari server host.&lt;/P&gt;&lt;PRE&gt;# ls -lart /var/lib/ambari-agent/cache/host_scripts/&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;It looks related to: &lt;A href="https://issues.apache.org/jira/browse/AMBARI-25123" target="_blank"&gt;https://issues.apache.org/jira/browse/AMBARI-25123&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 12:43:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236376#M198189</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-03-22T12:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: ambari custom alert script in host_scripts is not populating to the agent cache after ambari server and agent restart</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236377#M198190</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;, It resolves the issue&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 14:32:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/236377#M198190</guid>
      <dc:creator>fpaul</dc:creator>
      <dc:date>2019-03-22T14:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: ambari custom alert script in host_scripts is not populating to the agent cache after ambari server and agent restart</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/285797#M212035</link>
      <description>&lt;P&gt;As the description mentions that nothing from /var/lib/ambari-server/resources is populated in agent cache, I see a behavior where custom dashboard files which are placed at /var/lib/ambari-server/resources/common-services/AMBARI_METRICS/0.1.0/package/files/grafana-dashboards/HDP/ are also not available in /var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/files/grafana-dashboards/HDP/. How to make this work?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 14:03:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ambari-custom-alert-script-in-host-scripts-is-not-populating/m-p/285797#M212035</guid>
      <dc:creator>SaloniU</dc:creator>
      <dc:date>2019-12-17T14:03:19Z</dc:date>
    </item>
  </channel>
</rss>

