How to be the first to know about a server problem or how to SMS PRTG Network Monitor

I want to tell my story related to the maintenance and configuration of servers based on UNIX systems.

Working with an average provider, the task was to find a suitable solution for replacing an outdated VPN server with PPTP and L2TP support. After the new software based on VPN accel 1.3 was configured, the server was put into operation under the real load of 1000-1500 people / server, after working in test mode. The new server met all expectations. The CPU load has dropped significantly, overall performance has improved, if not for one BUT.

After some time, the server began to freeze for no apparent reason and this happened at the most inopportune moment. And I found out, 10-60 minutes after the incident. This state of affairs did not suit anyone. It was necessary to do something.

Firstly, they found the cause of the freezes. The kernel was recompiled under stable release 2.6.32, changed quagga to bird (dynamic routing).

Secondly, I connected an SMS notification about the server status.

The last task was solved using SMSPilot and the monitoring service PRTG Network Monitor 9.2 .

SMSPilot provided one of the lowest prices (no more than 29 kopecks / sms). It remains only to connect SMS notification. To get started, register on the SMSPilot website . In your personal account, we pick up the API key, which will subsequently identify us. Next, download a script from the SMSPilot website under the heading “SMS NOTIFICATION MODULE FOR PRESTASHOP”, which is slightly modified. Opensmspilot.class.php . At the very beginning, insert the code before the class SMSPilot declaration : Next, in the class, save and put the smspilot.class.php file on any web server so that it is available at your domain / smspilot.class.php . It remains only to configure the PRTG monitor. We go through the PRTG web interface. In the Setup / System Administration / Notification Delivery menu . In the " SMS Delivery " section, select " Enter a custom URL for a provider not listed ". A little lower we write in the line " Custom URL ": your domain / smspilot.class.php? Text =% SMSTEXT

$text = $_GET['text'];
require_once('smspilot.class.php');
$sms = new SMSPilot( 'Сюда вставляем API код из личного кабинета' );
$sms->send( 'телефон оповещения начиная с 7', $text);





class SMSPilot {
...
public $apikey = 'Сюда вставляем API код из личного кабинета';
...







. For the test, paste this URL into the address bar of the browser. You should receive a message on your phone (10 messages for free from SMSPilot). If an error message appears, then the script is not available for execution.
image

Do not forget to define a notification. We go into Setup / Account Settings / Notification and add a new notification via the Add new notification button
image

In the Send SMS / Pager Message section : Specify your phone
image

Next, configure the server parameter that we want to monitor. I think the most important parameter is server availability through ping.
image

In the Object Triggers section, clicking on the Add State Trigger button defines the parameters of the notification conditions. For example, such a “When sensor is Down for at least 10 seconds performNotification . In other words, if the sensor switches to the “Unavailable” state within 10 seconds, then notify it using the Notification alert that was previously configured .
image

All. Now try to simulate server inaccessibility and check if the alert works.

Also popular now: