HWg-SMS-GW3 manual
HW group
www.HW-group.com
18
3.2)
Define contacts and contact groups for SMS messaging in a file
/etc/nagios3/conf.d/contacts_nagios.cfg
.
Note: In case you want to send notifications to multiple phone numbers, create a contact for every
phone number and enter each contact into a memebers parameters in a contactgroup (divided with ,
).
In case you are using a standard Nagios configuration and want to add SMS sending for all devices
and services, do not create a contactgroup and add only
peter-gsm
to the
admins
group. The setup is
then complete and the notifications will be sent also via SMS after restarting the Nagios service
(points 3 and 4).
3.3)
Adding SMS notification options to selected sevices and services can be done in their definition,
by adding a contact_groups parameter, for example:
Note: Contacts are usually defined in the device's or service's templates, adding contact_groups
parameters will rewrite the pre-set template. This example is based in a standard settings of an
admins contact group, which uses e-mails for sending notifications. Only SMS messages will be sent
after adding "contact_groups sms" parameter.
3.4)
A restart of Nagios needed to activate the changes.
define contact {
contact_name
peter-gsm
alias Peters GSM phone
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-sms
host_notification_commands notify-host-by-sms
pager
+420777888999
}
define contactgroup {
contactgroup_name
sms
alias Notifications via SMS
members
peter-gsm
}
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members root,
peter-gsm
}
define host {
use generic-host
host_name localhost
alias localhost
address 127.0.0.1
contact_groups admins,sms
}
define service {
use generic-service
host_name localhost
service_description Disk Space
check_command check_all_disks!20%!10%
contact_groups admins,sms
}