Page 1 of 2

Can't configure MNTOS on my Nagios...

Posted: Thu Nov 06, 2014 11:32 am
by miroras
Hi All.

Environment Details:
Ubuntu 14.04.1 LTS
NagiosĀ® Coreā„¢ 4.0.8

While trying to install MNTOS on one of my nagios machines, im getting the following right after i finish configuration:

iptables: No chain/target/match by that name.
Bad argument `save'
Try `iptables -h' or 'iptables --help' for more information.
iptables: unrecognized service
httpd: unrecognized service

Re: Can't configure MNTOS on my Nagios...

Posted: Thu Nov 06, 2014 1:23 pm
by rhassing
This looks like an faulty iptables line in your config script.
Try to find what they are trying to do with iptables.
Do

Code: Select all

grep iptables ./*
in the directory from where you tried to install.

Or else maybe the following might help?
http://beginlinux.com/server/installing ... ring-mntos
Or
http://exchange.nagios.org/directory/Tu ... OS/details

Re: Can't configure MNTOS on my Nagios...

Posted: Thu Nov 06, 2014 3:00 pm
by slansing
Agreed, looks like an iptables issue, let us know what your responses are to Rob's questions, thanks!

Re: Can't configure MNTOS on my Nagios...

Posted: Sun Nov 09, 2014 11:35 am
by miroras
Thanks for the response!

this is what i get:

./NagiosXI-MNTOS-install.sh:iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
./NagiosXI-MNTOS-install.sh:iptables save
./NagiosXI-MNTOS-install.sh:service iptables restart

Re: Can't configure MNTOS on my Nagios...

Posted: Mon Nov 10, 2014 9:34 am
by rhassing
./NagiosXI-MNTOS-install.sh:iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
This looks like it assumes you install on a Redhat server. It should be no problem to remove the lines which would adjust your iptables and do it manually.

Re: Can't configure MNTOS on my Nagios...

Posted: Mon Nov 10, 2014 10:11 am
by slansing
If you can post that install script, we will be able to point out where this would be commented out.

Re: Can't configure MNTOS on my Nagios...

Posted: Tue Nov 11, 2014 4:38 am
by miroras
from the MNTOS sh file:


#!/bin/sh

# Check whether we have sufficient privileges
if [ $(whoami) != "root" ]; then
echo "This script needs to be run as root/superuser."
exit 1
fi

# Install prerequisite packages
yum install -yq wget httpd php php-xml

# Download and install MNTOS from Exchange
cd /opt
wget "http://exchange.nagios.org/components/c ... 8&cf_id=24" -O mntos-1.0.tar.gz.gz
gunzip mntos-1.0.tar.gz.gz
tar zxf mntos-1.0.tar.gz
rm mntos-1.0.tar.gz
cd mntos-1.0
wget "http://assets.nagios.com/downloads/nagi ... /globe.png" -O www/img/globe.png
wget "http://assets.nagios.com/downloads/nagi ... nfigure.py"
chmod +x NagiosXI-MNTOS-configure.py

# Make necessary changes to MNTOS configuration file
sed -i 's/contacts\=.*/contacts="\/opt\/mntos-1\.0\/"/' config.ini
sed -i 's/networks\=.*/networks="\/opt\/mntos-1\.0\/"/' config.ini
sed -i 's/xmloutput\=.*/xmloutput="\/opt\/mntos-1.0\/www\/"/' config.ini

# Walk through initial setup of contacts and networks to show in the interface
./NagiosXI-MNTOS-configure.py

# Make sure this server allows HTTP connections to view the dashboard
iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables save
service iptables restart

# Update information from the remote Nagios servers via cron
echo '* * * * * /usr/bin/php /opt/mntos-1.0/mntos.php /dev/null 2>&1' > /etc/cron.d/mntos

# This line is here so it can be changed if the cron job is changed to run less than every minute (it's in seconds)
sed -i 's/refreshfreq\ =\ 60/refreshfreq\ =\ 60/' www/index.php

# Adjust permissions
chown -R nagios:www-data .
chmod o-r networks.ini
chmod g+w .

# Create a virtual host definition for Apache
echo -e "\
Alias /mntos \"/opt/mntos-1.0/www\"\n\
\n\
<Directory \"/opt/mntos-1.0/www\">\n\
# SSLRequireSSL\n\
Options None\n\
AllowOverride None\n\
Order allow,deny\n\
Allow from all\n\
</Directory>" > /etc/httpd/conf.d/mntos.conf

# Reload Apache configuration
service httpd restart

echo ""
echo "============================="
echo "MNTOS Installation Complete!"
echo "You can now view the MNTOS interface at http://"$(ifconfig | grep "inet\ addr" | head -n1 | sed 's/^[^:]*://' | sed 's/\ .*//')"/mntos/"
echo "============================="

Re: Can't configure MNTOS on my Nagios...

Posted: Tue Nov 11, 2014 10:48 am
by tmcdonald
Change the following lines:

Code: Select all

# Make sure this server allows HTTP connections to view the dashboard
iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables save
service iptables restart
to

Code: Select all

# Make sure this server allows HTTP connections to view the dashboard
#iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#iptables save
#service iptables restart
then run again.

Re: Can't configure MNTOS on my Nagios...

Posted: Tue Nov 11, 2014 12:19 pm
by miroras
HI, thanks for the replay.

removed it from the script.

now i get "httpd is not a known service"

and the same result.

Re: Can't configure MNTOS on my Nagios...

Posted: Tue Nov 11, 2014 12:23 pm
by slansing
Okay, are you installing this on a server that already has core set up? And what distro are you installing on? If it really is Ubuntu, this script may not be meant for it (i.e looking for httpd instead of apache2 as that service). I suggest following a guide which coveres your distro, such as this one:

http://beginlinux.com/server/installing ... ring-mntos