Can't configure MNTOS on my Nagios...
Can't configure MNTOS on my Nagios...
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
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...
This looks like an faulty iptables line in your config script.
Try to find what they are trying to do with iptables.
Do
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
Try to find what they are trying to do with iptables.
Do
Code: Select all
grep iptables ./*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


-
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...
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...
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
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...
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../NagiosXI-MNTOS-install.sh:iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Rob Hassing


-
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...
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...
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 "============================="
#!/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...
Change the following lines:
to
then run again.
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
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
Former Nagios employee
Re: Can't configure MNTOS on my Nagios...
HI, thanks for the replay.
removed it from the script.
now i get "httpd is not a known service"
and the same result.
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...
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
http://beginlinux.com/server/installing ... ring-mntos