Missing windows.cfg file nagios-2.9_1 on Free BSD


#1

Hi,

I recently set up nagios and have it configured to monitor the localhost. Wanted to monitor some windows servers and installed the nsclient++ on the windows server. Followed the guide nagios.sourceforge.net/docs/3_0/ … ndows.html
but could not find any windows.cfg file that has the template for the windows-server. I created my own file called winhosts.cfg, but something is wrong wih the configuraion and nagios says:

Reading configuration data…

Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service ‘C:\ Drive Space’ on host 'pine’
Error: Could not register service (config file ‘/usr/local/etc/nagios/winhosts.cfg’, starting on line 49)

Could somebody point me to the missing windows.cfg file or send me the template that I need to use???, or possibly shed some light why the error is happening? I have been scratching my head 2 days on that. Thanks in advance!!!

Here is my actual winhosts.cfg file:

Generic host definition template

define host{
name windows-server ; The name of this host template - referenced in other host definitions, used for template recursion/resolution
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
max_check_attempts 1
check_period 24x7
contact_groups admins
notification_interval 0
notification_period 24x7
notification_options d,u,r
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

define host{
use windows-server ; Inherit default values from a Windows server template (make sure you keep this line!)
host_name pine
alias My Windows Server
address 192.168.2.205
#check_command check-host-alive
}

define service{
use generic-service
host_name pine
service_description Uptime
check_command check_nt!UPTIME
}

define service{
use generic-service
host_name pine
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}

define service{
use generic-service
host_name pine
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

define service{
use generic-service
host_name pine
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
max_check_attempts 1
}

define service{
use generic-service
host_name pine
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

define service{
use generic-service
host_name pine
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}


#2

Sorry, I figured out what’s wrong, I should have inherited from local-service, not generic-service, the host configuration is fine :slight_smile: