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.
###############################################################################
# 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
}
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?
Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 25 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
I noticed there was no problems detected. So I checked NRPE connection, by entering this command
"/usr/lib64/nagios/plugins/check_nrpe -H MyServerIPAddress -c check_load" and received this message connection to address 192.168.x.x port 5666: Connection refused
connect to host 192.168.x.x port 5666: Connection refused
I then ran this command "firewall-cmd --zone=public --permanent --add-port=5666/tcp" and still nagios fails. Any suggestions to make this work?
NCPA doesn't use NRPE, so I think you are missing something. Also, I still haven't seen you define any commands. If you change the command line in the service that is just going to point to a different command. We need to see what the commands actually are. I think you'll find it helpful to take a look at https://assets.nagios.com/downloads/nag ... ml#command
Almost working!
My only issue now is from Nagios web browser, its not displaying "Status Information" Its able to display Host name, but not status information. It has error message (No output on stdout) stderr: exec vp(/usr/lib64/nagios/plugins/check_ncpa.py,...) failed errno is 2: No such file or directory
Here is the downloads page for the plugin, it gives it to you as a tar so keep that in mind when you download it onto Nagios Core and give it the correct permissions to run it. https://www.nagios.org/ncpa/#downloads
If you did download it, locate it by doing the command below. Then move it into your /usr/lib64/nagios/plugins
I downloaded check_ncpa.py. I extracted the file. Moved it to /usr/lib64/nagios/plugins. I then ran chmod +x /usr/lib64/nagios/plugins/check_ncpa.py.
I then ran "find / -name check_ncpa.py" and file is in its correct location.
I went to Nagios web browser to see Winserver status information and now I'm getting new error message,
it says "UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details."
I then ran ls -la /usr/lib64/nagios/plugins/ and my output is below.