Уважаемые форумчане, прошу помощи, нигде не нашёл информации о том умеет ли заббикс пинговать с определенным значением tos. Может знаете каки-либо решения? Заранее спасибо за ответы.
#!/usr/bin/env perl
#===============================================================================
#
# FILE: groupHostCont
#
# USAGE: ./groupHostCont "Group name"
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: yukra
# ORGANIZATION:
# VERSION: 1.0
# CREATED: 10.03.2017 09:03:46
# REVISION: ---
#===============================================================================
use strict;
use warnings;
use utf8;
use Data::Dumper;
use lib '/opt/Perl5/libs';
use Monitoring::Zabipi qw(zbx);
Monitoring::Zabipi->new('https://zabbix.example.name/zabbix/api_jsonrpc.php');
zbx( 'auth', 'login', 'password' ) or die "$!";
die "Must be one parameter\n" if scalar(@ARGV) != 1;
my $gid = zbx(
'hostgroup.get',
{
'filter' => {
'name' => shift(@ARGV),
},
'output' => ['groupid'],
}
)->[0]->{'groupid'};
die "Group not found\n" unless defined ($gid);
my $c = zbx(
'host.get',
{
'groupids' => $gid,
'output' => 'count',
'countOutput' => '1,'
}
);
print "$c\n";
#!/usr/bin/env perl
#===============================================================================
#
# file: Grouphostcont
#
# usage: ./grouphostcont "group name"
#
# description:
#
# options: ---
# requirements: ---
# bugs: ---
# notes: ---
# author: Yukra
# organization:
# version: 1.0
# created: 10.03.2017 09:03:46
# revision: ---
#===============================================================================
use strict;
use warnings;
use utf8;
use data::dumper;
use lib '/opt/perl5/libs';
use monitoring::zabipi qw(zbx);
monitoring::zabipi->new('https://zabbix.example.name/zabbix/api_jsonrpc.php');
zbx( 'auth', 'login', 'password' ) or die "$!";
die "must be one parameter\n" if scalar(@argv) != 1;
my $gid = zbx(
'hostgroup.get',
{
'filter' => {
'name' => shift(@argv),
},
'output' => ['groupid'],
}
)->[0]->{'groupid'};
die "group not found\n" unless defined ($gid);
my $c = zbx(
'host.get',
{
'groupids' => $gid,
'output' => 'count',
'countoutput' => '1,'
}
);
print "$c\n";
#!/usr/bin/env bash
if [[ -z ${1} || -z ${2} ]]
then
echo -e "run ${0} <time|loss|jitter> <destination>\nExample:\n\t${0} time 127.0.0.1\n\t${0} jitter ya.ru" ; exit 1
fi
case ${1} in
time) fping ${2} -c 5 -q -O 0xh 2>&1 | awk 'BEGIN{FS="%|/| "} {print $17}';;
loss) fping ${2} -c 5 -q -O 0xh 2>&1 | awk 'BEGIN{FS="%|/| "} {print $10}' ;;
jitter) fping ${2} -c 5 -q -O 0xh 2>&1 | awk 'BEGIN{FS="%|/| "} {print $18-$16}' ;;
* ) echo "run ${0} <time|loss|jitter> <destination>"
esac
Comment