LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-02-2016, 03:31 AM   #1
WinfriedSeeger
LQ Newbie
 
Registered: Jun 2016
Location: Germany
Posts: 1

Rep: Reputation: Disabled
Nagios and Braintower SMS Gateway


Can I connect my Braintower SMS Gateway to Nagios?

Of course you can use your Braintower SMS Gateway to send alarms from Nagios via SMS.

You will need first the script sendsms. Download the file and place it on your Nagios server in the folder /usr/local/bin/off.

The script needs the following Perl modules to work:

LWP::UserAgent
URI::Escape
Text::Icon

In the next step, the commands for SMS alerts in configuring Nagios need to be defined. In addition, the defined contacts must be provided with the following commands.

Examples: Definition of SMS alerts in/etc/nagios3/commands.cfg

----------------------------------------------------------------------------------------------

define command

{

command_name notify-host-by-sms

command_line /usr/local/bin/sendsms.pl $CONTACTPAGER$ "$NOTIFICATIONTYPE$ - Host $HOSTALIAS$ is $HOSTSTATE$ since $SHORTDATETIME$ info: $HOSTOUTPUT$"

}

----------------------------------------------------------------------------------------------

define command

{

command_name notify-service-by-sms

command_line /usr/local/bin/sendsms.pl $CONTACTPAGER$ "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ state: $SERVICESTATE$ since $SHORTDATETIME$ info: $SERVICEOUTPUT$"

}

----------------------------------------------------------------------------------------------
Example: Definition of a contact in /etc/nagios3/contacts.cfg



define contact
{

contact_name Max_Sample

alias Max Sample

host_notification_period 24x7

service_notification_period 24x7

host_notification_options d,u,r

service_notification_options u,c,r

pager 00491701234567

host_notification_commands notify-host-by-sms

service_notification_commands notify-service-by-sms
}

HTTPS

The script sendsms transmits the Nagios alarm to the SMS gateway. By default, this communication is not encrypted.
In line 43, you can change this behavior by switching the request to HTTPS:

my $response = $lwp->get('https://'.$smsgw_host.':'.$smsgw_sendsms_port.$smsgw_sendsms_path.'?username='.$smsgw_username.'&password='. $smsgw_password.'&to='.$recipient.'&text='.$message);

-----------------------------------------------------------

Provided the SSL certificate used in the Braintower SMS Gateway is a self-signed certificate, there could be a error message in nagios.log. Can't connect to ... (certificate verify failed). In this case, insert the following code at line 35:

$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;

-----------------------------------------------------------
 
Old 06-08-2016, 12:37 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Post no bills
 
  


Reply

Tags
alarm, monitoring, nagios, sms



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios SMS Configuration nishith Linux - Server 3 10-19-2012 12:58 AM
nagios 3.40 sms alerts kamran.ayub Linux - Server 1 07-31-2012 10:29 AM
Nagios Notification by SMS sysmanz Linux - Server 6 08-08-2011 07:03 AM
Nagios Alerts via SMS PankajRasuni Linux - Server 3 03-31-2011 01:51 AM
Nagios SMS gateway sci3ntist Linux - Server 3 09-27-2009 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration