Nagios And Asterisk

From Olden Timey Wiki

Configuring the Nagios Monitoring System to send TTS voice alerts via an Asterisk MeetMe conference (or any channel for that matter).


Requirements

mkqcall.pl


Installation

...


Nagios Configs

contacts.cfg

define contact{
       contact_name                    conference
       alias                           AsteriskMeetMeConference
       host_notification_period        24x7
       service_notification_period     24x7
       service_notification_options    c,r
       host_notification_options       d,r
       service_notification_commands   notify-by-phone
       host_notification_commands      notify-by-phone
       email                           pbx@yourdomain.com
       }

contactgroups.cfg

define contactgroup {
       contactgroup_name       listeners
       alias voicealert
       members                 conference
}

misccommands.cfg

define command {
       command_name    notify-by-phone
       command_line    /usr/bin/printf "%b" "Service $SERVICEDESC$ on Host $HOSTNAME$ state changed to $HOSTSTATE$" | /etc/asterisk/mkqcall.pl
       }

services.cfg

define service{
use                             generic-service
host_name                       mail1,mail2
service_description             SMTP
is_volatile                     0
check_period                    24x7
contact_groups                  listeners
max_check_attempts              10
normal_check_interval           10
retry_check_interval            15
notification_interval           30
notification_period             24x7
notification_options            w,u,c,r
check_command                   check_smtp
}

..

Asterisk Configs

extensions.conf

[conf]
exten => s,1,MeetmeCount(5150)
exten => s,2,Meetme(5150|psN) 


iax.conf

[qcall]
type=friend
context=conf
auth=md5,plaintext
secret=<IAX_PW>
host=dynamic
allow=gsm
accountcode=qcall