Ejemplo n.º 1
0
def _install_icinga_core(args):
    """
    Core installation is decently straightforward. Icinga-bins are downloaded from the EPEL-repo and and SQL-db is created
    and set up with the standard icinga db-schema.

    The "hard" part is setting up the object base, which is done in via helper functions.

    """
    # Disable SELinux for now, Install icinga-packages.
    x("setenforce 0")
    install.rforge_repo()
    x("yum -y install icinga icinga-idoutils-libdbi-mysql nagios-plugins-all nagios-plugins-nrpe")

    # Set set up icinga mysql-database
    icinga_sql_password = _setup_icinga_mysql()

    # Let ido2db know password has changed
    general.use_original_file("/etc/icinga/ido2db.cfg")
    general.set_config_property("/etc/icinga/ido2db.cfg","db_pass=icinga","db_pass={0}".format(icinga_sql_password, False))
    x("cp --remove-destination {0}syco-private/var/nagios/icinga.cfg /etc/icinga/icinga.cfg".format(constant.SYCO_USR_PATH))
    x("chown icinga:icinga /etc/icinga/icinga.cfg")

    # Add icinga-server iptables chain
    iptables.add_icinga_chain()
    iptables.save()

    # Reload the icinga object structure
    _reload_icinga(args,reload=False)

    return icinga_sql_password
Ejemplo n.º 2
0
def _install_icinga_core(args):
    """
    Core installation is decently straightforward. Icinga-bins are downloaded from the EPEL-repo and and SQL-db is created
    and set up with the standard icinga db-schema.

    The "hard" part is setting up the object base, which is done in via helper functions.

    """
    # Disable SELinux for now, Install icinga-packages.
    x("setenforce 0")
    install.rforge_repo()
    x("yum -y install icinga icinga-idoutils-libdbi-mysql nagios-plugins-all nagios-plugins-nrpe"
      )

    # Set set up icinga mysql-database
    icinga_sql_password = _setup_icinga_mysql()

    # Let ido2db know password has changed
    general.use_original_file("/etc/icinga/ido2db.cfg")
    general.set_config_property(
        "/etc/icinga/ido2db.cfg", "db_pass=icinga",
        "db_pass={0}".format(icinga_sql_password, False))
    x("cp --remove-destination {0}syco-private/var/nagios/icinga.cfg /etc/icinga/icinga.cfg"
      .format(constant.SYCO_USR_PATH))
    x("chown icinga:icinga /etc/icinga/icinga.cfg")

    # Add icinga-server iptables chain
    iptables.add_icinga_chain()
    iptables.save()

    # Reload the icinga object structure
    _reload_icinga(args, reload=False)

    return icinga_sql_password
Ejemplo n.º 3
0
def install_backup(args):
  # Get the master password in the beginning of the script.
  # Is needed when installing the ssh key.
  app.get_master_password()

  install.rforge_repo()
  install.package("rsnapshot")
  _configure_rsnapshot()
  _setup_cronjob()
  _setup_backup_for_all_servers()
Ejemplo n.º 4
0
def install_backup(args):
    # Get the master password in the beginning of the script.
    # Is needed when installing the ssh key.
    app.get_master_password()

    install.rforge_repo()
    install.package("rsnapshot")
    _configure_rsnapshot()
    _setup_cronjob()
    _setup_backup_for_all_servers()