Nagios
From Rabbi Blog
Nagios Install
I knew I had a discussion on this somewhere, found it in GoogleWave. Time to rescue that...
You don't need to go down the road of using the install script, but through reading I kept running into dependencies that weren't included in every setup instructional I found, so I balled it all together and kept installing Ubuntu server from scratch & running the script until I had a working Nagios install, then called it a day. Your mileage may vary....
- Install Ubuntu Server (v 9.10)
- Install LAMP, Mail, OpenSSL, Postgres [HEY LOOK, A LAMP REFERENCE!]
- Username: nagios
- Password: [make one up]
- After installation and reboot, SSH to the device
- ifconfig to get IP from terminal if required
- Get Nagios Installation and Plugins Files
- Get the latest fromhttp://www.nagios.org/download/
- Copy the shortcut from the site
- wgethttp://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
- wgethttp://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
- Unpack Nagios
- tar xvzf [name of the nagios tar file above]
- Unpack plugins and install the version you have downloaded
- tar xvzf nagios-plugins-1.4.[xxx].tar.gz
- Create a file called nagiosinstall.sh and paste the following commands in the file. BE SURE TO CHANGE THE NAMES OF NAGIOS-3.2.0 and nagios-plugins-1.4.14 to be EXACTLY WHAT THE UNPACKED DIRECTORY NAMES ARE (from above).
- [**See part 2 for current nagiosinstall.sh script**]
- Upload the file to your /home/nagios directory
- sudo chmod +x nagiosinstall.sh
- ./nagiosinstall.sh
- Set passwords as needed
- Check the last bit of output, it will be the preflight check. If no errors, continue:
- Make nagios a service
- sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
- Start Nagios
- sudo /etc/init.d/nagios start
- Browse tohttp://[IPAddress]/nagios
- Login with nagiosadmin and the password designated in 7.k.i
References:
nagiosinstall.sh
# Add the names below of the downloaded packages echo off echo "Unpacking Nagios files" tar xvzf nagios-3.2.0.tar.gz tar xvzf nagios-plugins-1.4.14.tar.gz tar xvzf net-snmp_5.4.1~dfsg.orig.tar.gz ########################################################### ### Uncomment the next part to use (rather long in testing) echo "installing Net::SNMP for Perl" cd /home/nagios/net-snmp-5.4.1 sudo apt-get install libperl-dev sudo ./configure sudo make sudo make install cd /home/nagios/ ########################################################### echo "starting apt-get updates and installations" sudo apt-get update sudo apt-get install apache2 sudo apt-get install build-essential sudo apt-get install ncurses-dev sudo apt-get install libgd2-xpm-dev sudo apt-get install php5-gd sudo apt-get install gcc sudo apt-get install make sudo apt-get install openssl sudo apt-get install openssl sudo apt-get install freeradius #sudo apt-get install slapd ldap-utils libnss-ldap libpam-ldap sudo apt-get install samba smbldap-tools samba-doc smbclient sudo apt-get install qstat sudo apt-get install fping sudo apt-get install libpq-dev sudo apt-get install snmpd sudo apt-get install snmp sudo apt-get install libsnmp sudo apt-get install libsnmp9-dev sudo apt-get install libsnmp-base sudo apt-get install libsnmp-perl sudo apt-get upgrade echo "adding user nagios" sudo useradd -m nagios sudo passwd nagios echo "adding group nagios" sudo groupadd nagios sudo usermod -G nagios nagios sudo groupadd nagcmd sudo usermod -a -G nagcmd nagios sudo usermod -a -G nagcmd www-data # Remove the comment line below and set path name to your download file cd /home/nagios/nagios-3.2.0 sudo ./configure --with-command-group=nagcmd sudo make all sudo make install sudo make install-init sudo make install-config sudo make install-commandmode sudo make install-webconf sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin sudo /etc/init.d/apache2 reload cd /home/nagios # Remove the comment line below and set path name to your download file cd /home/nagios/nagios-plugins-1.4.14 sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios sudo make sudo make install sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg cd /home/nagios