Nagios® Core™ Version 4.0.8

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.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios® Core™ Version 4.0.8

Post by jdalrymple »

1) I wouldn't modify stuff in the objects folder, that's not a good idea. There is a conf.d folder which is where all of your configs should go
2) In the conf.d folder create a file called domates.karel.com.tr.cfg and put the following contents in it:

Code: Select all

define host{
use linux-server
host_name domates.karel.com.tr
alias dosya_paylasim1
address 192.168.169.120
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Root Partition
check_command   check_nrpe!check_disk
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Current Users
check_command   check_nrpe!check_users
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Total Processes
check_command   check_nrpe!check_procs
check_command   check_procs!250!400!RSZDT
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Current Load
check_command   check_nrpe!check_load
!5.0,4.0,3.0!10.0,6.0,4.0
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Swap Usage
check_command   check_nrpe!check_swap
!20!10
}
3) Erase your ubuntu.cfg file
4) Your nagios.cfg should not need to be modified.

Make these changes and let us know how it works.
Ulas
Posts: 11
Joined: Thu Mar 19, 2015 4:34 am

Re: Nagios® Core™ Version 4.0.8

Post by Ulas »

thanks for your quick response,
Unfortunately nothing happens, my configuration file triggered under the /usr/local/nagios/etc/objects
i did your steps but configuration file doesn't triggered under the path of /etc/nagios3/conf.d
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios® Core™ Version 4.0.8

Post by jdalrymple »

The conf.d folder would be in the same path as the objects folder.

Either way, it doesn't really matter where it is as long as you have a corresponding entry in your nagios.cfg:

Code: Select all

# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:

cfg_dir=/usr/local/nagios/etc/conf.d
Ulas
Posts: 11
Joined: Thu Mar 19, 2015 4:34 am

Re: Nagios® Core™ Version 4.0.8

Post by Ulas »

i got this output after i restart nagios
root@dosya:/usr/local/nagios/etc# sudo service nagios restart
Running configuration check...

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/conf.d/generic-host_nagios2.cfg', starting at line 3)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/conf.d/generic-service_nagios2.cfg', starting at line 2)
WARNING: Extinfo objects are deprecated and will be removed in future versions
Error: Template 'linux-server' specified in host definition could not be not found (config file '/usr/local/nagios/etc/conf.d/domates.karel.com.tr.cfg', starting on line 1)
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.


my domates.karel.com.tr.cfg file
root@dosya:/usr/local/nagios/etc/conf.d# cat domates.karel.com.tr.cfg
define host{
use linux-server
host_name domates.karel.com.tr
alias dosya_paylasim1
address 192.168.169.120
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Root Partition
check_command check_nrpe!check_disk
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Current Users
check_command check_nrpe!check_users
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Total Processes
check_command check_nrpe!check_procs
check_command check_procs!250!400!RSZDT
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Current Load
check_command check_nrpe!check_load!5.0,4.0,3.0!10.0,6.0,4.0
}

define service{
use generic-service ; Name of service template to use
host_name domates.karel.com.tr
service_description Swap Usage
check_command check_nrpe!check_swap!20!10
Ulas
Posts: 11
Joined: Thu Mar 19, 2015 4:34 am

Re: Nagios® Core™ Version 4.0.8

Post by Ulas »

i guess, i find the problem
connection problem with server and client
Centos 5.9 client ip:192.168.169.71
Ubuntu 14.04 nagios server ip:192.168.169.121

while i querying client as ;
at server side i got
root@dosya:~# /usr/lib/nagios/plugins/check_nrpe -H 192.168.169.71
CHECK_NRPE: Error - Could not complete SSL handshake.

at client side;
[root@ulas_linux_test nagios-plugins-2.0.3]# /usr/local/nagios/libexec/check_nrpe -H 192.168.169.121
Connection refused by host
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios® Core™ Version 4.0.8

Post by jdalrymple »

Code: Select all

Error: Template 'linux-server' specified in host definition could not be not found (config file '/usr/local/nagios/etc/conf.d/domates.karel.com.tr.cfg', starting on line 1)
You will have to sort that error out before you can continue. What has changed that the linux-server template was taken away?

Try adding -n to check_nrpe on the server side. There is no use in running check_nrpe from the machine to be monitored, the purpose of NRPE is to monitor a remote system from the server:

Code: Select all

/usr/lib/nagios/plugins -H 192.168.169.71 -n
Locked