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.
# ping google.com
PING google.com (167.142.232.59) 56(84) bytes of data.
64 bytes from 167.142.232.59: icmp_seq=1 ttl=58 time=7.49 ms
64 bytes from 167.142.232.59: icmp_seq=2 ttl=58 time=4.88 ms
64 bytes from 167.142.232.59: icmp_seq=3 ttl=58 time=5.13 ms
64 bytes from 167.142.232.59: icmp_seq=4 ttl=58 time=4.90 ms
64 bytes from 167.142.232.59: icmp_seq=5 ttl=58 time=6.15 ms
Try creating a new config, calling this "yahoo.cfg" - with every service definition you have, you also need a host definition. As an example, I just replaced everything from google.com -> yahoo.com. You should now be monitoring both search engines.
# 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 yahoo.com
alias yahoo.com
address www.yahoo.com
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use generic-service ; Name of service template to use
host_name yahoo.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 yahoo.com
service_description HTTP
check_command check_http
notifications_enabled 0
}
t3dus wrote:Done but both google.com and yahoo.com appear to be down even though I can ping both from the command line.
nagios.png
Added one of our company websites though and that works fine. Guess I don't care to monitor google.com and yahoo.com anyways but still weird why i can't.
Where would i find out how to setup e-mail notifications now.
# sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'yahoo.com' (config file '/usr/local/nagios/etc/objects/globalid.cfg', starting on line 32)
Error: Failed to expand host list 'yahoo.com' for service 'HTTP' (/usr/local/nagios/etc/objects/globalid.cfg:32)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
How do I get past that? I don't care to monitor yahoo or google so i don't want them in that file as hosts
# 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 GID Web
alias global-id-group.com
address www.global-id-group.com
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use generic-service ; Name of service template to use
host_name yahoo.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 yahoo.com
service_description HTTP
check_command check_http
notifications_enabled 0
}
GNU nano 2.3.1 File: /usr/local/nagios/etc/objects/globalid.cfg Modified
# 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 GID Web
alias global-id-group.com
address www.global-id-group.com
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use generic-service ; Name of service template to use
host_name GID Web
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 GID Web
service_description HTTP
check_command check_http
notifications_enabled 0
}
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'google.com' (config file '/usr/local/nagios/etc/objects/homeg3kxyz.cfg', starting on line 32)
Error: Failed to expand host list 'google.com' for service 'HTTP' (/usr/local/nagios/etc/objects/homeg3kxyz.cfg:32)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
define service{
use generic-service ; Name of service template to use
host_name yahoo.com
service_description HTTP
check_command check_http
notifications_enabled 0
}