Dear all,

I am trying to configure sms alerts in observium for this my institute has a sms gateway via which i can send messgaes to ant number the API is in this format "http://smsgateway.iitb.ac.in/smsapi/index.php?To=91********&Message=test2" . Now i want to post the notification to this API.

So i edited the file  /opt/observium/includes/defaults.inc.php as follows: 

$config['smsbox']['scheme']   = 'http';                 // URL scheme, http or https.
$config['smsbox']['host']     = 'smsgateway.iitb.ac.in';            // Name of host on which SMSBox is running.
$config['smsbox']['port']     = '80';                // Port number on which SMSBox host receives requests.
$config['smsbox']['user']     = '';               // SMSBox username.
$config['smsbox']['password'] = '';                     // SMSBox password.
$config['smsbox']['from']     = '';                     // Phone number of sender, usually overridden by SMSC.

Then i edited the file /opt/observium/includes/alerting/smsbox.inc.php as follows: 
<?php

// Kannel SMSBox documentation: http://kannel.org/download/1.5.0/userguide-1.5.0/userguide.html#AEN4623

$message = $message_tags['ALERT_STATE'] . " " . $message_tags['DEVICE_HOSTNAME'] .": " . $message_tags['ENTITY_NAME'] . "\n" . $message_tags['ALERT_MESSAGE'];

$context_data = array (
  'method' => 'GET',
  'header' => "Connection: close\r\n"
  );

$url = sprintf('%s://%s/smsapi/index.php?To=%s&Meassage=%s',
  $config['smsbox']['scheme'], $config['smsbox']['host'], urlencode($endpoint['phone']),urlencode($message));

$response = get_http_request($url, $context_data);

if (strpos($response, "Accepted") || strpos($response, "Queued"))
{
  $notify_status['success'] = TRUE;
} else {
  $notify_status['success'] = FALSE;
}

unset($message);

// EOF


But still i am not able to get SMS alerts on my mobile phone. Please note that the SMS gateway has given IP based access to my machine on which observium is runnning so i do not need username and password fileds while posting message to the API.

Please help me resolve this issue .

Thanks

--



Vikas Kumar |  Hospitality & PR Coordinator
Mood Indigo, IIT Bombay
+91-9694532954 | mailvikasnow@gmail.com
Facebook