^1417154013345
@
sname
LinuxCheckTask
slabel
LinuxCheckTask
sdescriptors
xworker.lang.MetaDescriptor3
smany
true
seditCols
2
sinitialization
false
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>通过Ssh连接远程服务器，然后执行Shell脚本（command），然后返回脚本执行结果的任务。</p>

<p><strong>结果返回和报警邮件内容</strong></p>

<p>&nbsp;&nbsp;&nbsp; 返回的结果是字符串，如果不为null那么将会添加到报警的邮件内容中。</p>

<p>&nbsp;&nbsp;&nbsp; 结果返回是通过设置message属性实现的，其中message是freemarker模板，默认模板是${result?if_exists}，其中result是执行command脚本返回的字符串。</p>

<p><strong>监控数据的保存</strong></p>

<p>&nbsp;&nbsp;&nbsp; 监控数据可以保存的数据库中。</p>

<p>&nbsp;&nbsp;&nbsp; 方法是command返回的结果result变量是字符串，如果有多个值那么是通过英文逗号分隔的，这样就可以把值分成一个数组。通过设置列别名属性可以为返回值数组的每一个索引指定一个名称，如果名称不为空，那么就用此名保存到数据库中。</p>

<p>&nbsp;&nbsp;&nbsp; 比如command执行后的返回值是：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 95%,150G,50G,16G,90%</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; 设置的别名是：</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpu,diskSize,diskFreeSize,,memory</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 那么认为command的执行结果第一个值是cpu，第二个值是diskSize，第三个值是diskFreeSize，第四个值不保存，第五个值是内存占用。</p>

<p><strong>可以重写的方法</strong></p>

<ul>
	<li><strong>doCheck</strong><br />
	返回值和监控数据保存都是通过doCheck方法实现的，可以重写。参数result（ command执行的返回值）、<a href="javascript:invoke('thing:xworker.app.monitor.dataobjects.ResMonitor')">monitor</a>、<a href="javascript:invoke('thing:xworker.app.monitor.dataobjects.ResMonitorTaskItems')">monitorTask</a>、<a href="javascript:invoke('thing:xworker.app.monitor.dataobjects.ResMonitorTasks')">resourceTask</a>、<a href="javascript:invoke('thing:xworker.app.monitor.dataobjects.ResMonitorResItems')">resource</a>和<a href="javascript:invoke('thing:xworker.app.server.dataobjects.Server')">sever</a>等，除了result是String其他都是DataObject。</li>
</ul>
#$@text#$@
snotXmlAttribute
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions
sname
actions
sdescriptors
xworker.lang.MetaDescriptor3/@actions
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions/@run
sname
run
sisSynchronized
false
sthrowException
true
suseOtherAction
false
suseOuterJava
true
souterClassName
xworker.app.monitor.liunx.LinuxCheckTaskActions
smethodName
checkTaskEatch
sdisableGlobalContext
false
sattributeTemplate
false
sinterpretationType
Action
svarScope
Global
screateLocalVarScope
false
ssaveReturn
false
sdescriptors
xworker.lang.actions.Actions/@JavaAction
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions/@run1
sname
init
sisSynchronized
false
sthrowException
true
suseOtherAction
false
suseOuterJava
true
souterClassName
xworker.app.monitor.db.DbActions
smethodName
initTasks
sdisableGlobalContext
false
sattributeTemplate
false
sinterpretationType
Action
svarScope
Global
screateLocalVarScope
false
ssaveReturn
false
sdescriptors
xworker.lang.actions.Actions/@JavaAction
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions/@doCheck
sname
doCheck
sisSynchronized
false
sthrowException
true
suseOtherAction
false
suseOuterJava
true
souterClassName
xworker.app.monitor.liunx.LinuxCheckTaskActions
smethodName
doCheck
sdisableGlobalContext
false
sattributeTemplate
false
sinterpretationType
Action
svarScope
Global
screateLocalVarScope
false
ssaveReturn
false
sdescriptors
xworker.lang.actions.Actions/@JavaAction
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions/@getResSelectorPath
sname
getResSelectorPath
stype
string
svalue
xworker.app.appmanager.swt.editors.server.SelectServerShell
sinterpretationType
Self
sattributeTemplate
false
schildsAttributeTemplate
false
svarScope
Local
sisSynchronized
false
sthrowException
true
suseOtherAction
false
screateLocalVarScope
false
ssaveReturn
false
sdisableGlobalContext
false
sdescriptors
xworker.lang.actions.Actions/@ValueFactory
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@actions/@getCommand
sname
getCommand
sisSynchronized
false
sthrowException
true
suseOtherAction
false
suseOuterJava
true
souterClassName
xworker.app.monitor.db.DbActions
smethodName
getCommand
sdisableGlobalContext
false
sattributeTemplate
false
sinterpretationType
Action
svarScope
Global
screateLocalVarScope
false
ssaveReturn
false
sdescriptors
xworker.lang.actions.Actions/@JavaAction
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@name
sname
name
sshowLabel
true
sreadOnly
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@label
sname
label
sshowLabel
true
sreadOnly
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@group
sname
group
sshowLabel
true
ssize
50
sreadOnly
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@message
sname
message
sinputtype
textarea
sshowLabel
true
ssize
70
sreadOnly
false
sdefault
${result?if_exists}
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@command
sname
command
sinputtype
textarea
sshowLabel
true
sinputattrs
codeName=sh codeType=sh wrap=false fillBoth=true cols= rows=
sreadOnly
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@description
sname
description
sinputtype
html
sshowLabel
true
sreadOnly
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@saveData
sname
saveData
slabel
是否保存数据
sinputtype
truefalse
sshowLabel
true
sgroup
SaveMonitorData
sreadOnly
false
sdefault
false
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@dataTypes
sname
columnAlias
slabel
列别名
sshowLabel
true
ssize
60
sgroup
SaveMonitorData
sreadOnly
false
sinheritDescription
false
Sdescription
#$@text#$@
<p>Shell脚本返回的也是一个字符串，这里使用英文逗号分割返回的字符串，这样就分成了一个列，而列别名就是指每个列用什么名字保存在监控数据中。</p>

<p>其中如果列别名为空，那么表示这一列的数据不保存。</p>

<p>比如：</p>

<p>&nbsp;&nbsp;&nbsp; cpu,memory,,diskSize</p>

<p>其中memory和diskSize中间的第三列为空，表示不保存。</p>
#$@text#$@
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@isNumber
sname
compare
sinputtype
truefalse
sshowLabel
true
sgroup
compare
sreadOnly
false
sdefault
false
sinheritDescription
false
sdescription
<p>是否使用返回值和param1比较，如果比较符合条件才生成报警语句。</p>
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@compareOperator
sname
compareOperator
slabel
比较运算符
sinputtype
select
sshowLabel
true
sgroup
compare
sreadOnly
false
sdefault
>
sinheritDescription
false
svalidateAllowBlank
true
LvalidateOnBlur
true
LallowDecimals
true
LallowNegative
true
snotXmlAttribute
false
sdescriptors
xworker.lang.MetaDescriptor3/@attribute
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@compareOperator/@<
sname
<
slabel
<
svalue
<
sdescriptors
xworker.lang.MetaDescriptor3/@attribute/@value
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@compareOperator/@=
sname
=
slabel
=
svalue
=
sdescriptors
xworker.lang.MetaDescriptor3/@attribute/@value
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
@/@compareOperator/@>
sname
>
slabel
>
svalue
>
sdescriptors
xworker.lang.MetaDescriptor3/@attribute/@value
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
