Ejemplo n.º 1
0
    def start(self, env, upgrade_type=None):
        import params
        env.set_params(params)
        self.configure(env, action='start')

        start_cmd = format("{ams_grafana_script} start")
        Execute(
            start_cmd,
            user=params.ams_user,
            not_if=params.grafana_process_exists_cmd,
        )
        pidfile = format("{ams_grafana_pid_dir}/grafana-server.pid")
        if not sudo.path_exists(pidfile):
            Logger.warning(
                "Pid file doesn't exist after starting of the component.")
        else:
            Logger.info("Grafana Server has started with pid: {0}".format(
                sudo.read_file(pidfile).strip()))

        #Set Grafana admin pwd
        create_grafana_admin_pwd()
        # Create datasource
        create_ams_datasource()
        # Create pre-built dashboards
        create_ams_dashboards()
Ejemplo n.º 2
0
    def start(self, env):
        import params
        env.set_params(params)
        self.configure(env, action='start')

        start_cmd = format("{ams_grafana_script} start")
        Execute(start_cmd, user=params.ams_user)
        # Create datasource
        create_ams_datasource()
        # Create pre-built dashboards
        create_ams_dashboards()