Exemplo n.º 1
0
def overview():
    utils.cprint()
    utils.cprint('To collect metrics from Nginx server, the following\n'
                 'steps need to be taken:\n'
                 '1. http_stub_status_module for nginx needs to be enabled.\n'
                 '2. Enable the nginx-status page for each virtual host.\n')

    _ = utils.cinput('Press Enter to continue')
Exemplo n.º 2
0
    def overview(self):
        utils.cprint()
        utils.cprint('The telegraf redis plugin connects to one or more\n'
                     'Redis servers and gathers information\n'
                     'about their states.\n'
                     'To enable this plugin, hostname and port\n'
                     'will be needed to connect to redis-server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf redis plugin installer')
Exemplo n.º 3
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The telegraf redis plugin connects to one or more\n'
            'Redis servers and gathers information\n'
            'about their states.\n'
            'To enable this plugin, hostname and port\n'
            'will be needed to connect to redis-server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf redis plugin installer')
Exemplo n.º 4
0
def overview():
    utils.cprint()
    utils.cprint(
        'In order to monitor a apache server, the following '
        'steps need to be taken:\n'
        '1. mod_status for apache needs to be enabled. '
        '(Default is enabled)\n'
        '2. ExtendedStatus needs to be turned on.  (Default is off)\n'
        '3. Enable the server-status handler for each virtual host.\n')

    _ = utils.cinput('Press Enter to continue')
Exemplo n.º 5
0
    def overview(self):
        utils.cprint()
        utils.cprint('The memcached plugin connects to a memcached server\n'
                     'and queries statistics about cache utilization,\n'
                     'memory and bandwidth used.\n\n'
                     'To enable memcached plugin,\n'
                     'hostname and the port are needed to connect\n'
                     'to the memcached server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf Memcached plugin installer')
Exemplo n.º 6
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The elasticsearch plugin queries endpoints to obtain\n'
            'node and optionally cluster stats.\n'
            'The enable the plugin, it needs\n'
            'hostname and the port to connect\n'
            'to the elasticsearch server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf Elasticsearch plugin installer')
Exemplo n.º 7
0
def overview():
    utils.cprint()
    utils.cprint(
        'In order to monitor a apache server, the following '
        'steps need to be taken:\n'
        '1. mod_status for apache needs to be enabled. '
        '(Default is enabled)\n'
        '2. ExtendedStatus needs to be turned on.  (Default is off)\n'
        '3. Enable the server-status handler for each virtual host.\n')

    _ = utils.cinput('Press Enter to continue')
Exemplo n.º 8
0
    def overview(self):
        utils.cprint()
        utils.cprint('This redis plugin makes use of collectd python\n'
                     'extension to connects to one or more\n'
                     'Redis servers and gathers information\n'
                     'about each server\'s state.\n'
                     'To enable this plugin, hostname and port\n'
                     'will be needed to connect to redis-server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd Memcached plugin installer')
Exemplo n.º 9
0
    def overview(self):
        utils.cprint()
        utils.cprint('The telegraf MySQL plugin collects data from\n'
                     'mysql server by executing query and using\n'
                     'commands like SHOW STATUS.\n'
                     'When asked for username and password,\n'
                     'please create/provide an account for the mysql server\n'
                     'this plugin will be monitoring.')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf MySQL plugin configurator')
Exemplo n.º 10
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The telegraf MySQL plugin collects data from\n'
            'mysql server by executing query and using\n'
            'commands like SHOW STATUS.\n'
            'When asked for username and password,\n'
            'please create/provide an account for the mysql server\n'
            'this plugin will be monitoring.')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf MySQL plugin configurator')
Exemplo n.º 11
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The collectd MySQL plugin collects data from\n'
            'the SHOW STATUS command in mysqlclient.\n'
            'The SHOW STATUS command can be used by user of\n'
            'any priviledge.\nWhen asked for username and password,\n'
            'please create an account under the mysql server\n'
            'the collectd will be monitoring.')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd MySQL plugin installer')
Exemplo n.º 12
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The memcached plugin connects to a memcached server\n'
            'and queries statistics about cache utilization,\n'
            'memory and bandwidth used.\n\n'
            'To enable memcached plugin,\n'
            'hostname and the port are needed to connect\n'
            'to the memcached server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin telegraf Memcached plugin installer')
Exemplo n.º 13
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'This redis plugin makes use of collectd python\n'
            'extension to connects to one or more\n'
            'Redis servers and gathers information\n'
            'about each server\'s state.\n'
            'To enable this plugin, hostname and port\n'
            'will be needed to connect to redis-server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd Memcached plugin installer')
Exemplo n.º 14
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'The collectd zookeeper plugin collect statistics from\n'
            'a Zookeeper server using the mntr command.\n'
            'The mntr command requires Zookeeper 3.4.0+.\n'
            'To enable collectd zookeeper plugin,\n'
            'We need the hostname and the port to connect\n'
            'to the zookeeper server.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd Zookeeper plugin installer')
Exemplo n.º 15
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'Overview:\n'
            'The Cassandra collectd plugin uses GenericJMX plugin\n'
            'within the java plugin to collect various\n'
            'management information from the MBeanServer.\n'
            'We have set up some common collected metrics for Cassandra.\n'
            'The information needed from the user is the access to the \n'
            'MBeanServer.\n')

        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd Cassandra plugin installer')
Exemplo n.º 16
0
    def overview(self):
        utils.cprint()
        utils.cprint('Overview:\n'
                     'The postgres collectd plugin connects to and \n'
                     'execute SQL statement on a PostgreSQL database.\n'
                     'It then uses the returned value as metric.\n'
                     'Custom query and function tracking is possible,\n'
                     'but it requires the user to be familiar with the\n'
                     'configuration format. Our default configuration\n'
                     'makes use of the posgres statistics collector.\n'
                     'To enable the monitoring, the plugin requires\n'
                     'a valid user account that has access to the\n'
                     'database and has the ability to read from the database.')

        utils.cprint()
        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd PostgreSQl plugin installer')
Exemplo n.º 17
0
    def overview(self):
        utils.cprint()
        utils.cprint(
            'Overview:\n'
            'The postgres collectd plugin connects to and \n'
            'execute SQL statement on a PostgreSQL database.\n'
            'It then uses the returned value as metric.\n'
            'Custom query and function tracking is possible,\n'
            'but it requires the user to be familiar with the\n'
            'configuration format. Our default configuration\n'
            'makes use of the posgres statistics collector.\n'
            'To enable the monitoring, the plugin requires\n'
            'a valid user account that has access to the\n'
            'database and has the ability to read from the database.')

        utils.cprint()
        _ = utils.cinput('Press Enter to continue')
        utils.print_step('Begin collectd PostgreSQl plugin installer')
Exemplo n.º 18
0
 def check_dependency(self):
     """
     statistical collector needs to be enabled.
       - track activities:
             Enables monitoring of the current command being executed
             by any server process
       - track_counts:
             Controls whether statistics are collected about tables
             and index accesses
     """
     utils.cprint()
     utils.cprint('To make use of the statistical collecter,\n'
                  'our configuration requires the following\n'
                  'two parameters to be turned on\n'
                  '  - track_activities\n'
                  '  - track_counts\n'
                  'They are usually enabled by default and can\n'
                  'be found at postgresql.conf.')
     utils.cprint()
     _ = utils.cinput('Press Enter to continue')
Exemplo n.º 19
0
 def check_dependency(self):
     """
     statistical collector needs to be enabled.
       - track activities:
             Enables monitoring of the current command being executed
             by any server process
       - track_counts:
             Controls whether statistics are collected about tables
             and index accesses
     """
     utils.cprint()
     utils.cprint(
         'To make use of the statistical collecter,\n'
         'our configuration requires the following\n'
         'two parameters to be turned on\n'
         '  - track_activities\n'
         '  - track_counts\n'
         'They are usually enabled by default and can\n'
         'be found at postgresql.conf.')
     utils.cprint()
     _ = utils.cinput('Press Enter to continue')
Exemplo n.º 20
0
def check_dependency(os):
    """
    Apache checklist:
    - check curl
    - mod_status
    - extended status
    """

    utils.print_step('Checking dependency')
    if not utils.command_exists('curl'):
        raise Exception('Curl is needed for this plugin.')

    # ubuntu check
    # Assumption:
    # -latest apache2 is installed and the installation
    # -directory is in the default place
    if os == config.DEBIAN:
        utils.print_step('  Checking if mod_status is enabled')
        cmd_res = utils.get_command_output('ls /etc/apache2/mods-enabled')
        if cmd_res is None:
            utils.eprint(
                'Apache2 mods-enabled folder is not '
                'found /etc/apache2/mods-enabled.')
            utils.print_failure()
        elif 'status.conf' not in cmd_res or 'status.load' not in cmd_res:
            utils.print_step('Enabling apache2 mod_status module.')
            ret = utils.call_command('sudo a2enmod status')
            if ret != 0:
                utils.print_failure()
                raise Exception('a2enmod command was not found')
            utils.print_success()
        else:
            utils.print_success()

    elif os == config.REDHAT:
        utils.cprint()
        utils.cprint(
            'To enable server status page for the apache web,\n'
            'ensure that mod_status.so module is enabled.\n'
            'This module is often enabled by default.\n'
            '"LoadModule status_module modules/mod_status.so"\n'
            'such line should be included in one of the conf files.\n')
        _ = utils.cinput('Press Enter to continue.')

    utils.cprint()
    utils.cprint(
        'In order to fully utilize the server_status metrics,\n'
        'the ExtendedStatus setting needs be turned on.\n'
        'This setting can be turned on by having "ExtendedStatus on"\n'
        'in one of the .conf file.\n')

    utils.cprint(
        'If you have already enabled this status, '
        'answer "no" to the next question.\n'
        'If you would like us to enable this status, '
        'answer "yes" and we will '
        'include a extendedstatus.conf file in your apache folder.\n')

    res = utils.ask(
        'Would you like us to enable '
        'the ExtendedStatus?')

    if res:
        # dir changes depending on the system
        # tested on Ubuntu 14.04, RHEL 7.2
        if os == config.DEBIAN:
            conf_dir = '/etc/apache2/conf-enabled'
            app_name = 'apache2'
        elif os == config.REDHAT:
            conf_dir = '/etc/httpd/conf.d'
            app_name = 'httpd'

        utils.print_step('Checking if ' + conf_dir + ' exists.')
        if utils.check_path_exists(conf_dir):
            # pull config file here
            utils.print_success()
            include_apache_es_conf(conf_dir)
            utils.cprint(
                'extendedstatus.conf is now included in the '
                '{0} dir.\n'.format(conf_dir))
            utils.print_step('Restarting apache')
            ret = utils.call_command(
                'service {app_name} restart >> '
                '{log} 2>&1'.format(
                    app_name=app_name,
                    log=config.INSTALL_LOG))
            if ret != 0:
                raise Exception(
                    'Failed to restart apache service.')
            utils.print_success()
        else:
            raise Exception(
                '{cond_dir} dir does not exist. Manual '
                'set up is required. For help, please '
                'consult [email protected]'.format(
                    conf_dir=conf_dir))
Exemplo n.º 21
0
def check_dependency(os):
    """
    Apache checklist:
    - check curl
    - mod_status
    - extended status
    """

    utils.print_step('Checking dependency')
    if not utils.command_exists('curl'):
        raise Exception('Curl is needed for this plugin.')

    # ubuntu check
    # Assumption:
    # -latest apache2 is installed and the installation
    # -directory is in the default place
    if os == config.DEBIAN:
        utils.print_step('  Checking if mod_status is enabled')
        cmd_res = utils.get_command_output('ls /etc/apache2/mods-enabled')
        if cmd_res is None:
            utils.eprint('Apache2 mods-enabled folder is not '
                         'found /etc/apache2/mods-enabled.')
            utils.print_failure()
        elif 'status.conf' not in cmd_res or 'status.load' not in cmd_res:
            utils.print_step('Enabling apache2 mod_status module.')
            ret = utils.call_command('sudo a2enmod status')
            if ret != 0:
                utils.print_failure()
                raise Exception('a2enmod command was not found')
            utils.print_success()
        else:
            utils.print_success()

    elif os == config.REDHAT:
        utils.cprint()
        utils.cprint(
            'To enable server status page for the apache web,\n'
            'ensure that mod_status.so module is enabled.\n'
            'This module is often enabled by default.\n'
            '"LoadModule status_module modules/mod_status.so"\n'
            'such line should be included in one of the conf files.\n')
        _ = utils.cinput('Press Enter to continue.')

    utils.cprint()
    utils.cprint(
        'In order to fully utilize the server_status metrics,\n'
        'the ExtendedStatus setting needs be turned on.\n'
        'This setting can be turned on by having "ExtendedStatus on"\n'
        'in one of the .conf file.\n')

    utils.cprint('If you have already enabled this status, '
                 'answer "no" to the next question.\n'
                 'If you would like us to enable this status, '
                 'answer "yes" and we will '
                 'include a extendedstatus.conf file in your apache folder.\n')

    res = utils.ask('Would you like us to enable ' 'the ExtendedStatus?')

    if res:
        # dir changes depending on the system
        # tested on Ubuntu 14.04, RHEL 7.2
        if os == config.DEBIAN:
            conf_dir = '/etc/apache2/conf-enabled'
            app_name = 'apache2'
        elif os == config.REDHAT:
            conf_dir = '/etc/httpd/conf.d'
            app_name = 'httpd'

        utils.print_step('Checking if ' + conf_dir + ' exists.')
        if utils.check_path_exists(conf_dir):
            # pull config file here
            utils.print_success()
            include_apache_es_conf(conf_dir)
            utils.cprint('extendedstatus.conf is now included in the '
                         '{0} dir.\n'.format(conf_dir))
            utils.print_step('Restarting apache')
            ret = utils.call_command('service {app_name} restart >> '
                                     '{log} 2>&1'.format(
                                         app_name=app_name,
                                         log=config.INSTALL_LOG))
            if ret != 0:
                raise Exception('Failed to restart apache service.')
            utils.print_success()
        else:
            raise Exception(
                '{cond_dir} dir does not exist. Manual '
                'set up is required. For help, please '
                'consult [email protected]'.format(conf_dir=conf_dir))