是否有任何工具或脚本连续检查IBM WebSphere nodeagents是否下降。如果下降,它可以通过电子邮件(有关人员)发送通知。如果您有任何帮助,将不胜感激。
您可以使用流程监控工具或自定义脚本在系统过程列表中查找" nodeagent"过程的自定义脚本。
您可以通过/etc/inittab
设置节点代理的重新启动http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&Amt&pproduct=was-nd-mp&
我通常会通过始终检查系统上的nodeagent PID并通知人员,但是如果您需要在nodeagent上自动重新启动,则可以在/etc/inittab中将其配置为在先前响应中提供的链接中解释。谢谢注意:这些意见是我自己的。
这将做你。修改srvinfolist和sendmail,然后粘贴到powershell中。
function sendMail($smtpServer, $Eto, $EFrom, $ESubject, $EBody) {
$msg = new-object Net.Mail.MailMessage ; $smtp = new-object Net.Mail.SmtpClient($smtpServer) ; $msg.From = $EFrom ; $msg.ReplyTo = $EFrom ; $msg.To.Add($Eto) ; $msg.subject = $ESubject ; $msg.IsBodyHTML = $false ; $msg.body = $Ebody ; $smtp.Send($msg)}
Function CheckServers($srvlist) {
ForEach ($srv in $srvlist) {
$SrvName = $srv.split(",")[0] ; $path = "\" + $SrvName + $srv.split(",")[1]
$PIDs = (Get-ChildItem -recurse $path | %{if($_ -match ".pid") {$_.name} })
$ProcInfo = foreach($PIDName in $PIDS) { $PIDName + "`t" + (get-content ($path + $PIDName.substring(0, $PIDName.Length -4) + "" + $PIDName)) }
$perflist = (get-wmiobject Win32_PerfFormattedData_PerfProc_Process -computername $SrvName)
foreach ($perf in $perflist) { $SrvName + "`t" + $perf.PercentProcessorTime + "`t" + $perf.IdProcess + "`t" + [system.math]::ceiling($perf.WorkingSetPrivate/1024000) + "`t" + (LU_PIDNAME $perf.IdProcess $ProcInfo $perf.name) }}}
Function LU_PIDNAME($PIDsrch,$PIDdata,$PIDefault) { foreach ($PID1 in $PIDdata) { if ($PID1.split("`t")[1] -eq $PIDsrch) { $PID1.split("`t")[0] ; $PIDefault = $False } } if($PIDefault -ne $False) { $PIDefault } }
$srvinfoList=@((@"
WAS7ND1,d$WebSphereAppServerprofilesAppSrv01logs
WAS7ND2,d$WebSphereAppServerprofilesAppSrv01logs
"@).split(10))
while($true){
cls;"Checking Servers for nodeagent`n"
$Results = CheckServers $srvinfoList ; $Results
if((($Results -match "nodeagent").count -eq 0)) {sendMail "mail.isp.com" "oncall@myoffice.com" "NodeCheck@myoffice.com" "NodeCheck" "Node is Down"}
start-sleep -seconds 60 }