Page 1 of 3

issue with the Nagios

Posted: Mon Dec 07, 2015 2:06 pm
by h.sabrey
as i'm somehow new in linux, and i'm required to install a monitoring system to our company using CentOS7 with LAMP & the monitoring Application NAGIOS.

after installation everything goes well, until the installation of the TeamViewer then the nagios stopped and other issues happened thus this quesion(s) comes up.

1- apache service is confirmed running by

Code: Select all

service httpd status
the following was the result

Code: Select all

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since Sun 2015-12-06 22:29:35 EET; 9h ago
  Process: 27173 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 3015 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
  Main PID: 27179 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─ 3032 /usr/sbin/httpd -DFOREGROUND
           ├─ 3033 /usr/sbin/httpd -DFOREGROUND
           ├─ 3034 /usr/sbin/httpd -DFOREGROUND
           ├─ 3035 /usr/sbin/httpd -DFOREGROUND
           ├─ 3036 /usr/sbin/httpd -DFOREGROUND
           └─27179 /usr/sbin/httpd -DFOREGROUND
but when trying to access the server http://192.168.1.7 there is no page to load ???

2- for Nagios, when checking the status it is running normally similar to the apache step, but when accessing the web http://192.168.1.7/nagios not webpage page to load ????

3- how to confirm that the apache and the nagios are autorun as a service after the server reboots?

Re: issue with the Nagios

Posted: Mon Dec 07, 2015 2:11 pm
by hsmith
How did you install Nagios?

Source? Repo? Guide? If so, please link it.

It was working until you installed TeamViewer? Can you please go into more depth regarding this?
h.sabrey wrote:2- for Nagios, when checking the status it is running normally similar to the apache step, but when accessing the web http://192.168.1.7/nagios not webpage page to load ????
Is there a firewall running on your server?

Code: Select all

systemctl status firewalld
h.sabrey wrote:how to confirm that the apache and the nagios are autorun as a service after the server reboots?

Code: Select all

systemctl is-enabled httpd
systemctl is-enabled nagios

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 3:46 am
by h.sabrey
Nagios installation guide
https://www.youtube.com/watch?v=hQeVkapSaqM

firewall status :

Code: Select all

systemctl status firewalld
         firewalld.service - firewalld - dynamic firewall daemon
             Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
            Active: active (running) since Wed 2015-11-04 12:57:22 EET; 1 months 3 days ago
         Main PID: 692 (firewalld)
         CGroup: /system.slice/firewalld.service
                      └─692 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
for confirmation :

Code: Select all

$ system is-enabled httpd
bash: system: command not found...
[sysadmin@nagos-server ~]$ systemctl is-enabled httpd
disabled

Code: Select all

$ systemctl is-enabled nagios
nagios.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig nagios --level=5
enabled

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 9:41 am
by mleo40
your apache isn't running.

/etc/init.d/apache start (it might be /etc/init.d/httpd start...not overly familiar with CentOS)

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 10:17 am
by hsmith
mleo40 wrote:/etc/init.d/apache start (it might be /etc/init.d/httpd start...not overly familiar with CentOS)
it's httpd :)

service httpd status will tell you whether or not it is running as well.

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 1:39 pm
by h.sabrey
friends,

for now i've added the httpd to the systemctl auto run by

Code: Select all

# systemctl enable httpd.service
but still not able to connect to nagios web portal

BTW i'm receiving emails from nagios as notification of one device which is not in my network ????

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 1:45 pm
by mleo40
that command only enables the service at boot time, it doesn't actually start it

try systemctl start httpd.service

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 1:46 pm
by rkennedy
Can you post the output of the following command -

Code: Select all

netstat -anp|grep :80

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 1:59 pm
by h.sabrey
[
rkennedy wrote:Can you post the output of the following command -

Code: Select all

netstat -anp|grep :80

Code: Select all

# netstat -anp|grep :80
tcp6       0      0 :::80                   :::*                    LISTEN      3032/httpd 

Re: issue with the Nagios

Posted: Tue Dec 08, 2015 2:02 pm
by mleo40
Working output:

# netstat -anp|grep :80
tcp 0 0 :::80 :::* LISTEN 13150/httpd

your machine is only listening on ipv6 ... ? That is strange