Script zur automatischen Installation von Nagios mit Plugins unter Ubuntu

Mit folgenden Script kann die aktuellste Nagios Version mit den Nagios Plugins 1.4.11 automatisch unter Ubuntu installiert werden. Viel Spass damit:

#!/bin/sh
# +-------------------------------------------------------------------------+
# http://www.dBoxen.de/
# +-------------------------------------------------------------------------+

echo Welcome to the Nagios CVS + Nagios Plugins Autoinstaller Script for Ubuntu!
echo User interaction will be necessary!
echo Needed packages are going to be installed via apt!
sleep 5

apt-get -y --force-yes install apache2 build-essential wget perl libgd2-xpm-dev openssl libssl-dev openssh-server openssh-client ntpdate snmp smbclient libldap-2.3-0 libldap2-dev mysql-server libmysqlclient15-dev qstat libnet-snmp-perl mrtg nut unzip

echo Group and User for Nagios will be added!
sleep 2

groupadd -g 9000 nagios
groupadd -g 9001 nagcmd
useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c "Nagios Admin" nagios
usermod -G nagcmd www-data

echo Needed directories will be created!
sleep 2

mkdir /usr/local/nagios /etc/nagios /var/nagios
chown nagios.nagios /usr/local/nagios /etc/nagios /var/nagios

echo Nagios will be downloaded and installed!
sleep 2

mkdir /usr/local/src
cd /usr/local/src
wget http://nagios.sourceforge.net/download/cvs/nagios-cvs.tar.gz
tar xvzf nagios-cvs.tar.gz
rm nagios-cvs.tar.gz
cd nagios-cvs
./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --with-command-group=nagcmd

echo Any errors occured?
echo Yes? Fix them!
echo No? Fine, translation begins!
sleep 8

make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
update-rc.d nagios defaults 99
/etc/init.d/apache2 reload > /dev/null
/etc/init.d/nagios start > /dev/null

echo Going to add the User "nagios" for the Webinterface! Specify password for the frontend!
sleep 5

cd /etc/nagios/
htpasswd -c htpasswd.users nagios
chown www-data htpasswd.users
chmod 600 htpasswd.users

echo Nagios installation finished! Going to install the nagios-plugins!
sleep 2

cd /usr/local/src
perl -MCPAN -e 'install Net::SNMP'
wget http://heanet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
tar xvzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --enable-perl-modules

echo Any errors occured?
echo Yes? Fix them!
echo No? Fine, translation begins!
sleep 8

make clean;make
make install
clear
echo Installation of Nagios und the Nagios-Plugins have been finished!
echo Thanks for using this Script!
echo Visit http://www.dBoxen.de/
exit 0

Share Save 171 16 in Script zur automatischen Installation von Nagios mit Plugins unter Ubuntu

Dieser Beitrag wurde unter Nagios abgelegt und mit , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *


*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>