Add another host windows server

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Add another host windows server

Postby sophisticated » Thu Nov 21, 2019 2:48 am

Hi! Im a new at Nagios, yesterday I installed Nagios and i add my first host:

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,host-pnp          ; Inherit default values from a template
    host_name               ad01          ; The name we're giving to this host
    alias                   My Windows Server       ; A longer name associated with the host
    address                 192.168.3.7             ; 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,srv-pnp
    host_name               ad01
    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               ad01
    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,srv-pnp
    host_name               ad01
    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               ad01
    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,srv-pnp
    host_name               ad01
    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,srv-pnp
    host_name               ad01
    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,srv-pnp
    host_name               ad01
    service_description     Explorer
    check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe


But how can I add another host? In this same file?

I tried add anonther one host using commas. Just like:

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,host-pnp          ; Inherit default values from a template
    host_name               ad01,ad02          ; The name we're giving to this host
    alias                   My Windows Server       ; A longer name associated with the host
    address                 192.168.3.7, 192.168.3.8             ; 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,srv-pnp
    host_name               ad01,ad02
    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               ad01,ad02
    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,srv-pnp
    host_name               ad01,ad02
    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               ad01,ad02
    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,srv-pnp
    host_name               ad01,ad02
    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,srv-pnp
    host_name               ad01,ad02
    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,srv-pnp
    host_name               ad01,ad02
    service_description     Explorer
    check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe


but i think it's not correct.

My 2 question:

How can I add windows PC hosts?

Thanks!
sophisticated
 
Posts: 12
Joined: Wed Nov 20, 2019 3:03 pm

Re: Add another host windows server

Postby scottwilkerson » Thu Nov 21, 2019 8:23 am

Welcome to the nagios forum!

You were pretty close, each host needs it's own definition

Change this
Code: Select all
define host {

    use                     windows-server,host-pnp          ; Inherit default values from a template
    host_name               ad01,ad02          ; The name we're giving to this host
    alias                   My Windows Server       ; A longer name associated with the host
    address                 192.168.3.7, 192.168.3.8             ; IP address of the host
}

to this
Code: Select all
define host {

    use                     windows-server,host-pnp          ; Inherit default values from a template
    host_name               ad01          ; The name we're giving to this host
    alias                   My Windows Server       ; A longer name associated with the host
    address                 192.168.3.7            ; IP address of the host
}

define host {

    use                     windows-server,host-pnp          ; Inherit default values from a template
    host_name               ad02          ; The name we're giving to this host
    alias                   My Other Windows Server       ; A longer name associated with the host
    address                 192.168.3.8             ; IP address of the host
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17024
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Add another host windows server

Postby sophisticated » Thu Nov 21, 2019 8:45 am

Yeah! While waiting for the acceptance of the topic, I managed to come up with this idea! :D but.. I have so many hosts..

I find something like this: https://mona.deltics.info/auto-discover-for-mona-3-0/ and really dont know how to use this. What i need to install? How to do it step by step?
sophisticated
 
Posts: 12
Joined: Wed Nov 20, 2019 3:03 pm

Re: Add another host windows server

Postby scottwilkerson » Thu Nov 21, 2019 8:58 am

sophisticated wrote:Yeah! While waiting for the acceptance of the topic, I managed to come up with this idea! :D but.. I have so many hosts..

I find something like this: https://mona.deltics.info/auto-discover-for-mona-3-0/ and really dont know how to use this. What i need to install? How to do it step by step?

Sorry I'm not familiar with that package

We do also have a commercial solution called Nagios XI that makes configuration a breeze with an easy to use interface that allow you to clone many hosts in a few clicks. It has a 60 day free trial if you want to check it out
https://www.nagios.com/products/nagios-xi/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17024
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Add another host windows server

Postby sophisticated » Fri Nov 22, 2019 3:35 am

Unfortunately, our company cannot afford such solutions .. We have to use free solutions. It is a state-owned company. You can close

Thanks! :D
sophisticated
 
Posts: 12
Joined: Wed Nov 20, 2019 3:03 pm

Re: Add another host windows server

Postby scottwilkerson » Fri Nov 22, 2019 7:34 am

sophisticated wrote:Unfortunately, our company cannot afford such solutions .. We have to use free solutions. It is a state-owned company. You can close

Thanks! :D

Great!

Locking thread
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17024
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 15 guests