The SRM AIM may return a non-successful status of an HTTP/HTTPS test when the same URL works fine in a standard Web Browser.
Any SRM AIM version monitoring an HTTP or HTTPS site.
Release: SEAUBC99000-12.7-Server Automation-Base Configuration
Component:
The "wget" command is very useful in troubleshooting these types of problems. On their most basic levels, wget and the SRM AIM perform very similar operations, so this is generally a much better troubleshooting test than using a Web Browser. On Windows this must be run from a command prompt. On UNIX/Linux it can be run from a shell.
The following is the basic wget syntax that will generate very useful information:wget -v -S -o {LOG} -U {USER AGENT} --no-check-certificate --http-user={USER} --http-password={PASS} {URL}
Where:
{LOG} - path to desired log file
{USER AGENT} - the user agent to send to the Web Server - to simulate the SRM AIM's default User Agent, this will be either "Java/1.6.0_43" or "Java/1.7.0_72"
{USER} - username
{PASS} - password
Note: If a user/password is not required, then omit the --http-user={USER} --http-password={PASS}
syntax.
{URL} - the target URL that should be downloaded/tested.
For example:wget -v -S -o c:\wget.log -U "Java/1.6.0_43" --no-check-certificate www.ca.com
The above command will generate 2 output files. The C:\wget.log and the page which is downloaded. In the case of the "root" of a web server, this will generally be the default page or document. IThe output file will be "index.html" by default (when the URL ends in a slash or with out specifying a document on the server). This file will be generated in the current working directory of the command prompt/shell.
The contents of the wget.log from the above command:
--2016-01-26 17:29:19-- http://www.ca.com/
Resolving www.ca.com... 23.76.122.199
Connecting to www.ca.com|23.76.122.199|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Cache-Control: private
Content-Length: 0
Location: /us/default.aspx
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-ServerID-App: USWS83
X-UA-Compatible: IE=Edge,chrome=1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Headers: X-Requested-With, Content-Type
Access-Control-Max-Age: 86400
Date: Tue, 26 Jan 2016 22:29:14 GMT
Connection: keep-alive
Location: /us/default.aspx [following]
--2016-01-26 17:29:19-- http://www.ca.com/us/default.aspx
Reusing existing connection to www.ca.com:80.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 21434
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 3.0
If-Modified-Since: 1/20/2016 9:36:38 AM
X-Powered-By: ASP.NET
X-ServerID-App: USWS82
X-UA-Compatible: IE=Edge,chrome=1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Headers: X-Requested-With, Content-Type
Access-Control-Max-Age: 86400
Date: Tue, 26 Jan 2016 22:29:14 GMT
Connection: keep-alive
Length: 21434 (21K) [text/html]
Saving to: ‘index.html’
0K .......... .......... 100% 1.11M=0.02s
2016-01-26 17:29:19 (1.11 MB/s) - ‘index.html’ saved [21434/21434]
As you can see above, the first request receives an HTTP status code of 301/redirected. The redirection points to http://www.ca.com/us/default.aspx and which is served successfully with the HTTP status code of 200 and the file is downloaded successfully as index.html.
Sometime Web Sites/Servers are coded/configured to block certain (or all but "known good") User Agents. If wget fails with the Java User Agent, try omitting the "-U" parameter (which will set it to wget's default of "Wget/{wget version}" and/or change it to a more standard User Agent.
If wget is successful but the SRM AIM is still having problems monitoring HTTP/HTTPS site, open a case with CA Support providing all details accordingly (if you haven't already). Be sure to include the wget.log, and a zip of the port161 or port1691 directory.
"Official" wget builds for Windows can be found here: https://eternallybored.org/misc/wget/
This is linked from http://www.gnu.org/software/wget/ -> http://wget.addictivecode.org/FrequentlyAskedQuestions#download -> https://eternallybored.org/misc/wget/
Most Linux distributions ship with a wget package installed, or can easily install wget via that distributions package manager.
User Agent information:
https://en.wikipedia.org/wiki/User_agent
http://www.useragentstring.com/
HTTP Status code information:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Uncomment the following in the svcrsp.cf and recycle SystemEDGE Agent (Java will emulate a web browser when making the connection to the website):
#useragent="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)"