import os
import socket

from pyDMON import db, dbSCore, dbESCore, dbKBCore


logstash = dbSCore(hostFQDN=socket.getfqdn(),
                   hostIP=socket.gethostbyname(socket.gethostname()),
                   hostOS='ubuntu',
                   outESclusterName='<%= @es_cluster %>',
                   udpPort=25826,
                   inLumberPort=5000,
                   LSCoreHeap=os.getenv('LS_HEAP_SIZE', '512m'))
db.session.add(logstash)

elasticsearch = dbESCore(hostFQDN=socket.getfqdn(),
                         hostIP='127.0.0.1',
                         hostOS='ubuntu',
                         nodeName='esCoreMaster',
                         clusterName='<%= @es_cluster %>',
                         conf='None',
                         nodePort=9200,
                         MasterNode=1,
                         DataNode=1,
                         ESCoreHeap=os.getenv('ES_HEAP_SIZE', '4g'))
db.session.add(elasticsearch)

kibana = dbKBCore(hostFQDN=socket.getfqdn(),
                  hostIP=socket.gethostbyname(socket.gethostname()),
                  hostOS='ubuntu',
                  kbPort=5601)
db.session.add(kibana)

db.session.commit()

import os
import socket

from pyDMON import db, dbSCore, dbESCore, dbKBCore, dbMetPer


logstash = dbSCore(hostFQDN=socket.getfqdn(),
                   hostIP=socket.gethostbyname(socket.gethostname()),
                   hostOS='ubuntu',
                   outESclusterName='<%= @es_cluster %>',
                   udpPort=25826,
                   inLumberPort=5000,
                   LSCoreHeap=os.getenv('LS_HEAP_SIZE', '512m'))
db.session.add(logstash)

elasticsearch = dbESCore(hostFQDN=socket.getfqdn(),
                         hostIP='127.0.0.1',
                         hostOS='ubuntu',
                         nodeName='esCoreMaster',
                         clusterName='<%= @es_cluster %>',
                         conf='None',
                         nodePort=9200,
                         MasterNode=1,
                         DataNode=1,
                         ESCoreHeap=os.getenv('ES_HEAP_SIZE', '4g'))
db.session.add(elasticsearch)

kibana = dbKBCore(hostFQDN=socket.getfqdn(),
                  hostIP=socket.gethostbyname(socket.gethostname()),
                  hostOS='ubuntu',
                  kbPort=5601)
db.session.add(kibana)

metrics = dbMetPer(sysMet="15", yarnMet="15", sparkMet="5", stormMet="30")
db.session.add(metrics)

db.session.commit()

Add missing default metric interval settings
Add missing default metric interval settings

DMon requires that metric intervals are set when being installed. This
commit sets default values for those intervals.

Change-Id: I778418baa10992a7bb72fc4457e57495715b0df8
