NetPing 8/PWR-220 v3/SMS User Manual page 123

Table of Contents

Advertisement

VALUE  is a written value, i.e. a text of an SMS message
Based on the above description, a command for sending a random SMS using the utility
C:\Program Files (x86)\net-snmp\usr\bin>snmpset.exe -v 1 -c SWITCH 192.168.0.100 .1.3.6.1.4.1.25728.3800.1.9.0 s "[+79130000000] Hello! Test
SMS!"
4. After a command is successfully executed, the next response should be received:
SNMPv2-SMI::enterprises.25728.3800.1.9.0 = STRING: "[+79130000000] Hello! Test SMS!"
Sending SMS Messages via Third-Party Web-Applications (HTTP API)
A maximum length of random SMS messages must not exceed 140 Latin characters or 70 Cyrillic characters. If there are both Latin and
Cyrillic characters in the body of the SMS, then a length of such SMS message cannot exceed 70 characters.
Example of Sending a Random SMS Using a JavaScript Code
To send an SMS through a third-party web applications, there is a need to use the next JavaScript code:
var r = new XMLHttpRequest();
r.open('POST', '
http://192.168.0.100/sendsms.cgi
r.withCredentials = true;
r.send('[+79130000000] Houston, we have a problem!');
where:
192.168.0.100 – is a default IP address of a device.
visor – is a default username for connecting to a device web interface.
ping – is a default password for connecting to a device web interface.
It is possible to send an SMS to several destination numbers, having indicated them in square brackets separated by a comma without spaces. If
destination numbers are not chosen, an SMS will go to the numbers programmed in the settings of SMS notifications.
If a format for data is correct, then the next JavaScript code is returned as a result:
sendsms_result('ok');
A result of sending a message does not influence a returned CGI (
Example of Sending a Random SMS Using a PowerShell Script
To send an SMS through a third-party web applications, there is a need to use the next PowerShell script:
$url = "
http://192.168.137.100/sendsms.cgi
$username = "visor"
$password = "ping"
$reqBody = "[0953345975] Тест NetPing!"
$req = [System.Net.WebRequest]::Create($url)
$req.Method = "POST";
$req.Credentials = new-object System.Net.NetworkCredential($username, $password)
$Body = [System.Text.Encoding]::UTF8.GetBytes($reqBody);
$stream = $req.GetRequestStream();
$stream.Write($Body, 0, $Body.Length);
$stream.Flush();
Copyright © NetPing east Co., Ltd E-mail:
', true, 'visor', 'ping'); // visor:ping – username and password
Common Gateway Interface
"
support@netpingdevice.com
Phone:+886-2-23121582
snmpset.exe
is:
) response. CGI only initiates sending a message.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents