Created 03-21-2019 02:46 PM
https://community.hortonworks.com/articles/38149/how-to-create-and-register-custom-ambari-alerts.htm... doesn't seems to be working with ambari 2.7.1, stuck at step 3)
No exception in ambari server or agent logs
Created 03-22-2019 05:43 AM
Please try this:
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'
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py # if the return type is not used base_dir = self.file_cache.get_service_base_dir(command) script_path = self.resolve_script_path(base_dir, script)
.
2. Just add a new line on all agent hosts self.file_cache.get_host_scripts_base_dir(command) there as following Just below the commented line:
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py # if the return type is not used self.file_cache.get_host_scripts_base_dir(command) base_dir = self.file_cache.get_service_base_dir(command) script_path = self.resolve_script_path(base_dir, script)
.
**NOTE:** 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)
3. Clear the Agent Cache Dir (or move it as backup)
# mv /var/lib/ambari-agent/cache /var/lib/ambari-agent/cache_OLD
.
4. Restart the ambari server and agent.
# ambari-server restart # ambari-agent restart
.
5. Now check the host script dir if it has pulled file the custom scripts from ambari server host.
# ls -lart /var/lib/ambari-agent/cache/host_scripts/
.
It looks related to: https://issues.apache.org/jira/browse/AMBARI-25123
Created 03-22-2019 05:43 AM
Please try this:
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'
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py # if the return type is not used base_dir = self.file_cache.get_service_base_dir(command) script_path = self.resolve_script_path(base_dir, script)
.
2. Just add a new line on all agent hosts self.file_cache.get_host_scripts_base_dir(command) there as following Just below the commented line:
# grep -A2 'if the return type is not used' /usr/lib/ambari-agent/lib/ambari_agent/CustomServiceOrchestrator.py # if the return type is not used self.file_cache.get_host_scripts_base_dir(command) base_dir = self.file_cache.get_service_base_dir(command) script_path = self.resolve_script_path(base_dir, script)
.
**NOTE:** 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)
3. Clear the Agent Cache Dir (or move it as backup)
# mv /var/lib/ambari-agent/cache /var/lib/ambari-agent/cache_OLD
.
4. Restart the ambari server and agent.
# ambari-server restart # ambari-agent restart
.
5. Now check the host script dir if it has pulled file the custom scripts from ambari server host.
# ls -lart /var/lib/ambari-agent/cache/host_scripts/
.
It looks related to: https://issues.apache.org/jira/browse/AMBARI-25123
Created 03-22-2019 07:32 AM
@Jay Kumar SenSharma, It resolves the issue
Created 12-17-2019 06:03 AM
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?