Getting Nagios setup for the first time.

July 7, 2019 592 views
Monitoring Linux Basics CentOS

Hello,

I am pretty new to Linux and I am trying to build a Nagios Monitoring System using CentOS7 Minimal version.

I follow this instruction on building my Nagios (https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-centos-7)

However, I cannot seem to start my nagios webpage. Below are some of the command that might help.

service httpd status

Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)

man:apachectl(8)

service nagios status

nagios (pid 3968) is running…

sudo apachectl configtest

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using fe80::215:5dff:fe47:a10. Set the ‘ServerName’ directive globally to suppress this message

Syntax OK

Would really appreciate any help.

1 comment
  • Sorry for the format text above, I didn’t know how to edit my post to fix it.

3 Answers

Hello,

Can you try the following:

  • First try starting your httpd service and then check the status again (the hostname warning that you are getting is not a problem)
  • If httpd fails to start, check your httpd error logs for the exact error that you get
  • Also use the netstat -plant command to check your ports, maybe there’s another service already listening on port 80 and that’s why apache is failing to start

If you wish you could provide me with your httpd error logs and the output of the netstat command so that I could advice further.

Regards,
Bobby

  • Hi Bobby,

    Here is the status of my httpd service:

    code
    # service httpd status
    Redirecting to /bin/systemctl status httpd.service
    ● httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2019-07-09 08:09:10 NZST; 3min 50s ago
         Docs: man:httpd(8)
               man:apachectl(8)
     Main PID: 1078 (httpd)
       Status: "Total requests: 1; Current requests/sec: 0; Current traffic:   0 B/sec"
       CGroup: /system.slice/httpd.service
               ├─1078 /usr/sbin/httpd -DFOREGROUND
               ├─1196 /usr/sbin/httpd -DFOREGROUND
               ├─1198 /usr/sbin/httpd -DFOREGROUND
               ├─1199 /usr/sbin/httpd -DFOREGROUND
               ├─1200 /usr/sbin/httpd -DFOREGROUND
               └─1201 /usr/sbin/httpd -DFOREGROUND
    
    Jul 09 08:09:08 nz-nagios.agility.local systemd[1]: Starting The Apache HTTP Server...
    Jul 09 08:09:10 nz-nagios.agility.local systemd[1]: Started The Apache HTTP Server.
    
    

    I did actually try to fix the hostname issue thinking that is the culprit. I created a hostname for my Nagios.

    I assume my httpd are now starting properly?

    Here is the result of netstat:

    code
    
    # netstat -plant
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1080/sshd
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1210/master
    tcp        0      0 192.168.68.27:22        192.168.68.60:61566     ESTABLISHED 1384/sshd: root@pts
    tcp6       0      0 :::80                   :::*                    LISTEN      1078/httpd
    tcp6       0      0 :::22                   :::*                    LISTEN      1080/sshd
    tcp6       0      0 ::1:25                  :::*                    LISTEN      1210/master
    
    

    Anything I need to check?

    When I try to access my nagios using http://<IP ADDRESS>/nagios I still get Not Found The requested URL /nagios was not found on this server.

Just an update, after I run all these command again (https://assets.nagios.com/downloads/nagioscore/docs/Nagios-Core-Installing-On-Centos7.pdf#_ga=2.175257890.1451548335.1562281975-513490159.1562281975) it started my nagios. I just don’t know how messy this is now :)

Will just need to learn how to user Nagios. Thanks.

Oh that’s great! Well done :)

Regards,
Bobby

Have another answer? Share your knowledge.