Skip to content

Instantly share code, notes, and snippets.

@sacgov
Created August 31, 2018 14:54
Show Gist options
  • Save sacgov/4b013312bfbe5ad2455a3c0cdb479eb6 to your computer and use it in GitHub Desktop.
Save sacgov/4b013312bfbe5ad2455a3c0cdb479eb6 to your computer and use it in GitHub Desktop.

Revisions

  1. sacgov created this gist Aug 31, 2018.
    39 changes: 39 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #Install Build Dependencies
    sudo yum install gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd unzip

    #Create Nagios User and Group
    sudo useradd nagios
    sudo groupadd nagcmd
    sudo usermod -a -G nagcmd nagios

    #Install Nagios Core
    cd ~
    #L specifies the location and 0 specifies the http version to use
    # https://www.nagios.org/downloads/nagios-core/thanks/?skip=1
    curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.2.tar.gz
    tar xvf nagios-*.tar.gz
    cd nagios-*

    #Build Nagios
    ./configure --with-command-group=nagcmd
    make all
    sudo make install
    sudo make install-commandmode
    sudo make install-init
    sudo make install-config
    sudo make install-webconf

    #To give commands from the web interface we need to add the apache user to nagios
    sudo usermod -G nagcmd apache


    #Install Nagios Plugins
    #Plugin Location http://nagios-plugins.org/download/?C=M;O=D

    cd ~
    curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
    tar xvf nagios-plugins-*.tar.gz
    cd nagios-plugins-*
    ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
    make
    sudo make install