Created 09-09-2016 04:42 AM
Hi All, If we were to detect any configuration changes via rest calls to Ambari, what is the best approach? I have seen https://cwiki.apache.org/confluence/display/AMBARI/Service+Config+Versions+API+usage If there is an application that polls the URL at a frequent time interval and "remembers" the timestamp during every call and compares it to the next subsequent call, it can be done. But is there a different approach someone can suggest.
Created 09-09-2016 06:57 AM
At regular interval we can compare the Ambari Blueprint to see what changes are made by comparing two results. Following approach can be integrated inside a shell script (cronjob) to poll the config changes at some regular interval and to find the "diff" between current and last output files "/tmp/cluster-`date +'%Y%m%d%H%M'`.txt"
Example:
curl -o "/tmp/cluster-`date +'%Y%m%d%H%M'`.txt" -u admin:admin -H "X-Requested-By: ambari" -X GET http://jss1:8080/api/v1/clusters/JoyCluster?format=blueprint
Created 09-09-2016 10:38 AM
@Arun A K - You may want to check the output of below REST call
curl -u admin:admin -i -H 'X-Requested-By: ambari' -X GET http://$server:8080/api/v1/clusters/$clustername/configurations/service_config_versions
This would list the service config versions of all services. At any time you make the above call, it would provide the complete history of service config changes. Some fields that could be of interest are mentioned in below post
Hope this helps!