Any way to find IBM websphere nodeagents are down

323 Views Asked by At

Is there any tool or script which continuously check whether IBM Websphere nodeagents are down or not. if down it could send a notification via email (concerned person). if there is any your help would be highly appreciated.

4

There are 4 best solutions below

0
On

You can use a process-monitoring tool or custom scripts that look for the "nodeagent" process in the system process list.

0
On
0
On

I would normally do this by consistently checking nodeagent PID on the system and notify the people but if you require a auto re-start on nodeagent then you can configure it in /etc/inittab as explained in the link provided in previous response. Thanks Note: These opinions are my own.

0
On

This will do ya. Modify srvinfoList and sendmail then paste into 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$\WebSphere\AppServer\profiles\AppSrv01\logs\
WAS7ND2,\d$\WebSphere\AppServer\profiles\AppSrv01\logs\
"@).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" "[email protected]" "[email protected]" "NodeCheck" "Node is Down"}
 start-sleep -seconds 60 }