13.12. Using Servicegroups to Group Related Services
Problem
Some of your servers are running multiple services, and on the Nagios web interface, you want to see related services grouped together (e.g., SSH, FTP, HTTP, and anything you have running on multiple servers).
Solution
Create servicegroups. You can group together any host or service
combinations you like. This example shows an SSH servicegroup:
# ssh servicegroup
define servicegroup{
servicegroup_name ssh
alias all ssh servers
members uberpc,SSH,stinkpad,SSH
}The members must already have service definitions in services.cfg. You may group together any combination of host/service pairs.
When you're finished, run the syntax-checker, and restart Nagios:
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# /etc/init.d/nagios restartThen, click on the various "Servicegroup" links on the Nagios web interface to see them.
Discussion
The services don't have to all be the same; you can group any services you want. The members definitions are case-sensitive, so make sure they match their host and service definitions.
See Also
"Template-Based Object Configuration" (http://localhost/nagios/docs/xodtemplate.html) in your local Nagios documentation
Nagios.org: http://www.nagios.org/
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access