示例#1
0
def _install_nrpe_plugins_dependencies():
    """Install libraries/binaries that the NRPE-plugins depend on."""
    # Dependency for check_rsyslog
    x("yum install -y MySQL-python")

    # Dependency for check_clamav
    x("yum install -y nagios-plugins-perl perl-Net-DNS-Resolver-Programmable")
    x("yum install -y perl-suidperl")

    x(
        """cat > /etc/sudoers.d/nrpe << EOF
Defaults:nrpe !requiretty
nrpe ALL=NOPASSWD:{0}check_clamav
nrpe ALL=NOPASSWD:{0}check_clamscan
nrpe ALL=NOPASSWD:{0}check_disk
nrpe ALL=NOPASSWD:{0}get_services
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-deleted-files
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-file-privs
EOF
""".format(
            PLG_PATH
        )
    )

    # Dependency for check_clamscan
    x("yum install -y perl-Proc-ProcessTable perl-Date-Calc")

    # Dependency for check_ldap
    x("yum install -y php-ldap php-cli")

    # Dependency for check_iostat
    x("yum install -y sysstat")

    # Dependency for hosts/firewall hardware checks
    host_config_object = config.host(net.get_hostname())
    if host_config_object.is_host() or host_config_object.is_firewall():
        install.hp_repo()
        x("yum -y install hp-health hpacucli")

        # Let nrpe run hpasmcli and hpacucli
    x(
        """cat >> /etc/sudoers.d/nrpe << EOF
nrpe ALL=NOPASSWD:/sbin/hpasmcli
nrpe ALL=NOPASSWD:{0}check_hpasm
nrpe ALL=NOPASSWD:/sbin/hpacucli
nrpe ALL=NOPASSWD:{0}check_hparray
EOF
""".format(
            PLG_PATH
        )
    )

    # Dependency for check_ulimit
    x("yum install -y lsof")

    # Set ulimit values to take affect after reboot
    x("printf '\n*\tsoft\tnofile\t8196\n*\thard\tnofile\t16392\n' >> /etc/security/limits.conf")

    # Kernel wont parse anything but read-only in sudoers. So chmod it.
    x("chmod 0440 /etc/sudoers.d/nrpe")
示例#2
0
def _install_nrpe_plugins_dependencies():
    """Install libraries/binaries that the NRPE-plugins depend on."""
    # Dependency for check_rsyslog
    app.print_verbose("Install required dependency for check_rsyslog")
    install_packages("MySQL-python")

    # Dependency for check_clamav
    app.print_verbose("Install required dependencies for check_clamav")
    install_packages("perl-Net-DNS-Resolver-Programmable perl-suidperl")

    x("""cat > /etc/sudoers.d/nrpe << EOF
Defaults:nrpe !requiretty
nrpe ALL=NOPASSWD:{0}check_clamav
nrpe ALL=NOPASSWD:{0}check_clamscan
nrpe ALL=NOPASSWD:{0}check_disk
nrpe ALL=NOPASSWD:{0}get_services
nrpe ALL=NOPASSWD:{0}check_file_age
nrpe ALL=NOPASSWD:{0}check_ossec-clients.sh
nrpe ALL=NOPASSWD:{0}check_haproxy_stats.pl
nrpe ALL=NOPASSWD:/usr/sbin/rabbitmqctl
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-deleted-files
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-file-privs
EOF
""".format(PLG_PATH))

    # Dependency for check_ldap
    app.print_verbose("Install required dependencies for check_ldap")
    install_packages("php-ldap php-cli")

    # Dependency for check_iostat
    app.print_verbose("Install required dependency for check_iostat")
    install_packages("sysstat")

    # Dependency for hosts/firewall hardware checks
    host_config_object = config.host(net.get_hostname())
    if host_config_object.is_host() or host_config_object.is_firewall():
        install.hp_repo()
        app.print_verbose("Install required dependencies for Hardware checks")
        install_packages("hp-health hpssacli")

        # Let nrpe run hpasmcli and hpssacli
        x("""cat >> /etc/sudoers.d/nrpe << EOF
nrpe ALL=NOPASSWD:/sbin/hpasmcli
nrpe ALL=NOPASSWD:{0}check_hpasm
nrpe ALL=NOPASSWD:/usr/sbin/hpssacli
nrpe ALL=NOPASSWD:{0}check_hparray
EOF
""".format(PLG_PATH))

    # Dependency for check_ulimit
    app.print_verbose("Install required dependency for check_ulimit")
    install_packages("lsof")

    # Set ulimit values to take affect after reboot
    x("printf '\n*\tsoft\tnofile\t8196\n*\thard\tnofile\t16392\n' >> /etc/security/limits.conf"
      )

    # Kernel wont parse anything but read-only in sudoers. So chmod it.
    x("chmod 0440 /etc/sudoers.d/nrpe")
示例#3
0
def _install_nrpe_plugins_dependencies():
    """Install libraries/binaries that the NRPE-plugins depend on."""
    # Dependency for check_rsyslog
    app.print_verbose("Install required dependency for check_rsyslog")
    install_packages("MySQL-python")

    # Dependency for check_clamav
    app.print_verbose("Install required dependencies for check_clamav")
    install_packages("perl-Net-DNS-Resolver-Programmable perl-suidperl")

    x("""cat > /etc/sudoers.d/nrpe << EOF
Defaults:nrpe !requiretty
nrpe ALL=NOPASSWD:{0}check_clamav
nrpe ALL=NOPASSWD:{0}check_clamscan
nrpe ALL=NOPASSWD:{0}check_disk
nrpe ALL=NOPASSWD:{0}get_services
nrpe ALL=NOPASSWD:{0}check_file_age
nrpe ALL=NOPASSWD:{0}check_ossec-clients.sh
nrpe ALL=NOPASSWD:{0}check_haproxy_stats.pl
nrpe ALL=NOPASSWD:/usr/sbin/rabbitmqctl
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-deleted-files
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-file-privs
EOF
""".format(PLG_PATH))

    # Dependency for check_ldap
    app.print_verbose("Install required dependencies for check_ldap")
    install_packages("php-ldap php-cli")

    # Dependency for check_iostat
    app.print_verbose("Install required dependency for check_iostat")
    install_packages("sysstat")

    # Dependency for hosts/firewall hardware checks
    host_config_object = config.host(net.get_hostname())
    if host_config_object.is_host() or host_config_object.is_firewall():
        install.hp_repo()
        app.print_verbose("Install required dependencies for Hardware checks")
        install_packages("hp-health hpssacli")

        # Let nrpe run hpasmcli and hpssacli
        x("""cat >> /etc/sudoers.d/nrpe << EOF
nrpe ALL=NOPASSWD:/sbin/hpasmcli
nrpe ALL=NOPASSWD:{0}check_hpasm
nrpe ALL=NOPASSWD:/usr/sbin/hpssacli
nrpe ALL=NOPASSWD:{0}check_hparray
EOF
""".format(PLG_PATH))

    # Dependency for check_ulimit
    app.print_verbose("Install required dependency for check_ulimit")
    install_packages("lsof")

    # Set ulimit values to take affect after reboot
    x("printf '\n*\tsoft\tnofile\t8196\n*\thard\tnofile\t16392\n' >> /etc/security/limits.conf")

    # Kernel wont parse anything but read-only in sudoers. So chmod it.
    x("chmod 0440 /etc/sudoers.d/nrpe")
示例#4
0
def _install_nrpe_plugins_dependencies():
    """Install libraries/binaries that the NRPE-plugins depend on."""
    # Dependency for check_rsyslog
    x("yum install -y MySQL-python")

    # Dependency for check_clamav
    x("yum install -y nagios-plugins-perl perl-Net-DNS-Resolver-Programmable")
    x("yum install -y perl-suidperl")

    x("""cat > /etc/sudoers.d/nrpe << EOF
Defaults:nrpe !requiretty
nrpe ALL=NOPASSWD:{0}check_clamav
nrpe ALL=NOPASSWD:{0}check_clamscan
nrpe ALL=NOPASSWD:{0}check_disk
nrpe ALL=NOPASSWD:{0}get_services
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-deleted-files
nrpe ALL=NOPASSWD:{0}mysql/pmp-check-mysql-file-privs
EOF
""".format(PLG_PATH))

    # Dependency for check_clamscan
    x("yum install -y perl-Proc-ProcessTable perl-Date-Calc")

    # Dependency for check_ldap
    x("yum install -y php-ldap php-cli")

    # Dependency for check_iostat
    x("yum install -y sysstat")

    # Dependency for hosts/firewall hardware checks
    host_config_object = config.host(net.get_hostname())
    if host_config_object.is_host() or host_config_object.is_firewall():
        install.hp_repo()
        x("yum -y install hp-health hpacucli")

        # Let nrpe run hpasmcli and hpacucli
    x("""cat >> /etc/sudoers.d/nrpe << EOF
nrpe ALL=NOPASSWD:/sbin/hpasmcli
nrpe ALL=NOPASSWD:{0}check_hpasm
nrpe ALL=NOPASSWD:/sbin/hpacucli
nrpe ALL=NOPASSWD:{0}check_hparray
EOF
""".format(PLG_PATH))

    # Dependency for check_ulimit
    x("yum install -y lsof")

    # Set ulimit values to take affect after reboot
    x("printf '\n*\tsoft\tnofile\t8196\n*\thard\tnofile\t16392\n' >> /etc/security/limits.conf"
      )

    # Kernel wont parse anything but read-only in sudoers. So chmod it.
    x("chmod 0440 /etc/sudoers.d/nrpe")