Create Service Groups in Nagios

Create Service Groups in Nagios

Creating service groups in Nagios Core is a pretty easy task. Service Groups allows you to see the status of like services for multiple hosts. If you have numerous hosts or network devices reporting in to Nagios, this is a fantastic feature.

There are a couple of ways to create Service Groups. I find the easiest way is to use WinSCP and Notepad++

The WinSCP and Notepad++ Method

Launch WinSCP and connect to your Nagios machine.

WinSCP will present to you two sides. The Nagios side on the right, and your Windows side on the left. On the left hand side, create a folder called “Nagios_Backup” – You can call this folder whatever you wish. It is purely copying files from Nagios and editing them with Notepad++

Copy the “servicegroup.cfg” from the right hand Nagios folder, to the left hand Windows folder you just created.

On your Windows computer, open up file explorer and navigate to the folder you copied “servicegroup.cfg” to and right click it. Select “Open with Notepad++”

In here you can define your Service Groups. This is a sample config I threw together. You can see any service that you have in Nagios. For me, General_Ping is for miscellaneous devices that I want to see the status of the ping request in Nagios. Network_Ping is where I group all my network devices. CPU_Load shows the CPU Load of various hosts and workstations.

Upon completing your servicegroup.cfg file, you can copy it back to your Nagios server with WinSCP. You will be copying from the left hand side to the right hand side.

Launch Putty and connect to your Nagios server. Issue the command “systemctl restart nagios” and hit enter.

Login to your Nagios web GUI. On the left hand side you will see a list of links. Find the link that says “Service Groups” and click on it.

The link will take you to the Service Groups page within Nagios. You can now see all of your hosts grouped together by service. The screenshot below is of a running Nagios box I have in service.

Permanent link to this article:

Leave a Reply