Answer the question
In order to leave comments, you need to log in
Channel monitoring system?
Guys, after spending about an hour in Google searching for information on the topic of monitoring, I did not find anything suitable for me. Tell me please.
Interested in a system that could download a file and measure the speed during the day - two every 5 - 10 minutes. And also check the availability and ping of the site every minute. those. so to speak active monitoring of the channel.
Let me know if anyone knows.
Answer the question
In order to leave comments, you need to log in
xymon + a couple of plugins to write.
This is how I monitor a large number of servers for download speed.
I monitor the channel with zabbix, or rather the availability of the provider's gateway, through the UserParameter.
#!/bin/bash
wrst=$(mtr -r -c $1 $2 | grep -v HOST | tail -n 1 | awk '{ print ($8) }');wrst=${wrst:-"-1.0"};echo $wrst;
Munin, there is a ready-made plugin for ping (ping_* checks every 5 minutes, plots the response time), there is also a ready-made plugin for checking page load time via http (http_loadtime) put on your server and monitor
Thanks everyone for the advice. But still I decided that it's easier to sketch a small script.
If anyone needs it, use:
Upload the file to the test server, in my case it is 100mb.bin
and test from another server:
Topic closed! Thanks to all!
<?php
function getDownloadSpeed($serverAddress) {
$tempfile = '/tmp/100mb.bin-'.time();
exec('wget http://'.$serverAddress.'/100mb.bin?a='.time().' -O '.$tempfile. ' ~ 2>&1', $out);
unlink($tempfile);
foreach($out as $line) {
if (preg_match('#[\d:\s-]+\((.*?)\).*?saved#', $line, $matches)) {
return $matches[1];
}
}
}
function getPing($ip=NULL) {
$exec = exec("ping -c 3 -s 64 -t 64 ".$ip);
$array = explode("/", end(explode("=", $exec )) );
return ceil($array[1]) . 'ms';
}
function testServer($serverAddress)
{
$ping = getPing($serverAddress);
$download = getDownloadSpeed($serverAddress);
echo "Ping test: ".$ping."\n";
echo "Download speed test: ".getDownloadSpeed($serverAddress)."\n";
file_put_contents('test-vps-'.$serverAddress.'.log', date('d.m.Y H:i:s').'|'.$ping.'|'.$download."\n", FILE_APPEND);
}
testServer('server_ip');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question