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
Noob user with a question
Re: Noob user with a question
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.
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.
Nagios Jedi in training.
Re: Noob user with a question
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
Re: Noob user with a question
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
Thanks,
Sean
Re: Noob user with a question
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:
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:
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.
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
}
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
}
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!