Noob user with a question

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
jackryan
Posts: 3
Joined: Thu Jul 10, 2014 2:56 pm

Noob user with a question

Post by jackryan »

Hi All,

I have a nagios install for monitoring several hundred servers that I am trying to organize. My problem is that all the servers get X Y Z service checks done on a 24X7 basis. Group A (production) should send out notifications when anything goes wrong (24X7 notification) Group B (non prod) has the same checks done but we only want notification of issues during business hours (8AM to 6PM M-F) and Im not sure how to do this. Any tutorial or How to would be most helpful.

Thanks,
Sean
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Re: Noob user with a question

Post by technick »

The magic that will solve your problems are called templates.

Create a service template for group A to use with 24x7 notifications and a separate template for group B to use with business hour notifications only.
----------------------
Nagios Jedi in training.
jackryan
Posts: 3
Joined: Thu Jul 10, 2014 2:56 pm

Re: Noob user with a question

Post by jackryan »

technick wrote:The magic that will solve your problems are called templates.

Create a service template for group A to use with 24x7 notifications and a separate template for group B to use with business hour notifications only.

They both can be attached to the same service checks?

Sean
jackryan
Posts: 3
Joined: Thu Jul 10, 2014 2:56 pm

Re: Noob user with a question

Post by jackryan »

I have been reading up on the service templates, Im still not sure how one group of servers uses one service template and another group of servers uses another service templete. If anybody can point me to some documentation that would be most helpful.

Thanks,
Sean
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Noob user with a question

Post by eloyd »

The documentation you want is http://nagios.sourceforge.net/docs/3_0/ ... tance.html to learn about object inheritance.

A snippet of our SmartVox hosted VoIP services templates:

Code: Select all

define service{
        name                    smartvox-service
        use                     generic-service
        contact_groups          voip-support
        notification_period     24x7
        register                0
}
define service{
        name                    voip-service
        use                     smartvox-service
        register                0
}
define service{
        name                    voip-service-workhours
        use                     smartvox-service
        notification_period     workhours
        register                0
}
Notice the change in notification_period between the template called smartvox-service and the one called voip-service-workhours? You could just as easily change the contacts or contact_groups. The "register 0" is what makes them "templates." Then you assign your services to the different templates:

Code: Select all

define service{
        use                     smartvox-service
        service_description     PING
        hostgroups              public,private
        servicegroups           System
        check_command           check_ping!100.0,20%!500.0,60%
}

define service{
        use                     voip-service-workhours
        service_description     SSH:port
        hostgroups              public,minimal
        servicegroups           Ports
        check_command           check_ssh!-p $_HOSTSSH_PORT
}
See how the first service uses the first template but the second one uses the other template? That's how you can use templates to specify massively complex things using templates that inherit values from templates from templates.... but still make the final service definition VERY simple.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked