[ 
https://issues.apache.org/jira/browse/METRON-1311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16247696#comment-16247696
 ] 

ASF GitHub Bot commented on METRON-1311:
----------------------------------------

Github user anandsubbu commented on the issue:

    https://github.com/apache/metron/pull/839
  
    +1 (non-binding) works fine, and a much needed fix as well ! If for some 
reason, we were not able to install the templates during the startup, it would 
be caught by the service check. 
    
    Validated this on a full dev environment. For a successful service check, I 
see this now:
    ```
    2017-11-10 15:48:06,150 - Checking Elasticsearch templates for Indexing
    2017-11-10 15:48:06,151 - Execute['curl -s -XGET 
"http://node1:9200/_template/yaf_index"; | grep -o yaf_index'] {'logoutput': 
True, 'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 'tries': 3, 
'user': 'metron', 'try_sleep': 5}
    yaf_index
    yaf_index
    2017-11-10 15:48:06,343 - Execute['curl -s -XGET 
"http://node1:9200/_template/error_index"; | grep -o error_index'] {'logoutput': 
True, 'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 'tries': 3, 
'user': 'metron', 'try_sleep': 5}
    error_index
    error_index
    2017-11-10 15:48:06,385 - Execute['curl -s -XGET 
"http://node1:9200/_template/snort_index"; | grep -o snort_index'] {'logoutput': 
True, 'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 'tries': 3, 
'user': 'metron', 'try_sleep': 5}
    snort_index
    snort_index
    2017-11-10 15:48:06,433 - Execute['curl -s -XGET 
"http://node1:9200/_template/bro_index"; | grep -o bro_index'] {'logoutput': 
True, 'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 'tries': 3, 
'user': 'metron', 'try_sleep': 5}
    bro_index
    bro_index
    2017-11-10 15:48:06,491 - Execute['curl -s -XGET 
"http://node1:9200/_template/metaalert_index"; | grep -o metaalert_index'] 
{'logoutput': True, 'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 
'tries': 3, 'user': 'metron', 'try_sleep': 5}
    metaalert_index
    ```
    
    And the service check fails when I delete the ES template file. 
    ```
    Traceback (most recent call last):
      File 
"/var/lib/ambari-agent/cache/common-services/METRON/0.4.2/package/scripts/service_check.py",
 line 78, in <module>
        ServiceCheck().execute()
      File 
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
 line 280, in execute
        method(env)
      File 
"/var/lib/ambari-agent/cache/common-services/METRON/0.4.2/package/scripts/service_check.py",
 line 51, in service_check
        indexing_cmds.service_check(env)
      File 
"/var/lib/ambari-agent/cache/common-services/METRON/0.4.2/package/scripts/indexing_commands.py",
 line 264, in service_check
        self.check_elasticsearch_templates()
      File 
"/var/lib/ambari-agent/cache/common-services/METRON/0.4.2/package/scripts/indexing_commands.py",
 line 179, in check_elasticsearch_templates
        metron_service.execute(cmd, user=self.__params.metron_user, 
err_msg=err_msg)
      File 
"/var/lib/ambari-agent/cache/common-services/METRON/0.4.2/package/scripts/metron_service.py",
 line 257, in execute
        raise Fail(err_msg)
    resource_management.core.exceptions.Fail: Missing Elasticsearch index 
template: name=yaf_index
    ```
    
    @nickwallen -  I see two conflicting files for the commit. Guess this would 
be need to be resolved first?


> Service Check Should Check Elasticsearch Index Templates
> --------------------------------------------------------
>
>                 Key: METRON-1311
>                 URL: https://issues.apache.org/jira/browse/METRON-1311
>             Project: Metron
>          Issue Type: Bug
>    Affects Versions: 0.4.1
>            Reporter: Nick Allen
>            Assignee: Nick Allen
>             Fix For: Next + 1
>
>
> The Service Check in Ambari does not validate that the Elasticsearch index 
> templates have been installed.  Without these index templates bad things can 
> happen.  For example, the Alerts UI will not be able to display any alerts.
> The Elasticsearch index templates that are installed by Ambari should also be 
> checked as part of the Metron Service Check.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to