Can't configure MNTOS on my Nagios...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
miroras
Posts: 7
Joined: Thu Nov 06, 2014 11:23 am

Can't configure MNTOS on my Nagios...

Post 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
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

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

Post 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
Rob Hassing
Image
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Agreed, looks like an iptables issue, let us know what your responses are to Rob's questions, thanks!
miroras
Posts: 7
Joined: Thu Nov 06, 2014 11:23 am

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

Post 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
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

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

Post 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.
Rob Hassing
Image
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

If you can post that install script, we will be able to point out where this would be commented out.
miroras
Posts: 7
Joined: Thu Nov 06, 2014 11:23 am

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

Post 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 "============================="
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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.
Former Nagios employee
miroras
Posts: 7
Joined: Thu Nov 06, 2014 11:23 am

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

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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
Locked