https://xn--n-soa.lt/w//index.php?title=Munin_plugin_ping&feed=atom&action=history
Munin plugin ping - Versijų istorija
2024-03-29T08:49:24Z
Šio puslapio versijų istorija projekte
MediaWiki 1.35.1
https://xn--n-soa.lt/w//index.php?title=Munin_plugin_ping&diff=9081&oldid=prev
\dev\null: Naujas puslapis: munin pluginas skirtas monitorinti keleta hostų (ICMP ping). 250px Konfigūracija '''/etc/munin/plugin-conf.d/ping_''...
2020-03-10T10:16:38Z
<p>Naujas puslapis: <a href="/w//index.php?title=Munin&action=edit&redlink=1" class="new" title="Munin (puslapis neegzistuoja)">munin</a> pluginas skirtas monitorinti keleta hostų (<a href="/wiki/ICMP" title="ICMP">ICMP</a> ping). <a href="/wiki/Vaizdas:Screenshot_2020-03-10_at_12.10.44.png" title="Vaizdas:Screenshot 2020-03-10 at 12.10.44.png">250px</a> Konfigūracija '''/etc/munin/plugin-conf.d/ping_''...</p>
<p><b>Naujas puslapis</b></p><div>[[munin]] pluginas skirtas monitorinti keleta hostų ([[ICMP]] ping).<br />
<br />
[[Vaizdas:Screenshot 2020-03-10 at 12.10.44.png|250px]]<br />
<br />
Konfigūracija '''/etc/munin/plugin-conf.d/ping_''' <br />
[ping_]<br />
env.host www.google.com 192.168.1.1 ir t.t.<br />
<br />
Scriptas '''/etc/munin/plugins/ping_''' <br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
#<br />
# Copyright (C) 2004 Jimmy Olsen<br />
#<br />
# This program is free software; you can redistribute it and/or<br />
# modify it under the terms of the GNU General Public License<br />
# as published by the Free Software Foundation; version 2 dated June,<br />
# 1991.<br />
#<br />
# This program is distributed in the hope that it will be useful,<br />
# but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br />
# GNU General Public License for more details.<br />
#<br />
# You should have received a copy of the GNU General Public License<br />
# along with this program; if not, write to the Free Software<br />
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<br />
#<br />
#<br />
# Plugin to monitor ping times<br />
#<br />
# Parameters:<br />
#<br />
# ping_args - Arguments to ping (default "-c 2")<br />
# ping_args2 - Arguments after the host name (required for Solaris)<br />
# ping - Ping program to use<br />
# host - Host to ping<br />
#<br />
# Arguments for Solaris:<br />
# ping_args -s<br />
# ping_args2 56 2<br />
#<br />
# Configuration example<br />
# [ping_]<br />
# env.host www.google.com www.yahoo.com<br />
#<br />
#<br />
#%# family=manual<br />
<br />
if [ -z "$host" ]; then<br />
file_host=`basename $0 | sed 's/^ping_//g'`<br />
host=${host:-${file_host:-www.google.com}}<br />
fi<br />
<br />
if [ "$1" = "config" ]; then<br />
echo graph_title Ping times<br />
echo 'graph_args --base 1000 -l 0'<br />
echo 'graph_vlabel seconds'<br />
echo 'graph_category network'<br />
echo 'graph_info This graph shows ping RTT statistics.'<br />
for hosts in $host; do<br />
site=`expr $site + 1`<br />
echo "site$site.label $hosts"<br />
echo "site$site.info Ping RTT statistics for $hosts."<br />
echo "site$site.draw LINE2"<br />
echo "site${site}_packetloss.label $hosts packet loss"<br />
echo "site${site}_packetloss.graph no"<br />
done<br />
exit 0<br />
fi<br />
<br />
for hosts in $host <br />
do<br />
export site=`expr $site + 1`<br />
${ping:-ping} ${ping_args:-'-c 2'} ${hosts} ${ping_args2} \<br />
| perl -n -e 'print "site$ENV{'site'}.value ", $1 / 1000, "\n" <br />
if m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@; <br />
print "packetloss.value $1\n" if /(\d+)% packet loss/;'<br />
done<br />
</syntaxhighlight><br />
<br />
[[Category:Munin]]<br />
[[Category:Scripts]]</div>
\dev\null