Page 3 of 5

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 2:15 pm
by t3dus
Trying again now but I also had to run

Code: Select all

yum install nano

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 2:25 pm
by t3dus
Got it working this time.

Do you guys got a good guide to install Nagios QL now?

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 2:47 pm
by t3dus
I just noticed that Nagios claims that localhost is down though and nets this error

Code: Select all

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_ping, ...) failed. errno is 2: No such file or directory
I manually added a new host and it shows the same error as well.

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 2:52 pm
by rkennedy
NagiosQL is not a product written by us, and with that said we aren't able to provide support for it.

It looks like you're missing the plugins, did you follow this part?

Code: Select all

PLUGINS:
cd /tmp/nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make all
make install
service nagios restart
If so, what is the output from this command?

Code: Select all

ls -l /usr/local/nagios/libexec/

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 3:10 pm
by t3dus
I had forgotten to do that the first time.

Looks like it might be ok now.

This is the output of that command you had me run.

Code: Select all

# ls -l /usr/local/nagios/libexec/
total 6340
-rwxr-xr-x. 1 nagios nagios 205922 Feb  8 15:08 check_apt
-rwxr-xr-x. 1 nagios nagios   2309 Feb  8 15:08 check_breeze
-rwxr-xr-x. 1 nagios nagios 210127 Feb  8 15:08 check_by_ssh
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_clamd -> check_tcp
-rwxr-xr-x. 1 nagios nagios 158867 Feb  8 15:08 check_cluster
-r-sr-xr-x. 1 root   nagios 207752 Feb  8 15:08 check_dhcp
-rwxr-xr-x. 1 nagios nagios 224866 Feb  8 15:08 check_disk
-rwxr-xr-x. 1 nagios nagios   9348 Feb  8 15:08 check_disk_smb
-rwxr-xr-x. 1 nagios nagios 118795 Feb  8 15:08 check_dummy
-rwxr-xr-x. 1 nagios nagios   3542 Feb  8 15:08 check_file_age
-rwxr-xr-x. 1 nagios nagios   6375 Feb  8 15:08 check_flexlm
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_ftp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 348334 Feb  8 15:08 check_http
-r-sr-xr-x. 1 root   nagios 219395 Feb  8 15:08 check_icmp
-rwxr-xr-x. 1 nagios nagios 165737 Feb  8 15:08 check_ide_smart
-rwxr-xr-x. 1 nagios nagios  15238 Feb  8 15:08 check_ifoperstatus
-rwxr-xr-x. 1 nagios nagios  13386 Feb  8 15:08 check_ifstatus
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_imap -> check_tcp
-rwxr-xr-x. 1 nagios nagios   6947 Feb  8 15:08 check_ircd
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_jabber -> check_tcp
-rwxr-xr-x. 1 nagios nagios 183426 Feb  8 15:08 check_load
-rwxr-xr-x. 1 nagios nagios   6595 Feb  8 15:08 check_log
-rwxr-xr-x. 1 nagios nagios  22730 Feb  8 15:08 check_mailq
-rwxr-xr-x. 1 nagios nagios 164911 Feb  8 15:08 check_mrtg
-rwxr-xr-x. 1 nagios nagios 166268 Feb  8 15:08 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 182286 Feb  8 15:08 check_nagios
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_nntp -> check_tcp
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_nntps -> check_tcp
-rwxr-xr-x. 1 nagios nagios 211452 Feb  8 15:08 check_nt
-rwxr-xr-x. 1 nagios nagios 214711 Feb  8 15:08 check_ntp
-rwxr-xr-x. 1 nagios nagios 203908 Feb  8 15:08 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 199073 Feb  8 15:08 check_ntp_time
-rwxr-xr-x. 1 nagios nagios 245989 Feb  8 15:08 check_nwstat
-rwxr-xr-x. 1 nagios nagios   8926 Feb  8 15:08 check_oracle
-rwxr-xr-x. 1 nagios nagios 184583 Feb  8 15:08 check_overcr
-rwxr-xr-x. 1 nagios nagios 214756 Feb  8 15:08 check_ping
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_pop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 215914 Feb  8 15:08 check_procs
-rwxr-xr-x. 1 nagios nagios 181349 Feb  8 15:08 check_real
-rwxr-xr-x. 1 nagios nagios   9642 Feb  8 15:08 check_rpc
-rwxr-xr-x. 1 nagios nagios   1465 Feb  8 15:08 check_sensors
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_simap -> check_tcp
-rwxr-xr-x. 1 nagios nagios 272363 Feb  8 15:08 check_smtp
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_spop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 180848 Feb  8 15:08 check_ssh
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 162647 Feb  8 15:08 check_swap
-rwxr-xr-x. 1 nagios nagios 257854 Feb  8 15:08 check_tcp
-rwxr-xr-x. 1 nagios nagios 182651 Feb  8 15:08 check_time
lrwxrwxrwx. 1 root   root        9 Feb  8 15:08 check_udp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 195159 Feb  8 15:08 check_ups
-rwxr-xr-x. 1 nagios nagios 155189 Feb  8 15:08 check_uptime
-rwxr-xr-x. 1 nagios nagios 153879 Feb  8 15:08 check_users
-rwxr-xr-x. 1 nagios nagios   2995 Feb  8 15:08 check_wave
-rwxr-xr-x. 1 nagios nagios 149404 Feb  8 15:08 negate
-rwxr-xr-x. 1 nagios nagios 147032 Feb  8 15:08 urlize
-rwxr-xr-x. 1 nagios nagios   1914 Feb  8 15:08 utils.pm
-rwxr-xr-x. 1 nagios nagios   2791 Feb  8 15:08 utils.sh

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 3:13 pm
by rkennedy
This looks fine, your checks should be working now on localhost. Can you confirm that they are?

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 3:18 pm
by t3dus
Localhost is working fine now.

I do have one more question.

When you manually edit a config file what do you do if you delete the hostfile or modify it?

I changed my test host from google.com to monitor one of my homepages but now it gives me this error when i verify before restarting nagios.

Code: Select all

Error: Could not find any host matching 'google.com' (config file '/usr/local/nagios/etc/objects/matthome.cfg', starting on line 32)
Error: Failed to expand host list 'google.com' for service 'HTTP' (/usr/local/nagios/etc/objects/matthome.cfg:32)
   Error processing object config files!

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 4:10 pm
by rkennedy
You also need to create a host for google.com. Can you post the file matthome.cfg for us to look at?

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 4:34 pm
by t3dus
rkennedy wrote:You also need to create a host for google.com. Can you post the file matthome.cfg for us to look at?
Nothing fancy. just looks like this

Code: Select all

# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               google.com
        alias                   google.com
        address                 www.google.com
        }

###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

# Define a service to "ping" the local machine

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       google.com
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }

# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       google.com
        service_description             HTTP
        check_command                   check_http
        notifications_enabled           0
        }
Btw Nagios fails to ping it for some unknown reason..

CRITICAL - Network Unreachable (www.google.com)

Re: Fresh Install Nagios 4 "Error in configuration file"

Posted: Mon Feb 08, 2016 5:01 pm
by rkennedy
The config you posted looks fine, did you modify it to have the host_name google.com already then?

Do you have DNS configured on your Centos 7 machine? What is the result of a ping http://www.google.com from the command line?