Remove Windows Host

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.
Locked
User avatar
costanza2k1
Posts: 197
Joined: Fri Aug 09, 2013 12:19 pm

Remove Windows Host

Post by costanza2k1 »

Ok, I'm pretty sure this has a simple answer to it. Last week I was able to finally add a windows server to Nagios Core for monitoring. I'd like to be able to remove that server now and add another one. It should be as simple as removing the old server from the windows.cfg file and adding the new one correct? I did that, verified the config and restarted nagios and the old host still shows up with no sign of the new one...help please
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Remove Windows Host

Post by tmcdonald »

Did you use the same name as the old one? It could be that the info actually updated but just looks to be the same.

Go ahead and post/PM the definitions for both the old and the new hosts, making sure to remove any sensitive information first.
Former Nagios employee
User avatar
costanza2k1
Posts: 197
Joined: Fri Aug 09, 2013 12:19 pm

Re: Remove Windows Host

Post by costanza2k1 »

I edited the windows.cfg (/usr/local/nagios/etc/objects/windows.cfg) file and replaced the hostname with the new hostname and changed the IP all the way down for each specific service. Was that the wrong way to change the host?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Remove Windows Host

Post by lmiltchev »

This should've worked... Can you show us what do you see in the web interface, and what do you have in the "/usr/local/nagios/etc/objects/windows.cfg"?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
costanza2k1
Posts: 197
Joined: Fri Aug 09, 2013 12:19 pm

Re: Remove Windows Host

Post by costanza2k1 »

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       schqvprodxxx   ; The name we're giving to this host
        alias           schqvcprodxxx.xxx.com  ; A longer name associated with the host
        address         10.xx.xxx.xxx   ; 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               schqvprodxxx
        service_description     NSClient++ Version
        check_command           check_nt!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               schqvprodxxx
        service_description     Uptime
        check_command           check_nt!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               schqvprodxxx
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }
# 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               schqvprodxxx
        service_description     CPU Load
        check_command           check_nt!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               schqvprodxxx
        service_description     Memory Usage
        check_command           check_nt!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               schqvprodxxx
        service_description     C:\ Drive Space
        check_command           check_nt!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               schqvprodxxx
        service_description     W3SVC
        check_command           check_nt!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               schqvprodxxx
        service_description     Explorer
        check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
        }

tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Remove Windows Host

Post by tmcdonald »

Can you post a web interface screenshot please?
Former Nagios employee
User avatar
costanza2k1
Posts: 197
Joined: Fri Aug 09, 2013 12:19 pm

Re: Remove Windows Host

Post by costanza2k1 »

Web shows old server still...
Attachments
nagios host files.PNG
User avatar
costanza2k1
Posts: 197
Joined: Fri Aug 09, 2013 12:19 pm

Re: Remove Windows Host

Post by costanza2k1 »

I got it to work...did a complete shut down on nagios instead of a reload and it came up...this can be closed. appreciate your patience with me.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Remove Windows Host

Post by tmcdonald »

Ahh yes, reload and restart are somewhat different. Restart is what you want in this case. Gonna lock this up, glad you figured it out.
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Remove Windows Host

Post by lmiltchev »

I'm glad this issue has been resolved! Instead of "reload" you can use "stop/start" or "restart". I am locking this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked