Custom template monitoring

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
titanexlol
Posts: 1
Joined: Tue Aug 27, 2019 5:13 am

Custom template monitoring

Post by titanexlol »

Hello,

Im new to monitoring with nagios , so far i was able to install and monitor the host of the nagios , another server and a windows server with nrpe.

Problem is , the method i know is to create a custom cfg for each server , is it possible to have 1 cfg file to custom monitor all the servers?

I do not mean host group or service group , i what i mean is for example - servers.cfg

which will contain

define host{
host_name test-server
alias test-server
display_name test-server
address 10.0.0.1
check_commands check_ping,check_mem,check_load,check_ssh,check_disk,check_http
contacts [email protected]
contact_groups [email protected]
notification_interval 4
}

is this configuration possible? could you provide me with a method on how to make monitoring with nagios easier?

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Custom template monitoring

Post by scottwilkerson »

This is not possible.

But once you define your hosts you can add multiple hosts to service definitions (either via hostgroups you comma separated in the host_name directive) and place them all in a single file

such as

Code: Select all

define service {
    host_name                test-server1,test-server2,test-server3
    service_description      Ping
    use                      generic-service
    check_command            check_ping
    register                 1
}

define service {
    host_name                test-server1,test-server2,test-server3
    service_description      Memory
    use                      generic-service
    check_command            check_mem
    register                 1
}

define service {
    host_name                test-server1,test-server2,test-server3
    service_description      Load
    use                      generic-service
    check_command            check_load
    register                 1
}

define service {
    host_name                test-server1,test-server2,test-server3
    service_description      DISK
    use                      generic-service
    check_command            check_disk
    register                 1
}

Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked