Nagios: Difference between revisions
From Mike Beane's Blog
m (New page: After 2+ years of uptime, my Nagios box went down unexpectedly and I decided to take the opportunity to create a new box. I used the following instructions from start to finish with mino...) |
m (Updated Nagios Install Directions) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Nagios Install= | |||
I | I knew I had a discussion on this somewhere, found it in GoogleWave. Time to rescue that... | ||
http://www. | <pre> | ||
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.... | |||
</pre> | |||
# 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: | |||
#[http://www.ghacks.net/2009/06/08/how-to-install-nagios-on-ubuntu-server/ ghacks.net] | |||
#[http://www.ubuntugeek.com/nagios-network-monitoring-system-setup-in-ubuntu.html ubuntugeek.com] | |||
=nagiosinstall.sh= | |||
<pre> | <pre> | ||
# 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 | |||
passwd nagios | 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 | |||
cd | sudo apt-get install libperl-dev | ||
sudo ./configure | |||
sudo make | |||
sudo make install | |||
cd /home/nagios/ | |||
########################################################### | |||
./configure --with-command-group=nagcmd | echo "starting apt-get updates and installations" | ||
make all | sudo apt-get update | ||
make install | sudo apt-get install apache2 | ||
make install-init | sudo apt-get install build-essential | ||
make install-config | sudo apt-get install ncurses-dev | ||
make install-commandmode | sudo apt-get install libgd2-xpm-dev | ||
make install-webconf | sudo apt-get install php5-gd | ||
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin | sudo apt-get install gcc | ||
sudo apt-get install make | |||
cd | sudo apt-get install openssl | ||
sudo apt-get install openssl | |||
cd nagios-plugins-1.4. | sudo apt-get install freeradius | ||
./configure --with-nagios-user=nagios --with-nagios-group=nagios | #sudo apt-get install slapd ldap-utils libnss-ldap libpam-ldap | ||
make | sudo apt-get install samba smbldap-tools samba-doc smbclient | ||
make install | sudo apt-get install qstat | ||
sudo apt-get install fping | |||
sudo apt-get install libpq-dev | |||
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg | 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 | |||
</pre> | </pre> | ||
Latest revision as of 02:05, 1 September 2010
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