cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Windchill System status page monitoring utility/script that records/emails response time and outages

GaryMansell
6-Contributor

Windchill System status page monitoring utility/script that records/emails response time and outages

Hi,

 

Can anyone recommend a simple monitoring utility to check the response time and availability of various Windchill status URL's with an ability to email Admin's when there are outages of the various sub-systems?

 

Apache check:      https://servername/Windchill\wtcore\test\staticAnon.html

Tomcat check:      https://servername/Windchill\wtcore\test\dynAnon.jsp

Windchill check:   https://servername/Windchill/servlet/ProwtGW

 

Does anyone have anything like this already or willing to suggest a suitable (simple script) monitoring utility?

 

Thanks

Gary

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for replying - i was specifically wanting to avoid installing anything, just a quick and dirty (script) solution.

 

In the end, I put this Powershell script together. It does not do all I want it to do (no email), but is good enough for now.

 

I have set it up to run from servers located at all our remote sites to our Windchill Server and, every 15 seconds, it first checks that the Windchill Server Tomcat is responding. If not, then it then goes on to check Apache and, if not, then it tests the network connection to the Windchill server, and if not, it tests the network connection to our two site router IPs (to see if VPN link is down). It logs any issues to a logfile with dates/times. Gives me a quick clue as to outage causes from all our remote sites.

 

Here it is if it is useful to anyone:

 
$server="windchill.company.com"
$router1="xxx.xxx.xxx.xxx"
$router2="xxx.xxx.xxx.xxx"
$timeout=1
$logfile="C:\Temp\WindchillServerTest.log"

while($true) {
    try {
    Invoke-WebRequest -Uri https://$server/Windchill/wtcore/test/dynAnon.jsp -TimeoutSec $timeout | Out-Null
    } catch {
        "$(Get-Date -format 'u') - Windchill Tomcat Server is not responding" | Out-File -FilePath $logfile -Append
        try {  
            Invoke-WebRequest -Uri https://$server -TimeoutSec $timeout | Out-Null
            "$(Get-Date -format 'u') - Windchill Apache Server is responding" | Out-File -FilePath $logfile -Append
        } catch {
                "$(Get-Date -format 'u') - Windchill Apache Server is not responding" | Out-File -FilePath $logfile -Append    
                if ((Test-Connection -ComputerName $server -Quiet -Count 1) -ne $true ) {
                    "$(Get-Date -format 'u') - Windchill Host Server is not responding" | Out-File -FilePath $logfile -Append

                    if ((Test-Connection -ComputerName $router1 -Quiet -Count 1) -ne $true ) {
                        "$(Get-Date -format 'u') - Router 1 is not responding" | Out-File -FilePath $logfile -Append
                    } else {
                        "$(Get-Date -format 'u') - Router 1 is responding" | Out-File -FilePath $logfile -Append
                    }
                    if ((Test-Connection -ComputerName $router1 -Quiet -Count 1) -ne $true ) {
                        "$(Get-Date -format 'u') - Router 2 is not responding" | Out-File -FilePath $logfile -Append
                    } else {
                        "$(Get-Date -format 'u') - Router 2 is responding" | Out-File -FilePath $logfile -Append
                    }
                } else {
                    "$(Get-Date -format 'u') - Windchill Host Server is responding" | Out-File -FilePath $logfile -Append
                }
        }
    "**********************************************************************" | Out-File -FilePath $logfile -Append
    }
Start-Sleep 15
}

 

 

View solution in original post

9 REPLIES 9

I do not have scripts but try https://www.nagios.org/

 

Thanks for replying - i was specifically wanting to avoid installing anything, just a quick and dirty (script) solution.

 

In the end, I put this Powershell script together. It does not do all I want it to do (no email), but is good enough for now.

 

I have set it up to run from servers located at all our remote sites to our Windchill Server and, every 15 seconds, it first checks that the Windchill Server Tomcat is responding. If not, then it then goes on to check Apache and, if not, then it tests the network connection to the Windchill server, and if not, it tests the network connection to our two site router IPs (to see if VPN link is down). It logs any issues to a logfile with dates/times. Gives me a quick clue as to outage causes from all our remote sites.

 

Here it is if it is useful to anyone:

 
$server="windchill.company.com"
$router1="xxx.xxx.xxx.xxx"
$router2="xxx.xxx.xxx.xxx"
$timeout=1
$logfile="C:\Temp\WindchillServerTest.log"

while($true) {
    try {
    Invoke-WebRequest -Uri https://$server/Windchill/wtcore/test/dynAnon.jsp -TimeoutSec $timeout | Out-Null
    } catch {
        "$(Get-Date -format 'u') - Windchill Tomcat Server is not responding" | Out-File -FilePath $logfile -Append
        try {  
            Invoke-WebRequest -Uri https://$server -TimeoutSec $timeout | Out-Null
            "$(Get-Date -format 'u') - Windchill Apache Server is responding" | Out-File -FilePath $logfile -Append
        } catch {
                "$(Get-Date -format 'u') - Windchill Apache Server is not responding" | Out-File -FilePath $logfile -Append    
                if ((Test-Connection -ComputerName $server -Quiet -Count 1) -ne $true ) {
                    "$(Get-Date -format 'u') - Windchill Host Server is not responding" | Out-File -FilePath $logfile -Append

                    if ((Test-Connection -ComputerName $router1 -Quiet -Count 1) -ne $true ) {
                        "$(Get-Date -format 'u') - Router 1 is not responding" | Out-File -FilePath $logfile -Append
                    } else {
                        "$(Get-Date -format 'u') - Router 1 is responding" | Out-File -FilePath $logfile -Append
                    }
                    if ((Test-Connection -ComputerName $router1 -Quiet -Count 1) -ne $true ) {
                        "$(Get-Date -format 'u') - Router 2 is not responding" | Out-File -FilePath $logfile -Append
                    } else {
                        "$(Get-Date -format 'u') - Router 2 is responding" | Out-File -FilePath $logfile -Append
                    }
                } else {
                    "$(Get-Date -format 'u') - Windchill Host Server is responding" | Out-File -FilePath $logfile -Append
                }
        }
    "**********************************************************************" | Out-File -FilePath $logfile -Append
    }
Start-Sleep 15
}

 

 

Yes, (thanks for the suggestion, though) - this was triggered by remote users (both at remote sites and home VPN) getting "server offline" messages in Creo and WGM, so its about network connectivity really, not server performance per se.

@GaryMansell

That was an interesting Powershell script, thanks for that. I modified it to fit our multiple server setup, but wanted to mention you can test access the a method server by using

…$server/Windchill/servlet/WindchillGW/wt.httpgw.HTTPServer/echo

If you’re running multiple method servers you don’t know which one you got, but you do know at least one is working (or not).

Advance notice:

Out of Office: none.

Craig Raymond

Programmer Analyst Senior Principal

ESS-IT
BAE Systems, Inc.

M: +1 607 221 1421 | E: craig.raymond@baesystems.com
1098 Clark St., Endicott, New York, 13760, United States

baesystems.com

Connect with BAE Systems: upload_-aW1hZ2UwMDEucG5n-8373556911867194366..pngupload_-aW1hZ2UwMDIucG5n-5545897305127550663..pngupload_-aW1hZ2UwMDMucG5n-4501961486644492310..pngupload_-aW1hZ2UwMDQucG5n-6382953101910702540..pngupload_-aW1hZ2UwMDUucG5n-3424352903204331107..pngupload_-aW1hZ2UwMDYucG5n-1047153350165726174..png

GaryMansell
6-Contributor
(To:craymond)

Hey Craig, I am glad it was useful to you, so thanks for getting back to me.

 

I have a query about the need to add the MS check outside of the Tomcat loop check (which was what I think you are suggesting?), So that it first checks for MS response, and if it does not get one goes on to check Tomcat response, and if not then Apache etc. etc.

 

But, in my testing, if the MS does not respond, then neither does Tomcat (I believe Tomcat runs within the MS?). So it seems that if the MS dies, then Tomcat does too - so it's a redundant subsequent test?

 

Are you perhaps suggesting performing the MS check instead of the Tomcat test as the outer part of the loop as a better monitoring solution (perhaps because Tomcat could be responding, even if the MS was not able to)?

 

Rgds

 

Gary 

@ GaryMansell

Tomcat is embedded in the MS so it may be true that checking Tomcat is good enough, or perhaps the MS can fail and not Tomcat. I haven’t seen that situation, or if I have I didn’t realize it.

I would think the call I mentioned is a more complete check, but as I said above it may not really matter. I’m just not 100% sure.

Craig

GaryMansell
6-Contributor
(To:craymond)

Gotcha - thanks. I think I will substitute your MS check for the Tomcat test...

Curious_George
5-Regular Member
(To:GaryMansell)

Great Script.

As for the Email notification, I will recommend the Simple Java Mail CLI


 

avillanueva mentioned setting up JMX Admin Email,
Quick question, 
Is it possible to send out notifications when the Average Response Time is red in the Windchill Status Page?
Top Tags