Mike Weber's presentation on Expanding NRDS Capabilities on Linux Systems.
The presentation was given during the Nagios World Conference North America held Oct 13th - Oct 16th, 2014 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/conference
2. NRDS: Introduction
• Basic Functionality
Passive checks with Active Config Updates
• Multiple Configurations
Group Check Categories
Create Multiple Check Times
• StoreandForward
Create timestamps to maintain data in disconnects.
4. Multiple Configurations
• Multiple Group Checks
Grouping checks based on type provide more efficient management
aspects. (Linux_OS, Oracle, Apache, etc.)
• Multiple Check Times
Multiple check times lessens the load on the server and provides best
practice use of resources. (5 min., 30 min.,etc.)
• Multiple Download Options
NRDS can be used to download, packages, plugins, scripts,etc.
5. Multiple Configurations
Why Multiple Configurations
• Reduce Load on Server
• Logs Analyzed for Summaries
daily, weekly, monthly
• Low Tech Skills
• Limited Host Access
9. Multiple Configurations
Install Procedure
SSH into the hotel pbx and become root.
sudo su
cd /tmp
wget nocheckcertificate
O
install.tar.gz "https://192.168.1.1/nrdp/?
cmd=nrdsgetclient&token=Gh78TFcD&configname=
Unpack the package
tar xzvf install.tar.gz
Install the package
cd clients
./installnrds install 30
Note, this install script will be used for every hotel. It is going to
install NRDS and download the package for the rest of the installation.
Any host called install in the Unconfigured Objects should be removed,
10. Multiple Configurations
Install the Package
cd /tmp
tar xvf package64.tar
cd package
Now you will execute a script that will ask for the name of the hotel
server and the IP Address of the hotel server, be sure these are
absolutely correct as the script will change all of the files to reflect the
options entered.
Enter the host when asked.
Now execute the install script.
./install.sh
11. Multiple Configurations
Purpose of package64.tar
• Download All Plugins
• Download All NRDS Groups
When the script executes it will detect and setup the proper
groups.
• Download install.sh
16. Multiple Configurations
Admin_Server.pl
Required Changes to Custom Groups
my $nrds_updater = "/usr/local/nrdp/clients/nrds/admin_server_updater.pl";
my $configfile = "/usr/local/nrdp/clients/nrds/admin_server.cfg";
20. Multiple Configurations
Install.sh
##### Install check_oracle_health #####
cd ..
cd support
export ORACLE_HOME="/usr/lib/oracle/11.2/client64"
export LD_LIBRARY_PATH="$ORACLE_HOME/lib"
tar zxvf check_oracle_health1.7.8.1.
tar.gz
cd check_oracle_health1.7.8.1
./configure
make
make install
mkdir /var/tmp/check_oracle_health
chown R
nagios /var/tmp/check_oracle_health
22. Multiple Configurations
Install.sh
##### CPU Core Set Up #####
arg0=2
arg1=1.5
arg2=1
arg3=3
arg4=2.5
arg5=0.5
cpu_nb=$(grep c
^processor /proc/cpuinfo)
arg0=$((cpu_nb * arg0))
arg1=$(echo "scale=1;${cpu_nb} * ${arg1}" | bc)
arg1=$(echo ${arg1} | sed e
's/.0$//')
arg2=$((cpu_nb * arg2))
23. Multiple Configurations
Install.sh
##### Set Hostname #####
host=$(hostname)
echo $host
echo "#####"
echo "Use the hostname above as a base as you type the server name"
read name
echo "#####"
oldString="txb"
newString="$name"
dpath="/tmp/package64/nrds/*.cfg"
sed i
"s/${oldString}/${newString}/g" /tmp/package64/crontab
for i in $dpath; do
27. Multiple Configurations
Install.sh
##### App Server Install #####
APP_SERVER=$(ps ef|
grep tnslsnr|grep v
grep|wc l)
if [ ${APP_SERVER} == '1' ]; then
echo "Installing Application Server"
cp /tmp/package64/nrds/oracle_app* /usr/local/nrdp/clients/nrds/
sed i
's/#*/5/*5/' /tmp/package64/crontab
else
echo "No Application Server Installed...no plugins will be installed for App
Server"
fi
28. Multiple Configurations
Install.sh
##### Admin Server Install #####
ADMIN_SERVER=$(ps ef|
grep FNDLIBR|grep v
grep|wc l)
if [ ${ADMIN_SERVER} == '1' ]; then
echo "Installing Admin Server"
cp /tmp/package64/nrds/oracle_admin* /usr/local/nrdp/clients/nrds/
sed i
's/#*/6/*6/' /tmp/package64/crontab
else
echo "No Admin Server Installed...no plugins will be installed for Admin
Server"
fi
29. Multiple Configurations
Install.sh
##### Move New Configs #####
cd /tmp/package64/nrds
cp nrds* /usr/local/nrdp/clients/nrds/
cp custom* /usr/local/nrdp/clients/nrds/
chown nagios:nagios /usr/local/nrdp/clients/nrds/*
##### Install Cron Jobs #####
/tmp/package64/crontab
exit
31. Store-and-Forward
• Basic Problem
Network connections broken for multiple days.
• Solution: NRDS Timestamps
Using timestamps NRDS is able to rebuild data and
graphing on the Nagios server.
40. Store-and-Forward
NRDS Client
Add a cache line in /usr/local/nrdp/clients/nrds/nrds.cfg
CACHEDIR="/usr/local/nrdp/clients/cache"
Create folder /usr/local/nrdp/clients/cache
The cache needs to collect timestamped data in order to rebuild the information
later.
mkdir /usr/local/nrdp/clients/cache
chown nagios.nagios /usr/local/nrdp/clients/cache
chmod 0775 /usr/local/nrdp/clients/cache
Timestamps Being Created
drwxrxrx
2 nagios nagios 4096 Sep 20 07:39 mylock
rw1
nagios nagios 1742 Sep 20 07:24 nrdp.6pvqRR1IJ
rw1
nagios nagios 1742 Sep 20 07:30 nrdp.B6qVekdsa
41. Store-and-Forward
NRDS Client
Replace /usr/local/nrdp/clients/send_nrdp.sh
original
if [ "x$url" == "x" o
"x$token" == "x" ]
echo "Usage: send_nrdp u
url t
token"
Reference to cache directory
if [ "x$url" == "x" o
"x$token" == "x" o
"x$directory" == "x" ]
echo "Usage: send_nrdp u
url t
token D
directory"