Ping - копия
Ping - копия
Update=1000
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
[Metadata]
Name=PingStatus
Author=poiru
Information=Shows the ping status of a server.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0
[Variables]
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
maxDownload=10485760
MaxUpload=10485760
; ----------------------------------
; MEASURES for ping status
; ----------------------------------
[measurePing]
Measure=Plugin
Plugin=RunCommand
Program=cmd
Parameter=/c ping -4 xxxxxxxxx
RegExp=".*(Reply from 192.168.3.35|Destination host unreachable).*" ; Ищем строку
"Reply from" или "Destination host unreachable"
StringIndex=4 ; Берем первое совпадение
Substitute=" ":"Offline " ; Если не найдено, то ставим Offline
Substitute="Reply from 192.168.3.35: bytes":"Online" ; Если найдено, то ставим
Online
Substitute="Destination host unreachable":"Offline" ; Если найдено сообщение об
ошибке, то ставим Offline
; ----------------------------------
; STYLES
; ----------------------------------
[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1
[styleText]
StringAlign=Center
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=255,0,0 ; Default color for "Offline" (Red)
FontFace=#fontName#
FontSize=12
AntiAlias=1
ClipString=1
; ----------------------------------
; METERS
; ----------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text=Ping Status
[meterPingStatus]
Meter=String
MeterStyle=styleText
MeasureName=measurePing
X=100
Y=40
W=190
H=18
Text=%1
IfCondition=(MeasurePing = "Offline")
IfTrueAction=[meterPingStatus]SetOption FontColor 255,0,0 ; Red color for "Offline"
IfFalseAction=[meterPingStatus]SetOption FontColor 0,255,0 ; Green color for
"Online"
[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=58
W=190
H=1
SolidColor=255,255,255,15