Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgCode: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgCode: Select all
root@debianNC:/usr/local/nagios/etc/objects# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
root@debianNC:/usr/local/nagios/etc/objects# cat oficina.cfg
#define host{
# use generic-networking-device
# host_name FIREWALL
# alias FIREWALL
# address 192.168.6.1
# }
#define service{
# use generic-service
# host_name FIREWALL
# service_description Ping
# check_command check_ping!60.0,5%!100.0,10%
# }
root@debianNC:/usr/local/nagios/etc/objects#Code: Select all
root@debianNC:/usr/local/nagios/etc/objects# ls
baxo.cfg contacts.cfg oficina.cfg switch.cfg timeperiods.cfg
commands.cfg localhost.cfg printer.cfg templates.cfg windows.cfg
root@debianNC:/usr/local/nagios/etc/objects# cp oficina.cfg BKPoficina22042019.cfg
root@debianNC:/usr/local/nagios/etc/objects# rm oficina.cfg
root@debianNC:/usr/local/nagios/etc/objects# cp localhost.cfg oficina.cfg
root@debianNC:/usr/local/nagios/etc/objects# nano oficina.cfg
root@debianNC:/usr/local/nagios/etc/objects# cat oficina.cfg
###############################################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
#
# NOTE: This config file is intended to serve as an *extremely* simple
# example of how you can create configuration entries to monitor
# the local (Linux) machine.
#
###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
# 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 firewall
alias firewall
address 192.168.6.1
}
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
# Define a service to "ping" the local machine
define service {
use local-service ; Name of service template to use
host_name firewall
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
root@debianNC:/usr/local/nagios/etc/objects# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/objects/oficina.cfg
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/objects/oficina.cfg' - Line 21 (NULL value)
Error processing main config file!
root@debianNC:/usr/local/nagios/etc/objects# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 9 services.
Checked 2 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
root@debianNC:/usr/local/nagios/etc/objects#Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg