UBUNTU SERVER
1) prerequisiti
sudo apt-get install libapache2-mod-php5
sudo apt-get install build-essential
sudo apt-get install libgd2-xpm-dev
2)creare nuovo utente
Create a new nagios user account and give it a password.
/usr/sbin/useradd -m -s /bin/bash nagios
passwd nagios
Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd www-data
Download nagios&plugin
tar xzf nagios-3*
cd nagios
./configure --with-command-group=nagcmd
sed -i 's:for file in includes/rss/\*;:for file in includes/rss/\*.\*;:g' ./html/Makefile
sed -i 's:for file in includes/rss/extlib/\*;:for file in includes/rss/extlib/\*.\*;:g' ./html/Makefile
make fullinstall
Compile the Nagios source code.
make all
Install binaries, init script, sample config files and set permissions on the external command directory.
make install
make install-init
make install-config
make install-commandmode
3) Configure the Web Interface
Install the Nagios web config file in the Apache conf.d directory.
make install-webconf
Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Restart Apache to make the new settings take effect.
/etc/init.d/apache2 reload
http://servernagios/nagios
usre nagiosadmin password quella creata
6) Compile and Install the Nagios Plugins
Extract the Nagios plugins source code tarball.
cd ~/downloads
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
Compile and install the plugins.
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
rendere avviabile nagios e link simbolico in etc
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
ln -s /usr/local/nagios/etc/ /etc/nagios
test
/usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
run
/etc/init.d/nagios start
installare snmp & snmpwalk
apt-get install snmp snmpwalk
apt-get install xinetd libapache2-mod-python
check_mk
install default
mkdir /var/lib/check_mk/web/nagiosadmin
chmod 755 /var/lib/check_mk/web/nagiosadmin
chown nagios nagiosadmin/
chown .nagios nagiosadmin/
http://nagios/check_mk/
aggiungere host in /etc/check_mk/main.mk
---------
# Put your host names here
# all_hosts = [ 'localhost' ]
all_hosts = [
'10.2.5.0',
"10.2.200.1|snmp", # SNMP host
]
------------------
verifica check
check_mk -I
update configurazione nagios
check_mk -O
tutti i file di configurazione creati x nagios sono in /usr/local/nagios/etc/check_mk.d