📜 ⬆️ ⬇️

How to find out about the problem of the server first, 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 challenge was to find a suitable solution to replace the 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 for a real load of 1000-1500 people / server, after working in test mode. The new server met all expectations. The load on the processor has dropped significantly, increasing overall performance, if not for one BUT.

After some time, the server for no apparent reason began to hang and it happened at the most inopportune moment. And I learned this, 10-60 minutes after the incident. This state of affairs did not suit anyone. We had to do something.

First, find the cause of freezes. The kernel was recompiled for stable release 2.6.32, changed quagga to bird (dynamic routing).
')
Secondly, I connected an SMS notification about the status of the server.

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

SMSPilot provided one of the lowest prices (no more than 29 kopecks / sms). It remains only to connect the SMS alert. To get started, register on the site SMSPilot . In the personal account we collect the API-key, which will subsequently identify us. Then we download the script from the SMSPilot website under the heading "SMS MODULE OF NOTIFICATIONS FOR PRESTASHOP", which is slightly modified. Open smspilot.class.php . At the very beginning we insert the code before the class SMSPilot declaration :

$text = $_GET['text'];
require_once('smspilot.class.php');
$sms = new SMSPilot( ' API ' );
$sms->send( ' 7', $text);



Next in class

class SMSPilot {
...
public $apikey = ' API ';
...



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 section " SMS Delivery " choose " Enter a custom URL for a provider not listed ". Below we write in the line " Custom URL ": your domain / smspilot.class.php? Text =% SMSTEXT . For the test, paste this URL into the address bar of the browser. A message should arrive on your phone (10 messages free of charge from SMSPilot). If you get an error message, then the script is not available for execution.
image

Do not forget to determine the notice. Go to 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 the availability of the server through ping.
image

In the Object Triggers section, clicking the Add State Trigger button will define the parameters for the alert conditions. For example, such “When the sensor is down for at least 10 seconds perform Notification . In other words, if the sensor went into the “Unavailable” state within 10 seconds, then notify by the previously configured Notification alert.
image

Everything. Now try to simulate the server inaccessibility and test the alert.

Source: https://habr.com/ru/post/161601/


All Articles