[op5-users] Configuration Guide for Nagios & Op5 (including NagVis, SMS Notification, etc..)
Mirza Dedic
mirde at oppy.com
Thu Sep 10 22:52:38 CEST 2009
I think that out of all these powerful packages being developed the one issue that stands out is a detailed configuration guide that binds some of the most powerful tools to work together.. Here is an attempt to create such a guide..
This guide assumes that you have Ubuntu 8.04 as the base OS with Nagios as the user-ID logged in.
Nagios 3.1.2 # need user input
Module Extensions:
- Ninja # included / 09.10.09
- Merlin # included / 09.10.09
- NagVis # need user input
- NaCoMa # need user input
- Reports-Module # need user input
- Reports-GUI # need user input
- PNP4Nagios # included / 09.10.09
Notification Extension:
- SMS Notification # included / 09.10.09
Other:
- Apache2 Configuration # need user input
//START
**************
MERLIN INSTALL
**************
# Download latest source (from /usr/local/nagios/addons)
git clone git://git.op5.org/nagios/merlin.git merlin-src
# Compile
cd merlin-src
make
# Install
./install-merlin.sh --nagios-cfg=/etc/nagios/nagios.cfg
--dest-dir=/etc/nagios/addons/merlin
# Start the svc
/etc/init.d/nagios restart
/etc/init.d/merlind start
**************
NINJA INSTALL
**************
# Download latest source (from /usr/local/nagios/addons)
git clone git://git.op5.org/nagios/ninja.git
# Do this..
mkdir ninja-gui
cd ninja-gui/
ln -s /usr/local/nagios/addons/ninja/op5build/index.php .
ln -s /usr/local/nagios/addons/ninja/application .
# Update the httpd config files
Correct the path in: /etc/nagios/addons/ninja/op5build/ninja.httpd-conf
Alias /ninja /usr/local/nagios/addons/ninja-gui/
<Directory "/usr/local/nagios/addons/ninja-gui/">
# Do this..
cd /etc/httpd/conf.d/
ln -s /usr/local/nagios/addons/ninja/op5build/ninja.httpd-conf ninja.conf
# Restart Apache
/etc/init.d/apache2 restart
# Do this..
Edit /usr/local/nagios/addons/ninja/op5build/index.php
$ninja_base = '/usr/local/nagios/addons/ninja';
Edit /usr/local/nagios/addons/ninja/application/config/config.php
$config['nagios_base_path'] = '/etc/nagios';
$config['nagios_etc_path'] = '/etc/nagios';
$config['logos_path'] = '/nagios/images/logos/';
$config['pnp4nagios_path'] = false;
# Import users into Ninja DB
cd /usr/local/nagios/addons/ninja/install_scripts
./ninja_db_init.sh /usr/local/nagios/addons/ninja
./auth_import.php /usr/local/nagios/addons/ninja
**************************
SMS NOTIFICATION / GATEWAY
**************************
# Download the necessary libraries/software
apt-get install gnokii
apt-get install gsmlib
# Enable cdc_amc support
sudo modprobe cdc_acm
# Plug your USB Phone (tested with KRZR K1) and check to see if its detected
lsusb
root at van-nagios-new:~# lsusb
Bus 004 Device 008: ID 22b8:4902 Motorola PCS Triplet GSM Phone (AT)
Bus 004 Device 002: ID 413c:a001 Dell Computer Corp. Hub
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
# You need to make sure your phone is listed there in AT Mode, if it is not AT Mode, you need to look in your phone settings and change the USB connection from memory to phone because your computer might detect it as a disk device instead of mobile.
# Test a message to the phone..
Gsmsendsms -d /dev/ttyACM0 0001112222 "message test"
# You need to make sure that using the -d slash, you are pointing to the correct device in /dev which would be your phone (could be ttyUSB1 or something different)
# Add the following to your commands.cfg for notifications, remember to edit accordingly to match your /dev/ttyDEVICE
define command{
command_name notify-service-by-sms
command_line /usr/bin/gsmsendsms -d /dev/ttyACM0 $CONTACTPAGER$ "Nagios $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($SERVICEOUTPUT$)"
}
define command{
command_name notify-host-by-sms
command_line /usr/bin/gsmsendsms -d /dev/ttyACM0 $CONTACTPAGER$ "Nagios $NOTIFICATIONTYPE$ : Host $HOSTALIAS$ is $HOSTSTATE$ ($OUTPUT$)"
}
# Add the following to your contacts.cfg definition for each contact that is to be notified by SMS
service_notification_commands notify-service-by-email,notify-service-by-sms
host_notification_commands notify-host-by-email,notify-host-by-sms
*****************
NINJA: PNP4Nagios
*****************
# edit /usr/local/nagios/addons/ninja/application/config/config.php
$config['pnp4nagios_path'] = '/nagios/pnp/';
$config['pnp4nagios_config_path'] = '/usr/local/nagios/etc/pnp/config.php';
//END
More information about the op5-users
mailing list