Adding hosts


#1

Hello… I am having a problem adding hosts to nagios…

I am using nagwin (a windows based version of nagios)

I have installed nagios successfully and can access it via a web browser
I have installed winrpe on the server I want to monitor
I then create a cfg file (cjsrundb02.cfg) in programfiles\icw\etc\nagios\nagwin where all the other .cfg files are located
(i actually just copied the localhost.cfg file to get me started)

heres whats in the file…

**# Define a host for the local machine

define host{
use windows-server,host-pnp ; 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 cjsrundb02
alias cjsrundb02
address 192.168.6.10
}

Define local commands

‘check_local_disk’ command definition

define command{
command_name check_local_disk
command_line $USER1$/check_pdm --disk --drive $ARG1$ --warning $ARG2$ --critical $ARG3$
}

‘check_local_procs’ command definition

define command{
command_name check_local_procs
command_line $USER1$/check_winprocess --warning $ARG1$ --critical $ARG2$
}

‘check_local_load’ command definition

define command{
command_name check_local_load
command_line $USER1$/check_pdm --processor --warning $ARG1$ --critical $ARG2$ --psamples $ARG3$ --pinterval $ARG4$
}

‘check_local_pyhsical_mem’ command definition

define command{
command_name check_local_physical_mem
command_line $USER1$/check_pdm --memory physical --warning $ARG1$ --critical $ARG2$
}

‘check_local_virtual_mem’ command definition

define command{
command_name check_local_virtual_mem
command_line $USER1$/check_pdm --memory virtual --warning $ARG1$ --critical $ARG2$
}

‘check_local_virtual_mem’ command definition

define command{
command_name check_local_pagefile_mem
command_line $USER1$/check_pdm --memory pagefile --warning $ARG1$ --critical $ARG2$
}

Non-responding processes

define command {
command_name process_no_response
command_line $USER1$/check_winprocess --filter “status eq NOT RESPONDING” --critical 1
}

Non-running automatic services

define command {
command_name service_auto_running
command_line $USER1$/check_winservice --startmode auto --state !running --critical 0
}

Total number of services

define command {
command_name service_all
command_line $USER1$/check_winservice --warning 150 --critical 300
}

Error events in all event logs

define command {
command_name event_all_errors
command_line $USER1$/check_winevent --type error --window “5 minutes” --critical 0
}

Audit failures

define command {
command_name event_audit_failures
command_line $USER1$/check_winevent --log security --type “audit failure” --critical 0
}

Application errors in application log

define command {
command_name event_application_errors
command_line $USER1$/check_winevent --log application --source “Application Error” --warning 2 --critical 5
}

Define a service to check the disk space of system disk C on the local machine.

Warning if < 20% free, critical if < 10% free space.

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description System disk
check_command check_local_disk!C:!95!99
}

Define a service to check the number of currently running procs on the local machine.

Warning if > 250 processes, critical if > 400 users.

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Total Processes
check_command check_local_procs!250!400
}

Define a service to check the load on the local machine. 5 samples with 5 secs intervals.

Warning at 80%, Critical at 95%

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Current Load
check_command check_local_load!85!95!5!5
}

Define a service to check the physical memory usage the local machine.

Critical if less than 90% of swap is in use, warning if 80% is in use

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Physical memory
check_command check_local_physical_mem!80!90
}

Define a service to check the virtual memory usage the local machine.

Critical if less than 90% of swap is in use, warning if 80% is in use

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Virtual memory
check_command check_local_virtual_mem!80!90
}

Define a service to check the page file usage the local machine.

Critical if less than 90% of swap is in use, warning if 80% is in use

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Page file
check_command check_local_pagefile_mem!80!90
}

Service: Non-responding processes

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Non-responding processes
check_command process_no_response
}

Service: Non-running automatic services

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Non-running automatic services
check_command service_auto_running
}

Service: All services

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description All services
check_command service_all
}

Service: Error events in all event logs

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Error events
check_command event_all_errors
}

Service: Audit failures

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Audit failures
check_command event_audit_failures
}

Service: Application errors

define service{
use local-service,srv-pnp ; Name of service template to use
host_name cjsrundb02
service_description Application errors
check_command event_application_errors
}
**

I then restart nagios services… and when I try to monitor the service via the browser… I recieve this error…

**Whoops!

Error: Could not read host and service status information!

The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you’ve just installed things, make sure you read the documentation on starting Nagios.

Some other things you should check in order to resolve this error include:

Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios! 

Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at nagios.org. **


#2

so?
did you check if nagios IS in fact running? did you check the config files with the -v option?
usually /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg