tgriep wrote:For passive monitoring to function, you have to create the service checks in Nagios before sending the checks from the Windows Host to the Core server.
The unable to find service messages in the log file shows that they need to be created.
Here are some examples you can use for the service checks.Also, an example of the Passive Service templateCode: Select all
define service { host_name SectTest service_description cpu usage use passive_service max_check_attempts 1 check_interval 1 retry_interval 1 check_period xi_timeperiod_24x7 notification_interval 60 notification_period xi_timeperiod_24x7 contacts nagiosadmin stalking_options n _xiwizard passiveobject register 1 } define service { host_name SectTest service_description memory usage use passive_service max_check_attempts 1 check_interval 1 retry_interval 1 check_period xi_timeperiod_24x7 notification_interval 60 notification_period xi_timeperiod_24x7 contacts nagiosadmin stalking_options n _xiwizard passiveobject register 1 } define service { host_name SectTest service_description swap usage use passive_service max_check_attempts 1 check_interval 1 retry_interval 1 check_period xi_timeperiod_24x7 notification_interval 60 notification_period xi_timeperiod_24x7 contacts nagiosadmin stalking_options n _xiwizard passiveobject register 1 }Setup those services and enable freshness checking to the template and is should start to function like you want.Code: Select all
define service { name passive_service service_description Passive Service use generic_service check_command check_dummy!0!"No data received yet." is_volatile 0 initial_state o max_check_attempts 1 active_checks_enabled 0 passive_checks_enabled 1 flap_detection_enabled 0 stalking_options o,w,u,c register 0 }
Windows hosts passive checks with Nagios NRDP
Re: Windows hosts passive checks with Nagios NRDP
Well, where I put these codes? I must to create another file? I think that I must to put cpu/memory/swap usage in windows.cfg, right? If yes, and the rest of the code ?
Re: Windows hosts passive checks with Nagios NRDP
It is hard to answer that question as we don't know how your server is setup but you could add it to your windows config file and see if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Windows hosts passive checks with Nagios NRDP
I'm using the compiled version of Nagios Core (4.x.x), I mean, I installed it compiling it myself, so I am using the default scripts - it's working fine to me. I'd put the script above in the windows.cfg file:
I restarted the Nagios and the service is working fine (the Nagios service in the server); I changed the "use generic_service" to "use generic-service" because if I use "generic_service" an error occours:define service {
name passive_service
service_description Passive Service
use generic-service
check_command check_dummy!0!"No data received yet."
is_volatile 0
initial_state o
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
stalking_options o,w,u,c
register 0
}
But when I put all scripts:Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
a same error occours:define service {
host_name SectTest
service_description cpu usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
define service {
host_name SectTest
service_description memory usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
define service {
host_name SectTest
service_description swap usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
tgriep wrote:It is hard to answer that question as we don't know how your server is setup but you could add it to your windows config file and see if that works for you.
Re: Windows hosts passive checks with Nagios NRDP
Your definition indicates that the template is called passive_service, and the error indicates that you are specifying 'passive-service'. Nagios will not start with any errors, which is why you need to fix it before you can proceed. Any other changes will still be stuck until the current error is fixed.sidserra wrote:I'm using the compiled version of Nagios Core (4.x.x), I mean, I installed it compiling it myself, so I am using the default scripts - it's working fine to me. I'd put the script above in the windows.cfg file:
I restarted the Nagios and the service is working fine (the Nagios service in the server); I changed the "use generic_service" to "use generic-service" because if I use "generic_service" an error occours:define service {
name passive_service
service_description Passive Service
use generic-service
check_command check_dummy!0!"No data received yet."
is_volatile 0
initial_state o
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
stalking_options o,w,u,c
register 0
}
But when I put all scripts:Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
a same error occours:define service {
host_name SectTest
service_description cpu usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
define service {
host_name SectTest
service_description memory usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
define service {
host_name SectTest
service_description swap usage
use passive-service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard passiveobject
register 1
}
Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
tgriep wrote:It is hard to answer that question as we don't know how your server is setup but you could add it to your windows config file and see if that works for you.
Code: Select all
Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 1
Former Nagios Employee
Re: Windows hosts passive checks with Nagios NRDP
So, even if I put the original script (or templates) that you posted the error persists:

Oh, God...Error: Template 'passive_service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
Re: Windows hosts passive checks with Nagios NRDP
Please post your windows.cfg for us to look at.
Former Nagios Employee
Re: Windows hosts passive checks with Nagios NRDP
That's my windows.cfg in Nagios server:
The remaining code in this file I disabled (I'm using "#" at the beginning of each line); when I put the code posted here appears:
###############################################################################
# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
#
#
# NOTES: This config file assumes that you are using the sample configuration
# files that get installed with the Nagios quickstart guide.
#
###############################################################################
###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################
# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation
define host{
use windows-server ; Inherit default values from a template
host_name SectTest ; The name we're giving to this host
alias SectTest ; A longer name associated with the host
address 169.254.16.250 ; IP address of the host - this ip is not a valid one, it is an apipa address, don't worry about it
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
#
###############################################################################
###############################################################################
# Define a hostgroup for Windows machines
# All hosts that use the windows-server template will automatically be a member of this group
define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers
members SectTest
}
The remaining code in this file I disabled (I'm using "#" at the beginning of each line); when I put the code posted here appears:
The Nrdp is installed and working fine following the instalation steps in the nrdp help file (I'm using the send_nrdp script in linux hosts to send passive checks to Nrdp server and all hosts are listed as alive (up).Error: Template 'passive_service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 161)
Error processing object config files!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Windows hosts passive checks with Nagios NRDP
It would help if you uploaded windows.cfg as a file instead of pasting it, it will make it easier to troubleshoot.
Right now it's failing to start because it can't find the template.
Right now it's failing to start because it can't find the template.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Windows hosts passive checks with Nagios NRDP
That's my windows.cfg in use in my Nagios:
So, using this file, the Windows host "SectTest" appears in Nagios hosts list, but "Down":
Now, the windows.cfg with template codes:
The error occours:
I am not using Nagios XI, my Nagios server is compiled with default plugins (nagios-plugins) compiled too. The hosts picture that I posted here shows some Linux hosts sending passive checks with the send_nrdp script (the Nagios server isn't able to reach the hosts but the hosts are able to reach the Nagios server).Reading configuration data...
Read main config file okay...
Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 177)
Error processing object config files!
Re: Windows hosts passive checks with Nagios NRDP
sidserra wrote:That's my windows.cfg in use in my Nagios:
I am not using Nagios XI, my Nagios server is compiled with default plugins (nagios-plugins) compiled too. The hosts picture that I posted here shows some Linux hosts sending passive checks with the send_nrdp script (the Nagios server isn't able to reach the hosts but the hosts are able to reach the Nagios server).Reading configuration data...
Read main config file okay...
Error: Template 'passive-service' specified in service definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 177)
Error processing object config files!
this is because you are referring to a template which is called passive-service but its not defined anywhere
if you check the linux services which accept the passive services they should have a template associated with them which you could potentially re-use here instead of this one
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis