Re: Nagios Stops Running When Enabling Monitoring for Window
Posted: Mon Sep 18, 2017 11:05 pm
I went into "vi /etc/nagios/objects/windows.cfg" and changed from "check_nt" to "NCPA". I then went to"/etc/nagios/nagios.cfg" and removed comment I did "systemctl restart nagios" and nagios fails! I put comment back and nagios starts working.
This is what I have inside of "/etc/nagios/objects/windows.cfg" file
Not understanding how to run "/etc/nagios/nagios -v /etc/nagios/nagios.cfg". If I go into "/etc/nagios/nagios.cfg" and type "/etc/nagios/nagios -v /etc/nagios/nagios.cfg"
I receive bash: /etc/nagios/nagios: No such file of directory. Or if I type "/etc/nagios/nagios.cfg -v" I receive bash: /etc/nagios/nagios.cfg: Permission denied.
Not sure if I'm running /etc/nagios/nagios -v /etc/nagios/nagios.cfg correctly. Any suggestions into what might be causing nagios not to monitor Windows machine?
Code: Select all
# Definitions for monitoring a Windows machine
cfg_file=/etc/nagios/objects/windows.cfg
This is what I have inside of "/etc/nagios/objects/windows.cfg" file
Code: Select all
###############################################################################
# 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 Winserver ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.x.x ; IP address of the host
}
###############################################################################
###############################################################################
#
# 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 ; Long name of the group
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description NSClient++ Version
check_command NCPA!CLIENTVERSION
}
# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description Uptime
check_command NCPA!UPTIME
}
# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description CPU Load
check_command NCPA!CPULOAD!-l 5,80,90
}
# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description Memory Usage
check_command NCPA!MEMUSE!-w 80 -c 90
}
# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description C:\ Drive Space
check_command NCPA!USEDDISKSPACE!-l c -w 80 -c 90
}
# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description W3SVC
check_command NCPA!SERVICESTATE!-d SHOWALL -l W3SVC
}
# Create a service for monitoring the Explorer.exe process
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description Explorer
check_command NCPA!PROCSTATE!-d SHOWALL -l Explorer.exe
}
I receive bash: /etc/nagios/nagios: No such file of directory. Or if I type "/etc/nagios/nagios.cfg -v" I receive bash: /etc/nagios/nagios.cfg: Permission denied.
Not sure if I'm running /etc/nagios/nagios -v /etc/nagios/nagios.cfg correctly. Any suggestions into what might be causing nagios not to monitor Windows machine?