Probably another web interface 404 thread :)

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.
Locked
datguy.dev
Posts: 2
Joined: Thu Feb 11, 2016 5:57 pm

Probably another web interface 404 thread :)

Post by datguy.dev »

Greetings,
I so was looking for a network monitoring platform to run on a Raspberry Pi (Raspbian). A friend of mine recommended Nagios, so I thought I'd try out the core+plugins. The issue is I get "curl: (6) Couldn't resolve host 'http:192.168.1.169,'" 404 unreachable on other machines or browser, when trying to reach the web interface. I've come to a point where I'm trying random solutions. So I thought I'd ask here first instead of digging the hole even deeper; so to speak.

Initially, I read threw and followed the instructions here: https://assets.nagios.com/downloads/nag ... Source.pdf The installation went fine until "make install-webconf." I did not have any web applications installed like apache to save space on 4GB SD card.

I followed these instruction as a remedy:
1-sudo mkdir /etc/httpd
2-sudo mkdir /etc/httpd/conf.d
3-sudo mkdir /etc/httpd/conf.d/nagios.conf
Along with sudo apt-get install build-essential libgd2-xpm-dev apache2-utils

After doing these suggestions, install-webconf passed without error. Everything was smooth sailing from these. I simply completed the install, added the plugins, then manually started the nagios service. Then this is when I the the web interface wall. Experience wise, I'm not that new to linux but I still have a lot to learn. If you would help me figure this out I would greatly appreciate your efforts. <3

Hopefully this information will be of some use?

Code: Select all

pi@raspberrypi /etc $ ls -l -R ./httpd/
./httpd/:
total 4
drwxr-xr-x 3 nagios nagcmd 4096 Feb 11 16:52 conf.d

./httpd/conf.d:
total 4
drwxr-xr-x 2 nagios nagcmd 4096 Feb 11 17:45 nagios.conf

./httpd/conf.d/nagios.conf:
total 4
-rw-r--r-- 1 nagios nagcmd 1679 Feb 11 17:45 httpd.conf

root@raspberrypi:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

root@raspberrypi:~# curl http:192.168.1.169/nagios
curl: (6) Couldn't resolve host 'http:192.168.1.169'
root@raspberrypi:~# 
root@raspberrypi:~# curl http:192.168.1.169/nagios
curl: (6) Couldn't resolve host 'http:192.168.1.169'
root@raspberrypi:~# curl http:192.168.1.169
curl: (6) Couldn't resolve host 'http:192.168.1.169'

root@raspberrypi:~# id -Gn
root indiecity
root@raspberrypi:~# exit
logout
pi@raspberrypi /etc/httpd/conf.d/nagios.conf $ groups
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input

pi@raspberrypi /etc/httpd/conf.d/nagios.conf $ sudo service --status-all
 [ ? ]  alsa-utils
 [ + ]  apache2
 [ + ]  avahi-daemon
 [ - ]  bootlogs
 [ ? ]  bootmisc.sh
 [ ? ]  cgroup-bin
 [ ? ]  checkfs.sh
 [ ? ]  checkroot-bootclean.sh
 [ - ]  checkroot.sh
 [ - ]  console-setup
 [ + ]  cron
 [ + ]  dbus
 [ + ]  dhcpcd
 [ ? ]  dphys-swapfile
 [ ? ]  fake-hwclock
 [ - ]  hostname.sh
 [ ? ]  hwclock.sh
 [ + ]  ifplugd
 [ - ]  kbd
 [ - ]  keyboard-setup
 [ ? ]  killprocs
 [ ? ]  kmod
 [ - ]  lightdm
 [ - ]  motd
 [ ? ]  mountall-bootclean.sh
 [ ? ]  mountall.sh
 [ ? ]  mountdevsubfs.sh
 [ ? ]  mountkernfs.sh
 [ ? ]  mountnfs-bootclean.sh
 [ ? ]  mountnfs.sh
 [ ? ]  mtab.sh
 [ + ]  nagios
 [ ? ]  networking
 [ - ]  nfs-common
 [ + ]  ntp
 [ + ]  openbsd-inetd
 [ ? ]  plymouth
 [ ? ]  plymouth-log
 [ - ]  procps
 [ ? ]  raspi-config
 [ ? ]  rc.local
 [ - ]  rmnologin
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  samba
 [ ? ]  sendsigs
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  tor
 [ + ]  triggerhappy
 [ + ]  udev
 [ ? ]  udev-mtab
 [ ? ]  umountfs
 [ ? ]  umountnfs.sh
 [ ? ]  umountroot
 [ - ]  urandom
 [ - ]  x11-common
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Probably another web interface 404 thread :)

Post by rkennedy »

To clarify - you will need httpd running.

I believe the command you're looking to run is -

Code: Select all

http:://192.168.1.169
Additionally, this should be a file, and not a directory -
3-sudo mkdir /etc/httpd/conf.d/nagios.conf
Here's the contents of my nagios.conf -

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>
What is the output of these commands?

Code: Select all

service httpd status
service nagios status
Former Nagios Employee
datguy.dev
Posts: 2
Joined: Thu Feb 11, 2016 5:57 pm

Re: Probably another web interface 404 thread :)

Post by datguy.dev »

Sorry, please close this thread.

While awaiting moderation I stumbled upon a solution. I had to add the red text here: http://nagios.manubulon.com/traduction/ ... llweb.html to apche2.conf. But after experiencing the process of registering hosts, I decided not to use Nagios in the end.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Probably another web interface 404 thread :)

Post by rkennedy »

Sounds good - looks like the apache configuration didn't generate.

Feel free to open a new thread if you need any assistance in the future.
Former Nagios Employee
Locked