Configuring servicegroup


Ok this is a real n00b questions that has been killing me for the last few weeks.

Im trying to setup the script. I have a 2950 that I am trying to monitor but when I run the /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg I get "ERROR: Could not find any servicegroup matching ‘snmp’ (config file ‘/usr/local.nagios/etc/objects/switch.cfg’ starting line 123)

I pretty sure tha the problem is with the servicegroup but dont understand how to make it work.

This is line 123

define service{
use generic-service ; inherit values from a temple
servicegroup snmp,netstatistics
host_name Test_2950
#hostgroup_name switches
service_description GI0/1
check_command check_snmp_network_initerface_cisco2950!“GigabitEthernet0/1$”!0,0,0,0,0,0,!0,0,0,0,0,0

The goal is to monitor all the switches in my network using this setup to monitor if an interface dies and the backup port kicks in.and to monitor bandwidth of the ports.

I understand that servicegroup is to be setup like
servicegroup host1 snmp host1 netstatatistics

Is there abetter way to do this?



this Failure means, you have no defined Service Group, named SNMP… You want to add this Service to two Groups:

1.) snmp
2.) netstatistics

But the Group snmp doesn’t exist.
To resolve this, you must define a Service Group, named snmp…

Example Definition:

define servicegroup {
servicegroup_name dbservices
alias Database Services
members ms1,SQL Server,ms1,SQL Server Agent,ms1,SQL DTC



can you give me an example of how I would do that?


Good Morning,

have you read the Manuals and the How-To’s for configuring Nagios?

A service group definition is used to group one or more services together for display.
You can define this in any .cfg File…

define servicegroup{
servicegroup_name dbservices
alias Database Services
members ms1,SQL Server,ms1,SQL Server Agent,ms1,SQL DTC

Directive Descriptions:

servicegroup_name: This directive is used to define a short name used to identify the service group.

**alias: **This directive is used to define is a longer name or description used to identify the service group. It is provided in order to allow you to more easily identify a particular service group.

members: This is a list of the descriptions of services (and the names of their corresponding hosts) that should be included in this group. Host and service names should be separated by commas. This directive may be used as an alternative to the servicegroups directive in service definitions. The format of the member directive is as follows (note that a host name must precede a service name/description):


Another Way is, you delete the SNMP Group from your directive…

Try this…
Good luck.



So then snmp and netstatistics are just names for the group? They dont have to be linked to another file or anyrhing?

I could just call them action1 & action2 and it would not make a difference?

With the ( member , ) where is the service coming from?

Sorry if I’m being a pain, I’m just trying to understand what is happening with everything so that I can add more scripts.
A live example helps best.



define host{
use generic-switch ; Inherit default values from a template
host_name 2950 ; The name we’re giving to this switch
alias Cisco 2950 ; A longer name associated with the switch
address ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with

define hostgroup{
hostgroup_name switches ; The name of the hostgroup
alias Network Switches ; Long name of the group

define servicegroup{
servicegroup_name snmp
alias snmp for
member 2950,snmp

define servicegroup{
servicegroup_name netstatistics
alias netstatistics for
member 2950,netstatistics

define service{
use generic-service ; Inherit values from a template
servicegroups snmp,netstatistics
hostgroup_name switches
service_description GigabitEthernet0/1
check_command check_snmp_network_interface_cisco2950!“GigabitEthernet0/1$”!0,0,0,0,0,0!0,0,0,0,0,0


check_snmp_netint using snmpv1:

define command{
command_name check_snmp_int_v1
command_line $USER1$/ -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$

#Cisco 2950 (IOS) switch
define command {
command_name check_snmp_network_interface_cisco2950
command_line $USER1$/ -2 -f -C $USER5$ -H $HOSTADDRESS$ --cisco=oper,show_portnames --stp -n $ARG1$ -w $ARG2$ -c $ARG3$ -d $USER8$ -e -q -k -y -M -B -mm -P “$SERVICEPERFDATA$” -T “$LASTSERVICECHECK$” --label

Will this work? I there something that I am missing?